X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=cpu%2Fsrc%2Ffetch_stage_b.vhd;h=c975af29702992b673c6c8fce467f19ba2ceeb20;hb=250b78e68b59bb5639dba5f0f3e2b23cbe71f823;hp=23d8ecfe13a1b35c9439c2a7ac9a7cd91543b4f0;hpb=505b47bec44e9d2cf079a0a70b7769bef88604cd;p=calu.git diff --git a/cpu/src/fetch_stage_b.vhd b/cpu/src/fetch_stage_b.vhd index 23d8ecf..c975af2 100644 --- a/cpu/src/fetch_stage_b.vhd +++ b/cpu/src/fetch_stage_b.vhd @@ -52,20 +52,27 @@ begin if (reset = RESET_VALUE) then instr_r_addr <= (others => '0'); - rom_ram <= ROM_USE; + rom_ram <= ROM_USE; + led2 <= '0'; elsif rising_edge(clk) then instr_r_addr <= instr_r_addr_nxt; rom_ram <= rom_ram_nxt; + led2 <= rom_ram; --rom_ram_nxt; end if; 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) - +asyn: process(reset, s_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; - + +-- if (s_reset = RESET_VALUE) then +-- rom_ram_nxt <= RAM_USE; +-- instr_r_addr_nxt <= (others => '0'); +-- end if; + case rom_ram is when ROM_USE => instruction <= instr_rd_data_rom; @@ -74,9 +81,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"; @@ -121,7 +129,5 @@ begin end process; -led2 <= rom_ram; - end behav;