X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=cpu%2Fsrc%2Falu_b.vhd;h=44306f598be50c1c501da6a88421f57e91462361;hb=f7c3463501271ae8c2c9c66634e7cfb21821140c;hp=b0bf5a4419d68a60f2014a75e741bfc55ce399d4;hpb=d5bb934717a97413ad968249e34ec4d55293e083;p=calu.git diff --git a/cpu/src/alu_b.vhd b/cpu/src/alu_b.vhd index b0bf5a4..44306f5 100755 --- a/cpu/src/alu_b.vhd +++ b/cpu/src/alu_b.vhd @@ -49,6 +49,10 @@ calc: process(left_operand, right_operand,displacement, cond, op_group, op_detai variable mem_op : std_logic; variable alu_jump : std_logic; variable nop : std_logic; + + variable pinc_v, pwr_en_v : std_logic; + + variable prog_cnt_nxt : std_logic_vector(prog_cnt'range); begin result_v := alu_state; @@ -63,12 +67,13 @@ begin addr <= add_result.result; data <= right_operand; - pinc <= '0'; - pwr_en <= '0'; + pinc_v := '0'; + pwr_en_v := '0'; + paddr <= (others =>'0'); result_v.result := add_result.result; - + prog_cnt_nxt := std_logic_vector(unsigned(prog_cnt)+1); case cond is when COND_NZERO => cond_met := not(alu_state.status.zero); @@ -136,7 +141,20 @@ begin left_o <= prog_cnt; end if; alu_jump := '1'; - when JMP_ST_OP => null; + when JMP_ST_OP => + left_o <= prog_cnt; + men_en := '1'; + alu_jump := '1'; + men_op := '1'; + pinc_v := '1'; + pinc_wr_en := '1'; + paddr <= (others =>'0'); + + addr <= pval; + data <= prog_cnt_nxt; + -- if(op_detail(RET_OPT) = '1' then + -- null; + -- end if; end case; @@ -157,14 +175,18 @@ begin result_v.mem_op := mem_op and cond_met; result_v.alu_jump := alu_jump and cond_met; result_v.brpr := brpr and nop; + + pwr_en_v := pwr_en_v and cond_met; if (result_v.alu_jump = '0') and (brpr = '1') then result_v.result := (others => '0'); - result_v.result(prog_cnt'range) := std_logic_vector(unsigned(prog_cnt)+1); + result_v.result(prog_cnt'range) := prog_cnt_nxt; --result_v.reg_op := '1'; end if; alu_result <= result_v; + pinc <= pinc_v; + pwr_en <= pwr_en_v; end process calc;