cyclon: response \o/
[calu.git] / cpu / src / fetch_stage_b.vhd
index 6ad91571e619554be4a25eec2e089dd3867957f0..fb0e7fdb1bb24e235fbc4539b2c42323b524af36 100644 (file)
@@ -64,7 +64,7 @@ end process;
 
 
 asyn: process(reset, instr_r_addr, jump_result, prediction_result, branch_prediction_bit, alu_jump_bit, instr_rd_data, rom_ram, instr_rd_data_rom, int_req)
-
+variable instr_pc  : instruction_addr_t;
 begin
        rom_ram_nxt <= rom_ram;
 
@@ -76,9 +76,10 @@ begin
                when others => 
                        instruction <= x"F0000000";
        end case;
-       instr_r_addr_nxt <= std_logic_vector(unsigned(instr_r_addr) + 1);
+       instr_pc := std_logic_vector(unsigned(instr_r_addr) + 1);
+       instr_r_addr_nxt <= instr_pc;
 
-       if (instr_r_addr(ROM_INSTR_ADDR_WIDTH) = '1' and rom_ram = ROM_USE) then
+       if (instr_pc = x"0000007f" and rom_ram = ROM_USE) then
                rom_ram_nxt <= RAM_USE;
                -- TODO: wenn genau auf adresse 0 im RAM ein br steht kracht es... :/
                instr_r_addr_nxt <= x"00000000";