From 405c9d90b5e046f45624b677b4d3b4e1ae4e64b3 Mon Sep 17 00:00:00 2001 From: Noah Boorstin Date: Thu, 28 Jan 2021 15:42:47 -0500 Subject: [PATCH] busybear testbench: understand bytemask for writes --- wally-pipelined/regression/wally-busybear.do | 2 +- wally-pipelined/testbench/testbench-busybear.sv | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wally-pipelined/regression/wally-busybear.do b/wally-pipelined/regression/wally-busybear.do index 39268b3d..ab1cfac3 100644 --- a/wally-pipelined/regression/wally-busybear.do +++ b/wally-pipelined/regression/wally-busybear.do @@ -130,6 +130,6 @@ add wave /testbench_busybear/InstrWName #set DefaultRadix hexadecimal # #-- Run the Simulation -run 2640 +run 3850 #run -all ##quit diff --git a/wally-pipelined/testbench/testbench-busybear.sv b/wally-pipelined/testbench/testbench-busybear.sv index 3951afa5..07b48d37 100644 --- a/wally-pipelined/testbench/testbench-busybear.sv +++ b/wally-pipelined/testbench/testbench-busybear.sv @@ -123,8 +123,12 @@ module testbench_busybear(); end scan_file_memW = $fscanf(data_file_memW, "%x\n", writeDataExpected); scan_file_memW = $fscanf(data_file_memW, "%x\n", writeAdrExpected); - if (writeDataExpected != WriteDataM) begin - $display("%t ps: WriteDataM does not equal writeDataExpected: %x, %x", $time, WriteDataM, writeDataExpected); + for(int i=0; i<8; i++) begin + if (ByteMaskM[i]) begin + if (writeDataExpected[i*8+7 -: 8] != WriteDataM[i*8+7 -: 8]) begin + $display("%t ps: WriteDataM does not equal writeDataExpected: %x, %x", $time, WriteDataM, writeDataExpected); + end + end end if (writeAdrExpected != DataAdrM) begin $display("%t ps: DataAdrM does not equal writeAdrExpected: %x, %x", $time, DataAdrM, writeAdrExpected);