ldi add finished
[calu.git] / cpu / src / alu_b.vhd
index f3a25ee836032a96a0114b9a460a06d03d09a353..634c7d1605504d5127b136c82c8828fc3fbcdb9a 100755 (executable)
@@ -25,17 +25,19 @@ architecture behaviour of alu is
        \r
 begin\r
 \r
-       add_inst : exec_op\r
+       add_inst : entity work.exec_op(add_op)\r
        port map(clk,reset,left_operand, right_operand, op_detail, alu_state, add_result);\r
        \r
-       and_inst : exec_op\r
+       and_inst : entity work.exec_op(and_op)\r
        port map(clk,reset,left_operand, right_operand, op_detail, alu_state, and_result);\r
-       or_inst : exec_op\r
+\r
+       or_inst : entity work.exec_op(or_op)\r
        port map(clk,reset,left_operand, right_operand, op_detail, alu_state, or_result);\r
-       xor_inst : exec_op\r
+\r
+       xor_inst : entity work.exec_op(xor_op)\r
        port map(clk,reset,left_operand, right_operand, op_detail, alu_state, xor_result);\r
        \r
-       shift_inst : exec_op\r
+       shift_inst : entity work.exec_op(shift_op)\r
        port map(clk,reset,left_operand, right_operand, op_detail, alu_state, shift_result);\r
 \r
 calc: process(left_operand, right_operand, cond, op_group, op_detail ,alu_state,and_result,add_result,or_result,xor_result,shift_result)\r
@@ -97,9 +99,15 @@ begin
        when XOR_OP =>\r
                result_v := xor_result;\r
        when SHIFT_OP =>\r
-               result_v := shift_result;\r
+               result_v := shift_result;
+        when LDST_OP =>
+                if op_detail(IMM_OPT) = '1' then
+                        result_v.result := right_operand;
+                end if;\r
        end case;\r
        \r
+\r
+       result_v.status.zero := '0';\r
        if result_v.result = REG_ZERO then\r
                result_v.status.zero := '1';\r
        end if;\r
@@ -121,24 +129,3 @@ end process calc;
 \r
 end architecture behaviour;\r
 \r
-configuration alu_cfg of alu is\r
-\r
-       for behaviour\r
-               for add_inst : exec_op \r
-                       use entity work.exec_op(add_op);\r
-               end for;\r
-               for and_inst : exec_op \r
-                       use entity work.exec_op(and_op);\r
-               end for;\r
-               for or_inst : exec_op\r
-                       use entity work.exec_op(or_op);\r
-               end for;\r
-               for xor_inst : exec_op\r
-                       use entity work.exec_op(xor_op);\r
-               end for;\r
-               for shift_inst : exec_op\r
-                       use entity work.exec_op(shift_op);\r
-               end for;\r
-       end for;\r
-               \r
-end configuration alu_cfg;\r