Commit e817cdf8 authored by Quentin Aristote's avatar Quentin Aristote
Browse files

partially corrected addressing

parent 875c4b81
......@@ -176,7 +176,8 @@ bne(s:[16], t:[16], imm:[16], PC:[16]) = new_PC:[16] where
end where
j(label:[26], PC:[32]) = new_PC:[32] where
new_PC = PC[0..3].label.00
(* le compilateur assembleur rajoute 0x00400024 par défaut *)
new_PC = sub<32>(PC[0..3].label.00, 0x00400024)
end where
type_i(opcode:[6],
......@@ -309,10 +310,12 @@ execute_command(command:[32], old_PC:[32]) = (t0:[16],
(PC, c) = add<32>(old_PC, 0b00000000000000000000000000000100, 0) ;
(* la valeur ajoutée à PC dans les branchements est divisée par 4 dans le code
assembleur compilé pour gagner 2 bits *)
(write_enable_I,
write_address_I,
write_value_I,
new_PC_I) = type_i(opcode, rs, rs_val, rt, rt_val, imm, PC[16..]) ;
new_PC_I) = type_i(opcode, rs, rs_val, rt, rt_val, imm, PC[14..29]) ;
write_value_R = type_r(rs_val, rt_val, shamt, funct) ;
new_PC_J = j(pseudo_address, PC) ;
......@@ -324,7 +327,7 @@ execute_command(command:[32], old_PC:[32]) = (t0:[16],
write_address = multi_mux<5>(I, write_address_I, rd) ;
write_value = multi_mux<16>(I, write_value_I, write_value_R) ;
new_PC = multi_mux<32>(J + I,
multi_mux<32>(J, new_PC_J, PC[..15].new_PC_I),
multi_mux<32>(J, new_PC_J, PC[..13].new_PC_I.00),
PC)
end where
......
This diff is collapsed.
Supports Markdown
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