Skip to content

Commit

Permalink
Merge pull request #6 from Nekkit6/master
Browse files Browse the repository at this point in the history
Правка tb_data_mem
  • Loading branch information
HepoH3 authored Sep 20, 2023
2 parents ea2eeaa + 5bdc5cc commit d802189
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Labs/03. Register file and memory/tb_data_mem.sv
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ parameter STEP = 8;
for (i = 0; i < 4; i = i + 1) begin
if(i==0) begin
repeat(2)@(posedge CLK);
RDa = RD;
#1; RDa = RD;
end else
if(RD !== RDa) begin
$display("incorrect conversion of the reading address = %h, time: %t", A, $time);
Expand All @@ -121,6 +121,13 @@ parameter STEP = 8;
$display("reading from data memory must be synchronous, time: %t", $time);
err_count = err_count + 1;
end
@(posedge CLK);
i = {14{1'b1}};
repeat(2) @(posedge CLK);
if (RD === 'd3735928559) begin
$display("incorrect reading from address = %d, data = %h", A, RD);
err_count = err_count + 1;
end
$display("Number of errors: %d", err_count);
if( !err_count ) $display("\ndata_mem SUCCESS!!!\n");
$finish();
Expand Down

0 comments on commit d802189

Please sign in to comment.