bugfix in fetch
[calu.git] / cpu / src / fetch_stage_b.vhd
index 1ff0fad814872a115dcfba8b1fd80baa0a1bdb4d..cdc6dc6a018f58b578a1759ccd5a110b462af13c 100644 (file)
@@ -77,7 +77,7 @@ begin
        end case;
        instr_r_addr_nxt <= std_logic_vector(unsigned(instr_r_addr) + 1);
 
-       if (instr_r_addr(ROM_INSTR_ADDR_WIDTH) = '1') then
+       if (instr_r_addr(ROM_INSTR_ADDR_WIDTH) = '1' and rom_ram = ROM_USE) then
                rom_ram_nxt <= RAM_USE;
                instr_r_addr_nxt <= (others => '0');
        end if;