Divide by 4 instruction address to use space more efficiently #4

Merged
BriceBoisson merged 2 commits from test-2 into main 2023-11-25 10:39:46 +00:00
1 changed files with 3 additions and 1 deletions
Showing only changes of commit c6292d3b4f - Show all commits

View File

@ -92,6 +92,8 @@ module tb_risc_v_cpu ();
$finish; $finish;
end end
instruction_addr = instruction_addr / 4;
if (test[instruction_addr][5:0] == 6'b111111) begin if (test[instruction_addr][5:0] == 6'b111111) begin
test[instruction_addr][5:0] = reg_number; test[instruction_addr][5:0] = reg_number;
test[instruction_addr][37:6] = reg_test_value; test[instruction_addr][37:6] = reg_test_value;
@ -111,7 +113,7 @@ module tb_risc_v_cpu ();
for (i = 0; i < 100; i = i + 1) begin for (i = 0; i < 100; i = i + 1) begin
if (test[risc_v_cpu.program_counter.pc_addr][5:0] != 6'b111111) begin if (test[risc_v_cpu.program_counter.pc_addr][5:0] != 6'b111111) begin
curent_addr = risc_v_cpu.program_counter.pc_addr; curent_addr = risc_v_cpu.program_counter.pc_addr / 4;
`next_cycle `next_cycle
if (test[curent_addr][5:0] != 6'b111111) begin if (test[curent_addr][5:0] != 6'b111111) begin
if (test[curent_addr][5:0] < 6'b100000) begin if (test[curent_addr][5:0] < 6'b100000) begin