Merge pull request #4 from BriceBoisson/test-2
Divide by 4 instruction address to use space more efficiently
This commit is contained in:
		@@ -92,6 +92,8 @@ module tb_risc_v_cpu ();
 | 
			
		||||
                $finish;
 | 
			
		||||
            end
 | 
			
		||||
 | 
			
		||||
            instruction_addr = instruction_addr / 4;
 | 
			
		||||
 | 
			
		||||
            if (test[instruction_addr][5:0] == 6'b111111) begin
 | 
			
		||||
                test[instruction_addr][5:0] = reg_number;
 | 
			
		||||
                test[instruction_addr][37:6] = reg_test_value;
 | 
			
		||||
@@ -110,8 +112,8 @@ module tb_risc_v_cpu ();
 | 
			
		||||
        /* Run The Program */
 | 
			
		||||
 | 
			
		||||
        for (i = 0; i < 100; i = i + 1) begin
 | 
			
		||||
            if (test[risc_v_cpu.program_counter.pc_addr][5:0] != 6'b111111) begin
 | 
			
		||||
                curent_addr = risc_v_cpu.program_counter.pc_addr;
 | 
			
		||||
            if (test[risc_v_cpu.program_counter.pc_addr / 4][5:0] != 6'b111111) begin
 | 
			
		||||
                curent_addr = risc_v_cpu.program_counter.pc_addr / 4;
 | 
			
		||||
                `next_cycle
 | 
			
		||||
                if (test[curent_addr][5:0] != 6'b111111) begin
 | 
			
		||||
                    if (test[curent_addr][5:0] < 6'b100000) begin
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user