aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/master.v25
1 files changed, 15 insertions, 10 deletions
diff --git a/models/master.v b/models/master.v
index 5234efe..fbcb197 100644
--- a/models/master.v
+++ b/models/master.v
@@ -171,7 +171,7 @@ module master_model
reg done;
assign finished = done;
- reg [WORD_BITS - 1 : 0] masked_data;
+ reg error;
initial begin
strobe <= 0;
@@ -255,19 +255,24 @@ module master_model
endcase // case (next_op_type)
end // else: !if(operations_performed_next_tick == OPERATIONS_COUNT)
- if (acknowledgement_successful) begin
+ if (acknowledgement_successful &&
+ was_read[commands_acknowledged]) begin
+ error = 0;
+
for (i = 0; i < WORD_BITS; i++) begin
- masked_data[i] = SEL_mask[commands_acknowledged][i/GRANULARITY] &
- DAT_I[i];
+ if (SEL_mask[commands_acknowledged][i/GRANULARITY]) begin
+ if (DAT_I[i] != expected_data[commands_acknowledged][i])
+ error = 1;
+ end
end
- if (expected_data[commands_acknowledged] !== masked_data &&
- was_read[commands_acknowledged]) begin
- `MSG(("Master %0d: error: read h%x instead of h%x",
- MASTER_NR, masked_data,
- expected_data[commands_acknowledged]));
+ if (error) begin
+ `MSG(("Master %0d: error: read h%x instead of h%x (%b)",
+ MASTER_NR, DAT_I,
+ expected_data[commands_acknowledged],
+ SEL_mask[commands_acknowledged]));
end
- end // if (acknowledgement_successful)
+ end // if (acknowledgement_successful &&...
end // else: !if(RST_I)
end // always @ (posedge CLK_I)
endmodule // master_model