Commit 8d276101 authored by Martin Pépin's avatar Martin Pépin
Browse files

Fix main, fix typo

parent d93a7b80
......@@ -21,7 +21,7 @@ ALU(input1:[32], input2:[32], alu_control:[4], alu_op:[3], use_shamt,
mux(alu_control[1], (* Case logical shift *) (*TODO : optimiser use_shamt ?*)
mux(use_shamt,
shift_by_shamt_ALU(input1, shamt, 1, alu_control[3]),
shift:_by_reg_ALU(input1, input2, 1, alu_control[3])
shift_by_reg_ALU(input1, input2, 1, alu_control[3])
),
mux(use_shamt, (* Case logical shift left *)
......
......@@ -31,8 +31,13 @@ main (b) = (instruction:[word], syscall, ctrl:[2]) where
(* Processing the calculi *)
imm = extand_const_n<16,16>(instruction[16..31]);
alu_input_2 = mux_n<word>(
use_shamt,
extand_left_n<5,word-5>(instruction[21..25]),
mux_n<word>(alu_src, imm, read_data2)
)
(alu_zero, alu_result) = ALU<word>(read_data1,
mux_n<word>(alu_src, imm, read_data2),
alu_input_2,
alu_ctrl);
(* Reading/writing RAM *)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment