Skip to content

Commit

Permalink
Fix tb_ecc_scrubber
Browse files Browse the repository at this point in the history
  • Loading branch information
micprog committed Jan 17, 2024
1 parent e422e55 commit 3379265
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -e

VSIM_LOGFILE=vsim.log

bender script vsim -t test -t rtl > compile.tcl
bender script vsim -t test -t rtl --vlog-arg="-svinputport=compat" -t deprecated > compile.tcl

$VSIM -c -do 'source compile.tcl; quit' > vcom.log

Expand Down
14 changes: 6 additions & 8 deletions test/tb_ecc_scrubber.sv
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ module tb_ecc_scrubber #(
typedef struct packed {
bit error;
data_t corrected;
logic [ 31:0] bit_corrections;
logic bit_corrections;
logic [$clog2(BankSize)-1:0] add;
} result_t;
result_t golden_queue[$];


function automatic void generate_stimuli();
logic [31:0] corr;
logic corr;
corr = '0;

repeat (1)
Expand All @@ -112,20 +112,17 @@ module tb_ecc_scrubber #(
// Randomize
if (stimuli.randomize()) begin
stimuli_queue.push_back(stimuli);
golden_queue.push_back('{error: stimuli.error, corrected: stimuli.get_data(), bit_corrections: corr, add: gen_i % BankSize});
golden_queue.push_back('{error: stimuli.error, corrected: stimuli.get_data(), bit_corrections: stimuli.error, add: gen_i % BankSize});
end else begin
$error("Could not randomize.");
end
if (stimuli.error) begin
corr = corr + 1;
end
end
endfunction : generate_stimuli

// Apply Stimuli

logic scrub_trigger;
logic [ 31:0] bit_corrections;
logic bit_corrections;
logic intc_req;
logic intc_we;
logic [$clog2(BankSize)-1:0] intc_add;
Expand Down Expand Up @@ -179,7 +176,8 @@ module tb_ecc_scrubber #(
.clk_i ( clk ),
.rst_ni ( rst_n ),
.scrub_trigger_i ( scrub_trigger ),
.bit_corrections_o( bit_corrections ),
.bit_corrected_o ( bit_corrections ),
.uncorrectable_o (),
.intc_req_i ( intc_req ),
.intc_we_i ( intc_we ),
.intc_add_i ( intc_add ),
Expand Down

0 comments on commit 3379265

Please sign in to comment.