aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojciech Kosior <kwojtus@protonmail.com>2020-09-09 22:22:50 +0200
committerWojciech Kosior <kwojtus@protonmail.com>2020-09-09 22:22:50 +0200
commit334f86ccc899b92e44f71f1ad85dcc3c31ef1a2c (patch)
treebe6b2dc87d6362ba9fbed0f4be5ff85a90f2886a
parentbc43ceac936b48fdccfcac33e172e176273d504f (diff)
downloadAGH-engineering-thesis-334f86ccc899b92e44f71f1ad85dcc3c31ef1a2c.tar.gz
AGH-engineering-thesis-334f86ccc899b92e44f71f1ad85dcc3c31ef1a2c.zip
fix verification when SEL_O != 4'b1111
-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