From 334f86ccc899b92e44f71f1ad85dcc3c31ef1a2c Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Wed, 9 Sep 2020 22:22:50 +0200 Subject: fix verification when SEL_O != 4'b1111 --- models/master.v | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'models/master.v') 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 -- cgit v1.2.3