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

Merge branch 'theend'

parents c3eddb46 5eaa6853
......@@ -10,15 +10,11 @@ require alu/main
(* The global CPU architecture *)
(* --------------------------- *)
(*
main (b) = (instruction:[word], syscall, ctrl:[2], alu_result:[32],
alu_input_2:[32], alu_ctrl:[4]) where
*)
main () = (instruction:[word], pc_value:[word]) where
main () = () where
(* Reading the next instruction from the ROM *)
(instruction, syscall, ctrl, pc_incr, pc_value) = next_instruction(instruction[6..],
imm_addr, jump, branch and (not(is_beq) xor alu_zero), is_jr);
(instruction, pc_incr) = next_instruction(
instruction[6..], imm_addr, jump,
branch and (not(is_beq) xor alu_zero), is_jr);
(* If is_jr is set, the immediate value is replaced by the 1st read register value *)
imm_addr = mux_n<word>(is_jr, read_data1, extended_imm);
......
......@@ -39,10 +39,9 @@ end where
(* Gives the last value of PC and sets PC to the next instruction's address. *)
PC (partial_jump_addr:[word-6], imm:[word], jump, branch, is_jr, wait)
= (value:[word], incr_addr:[word]) where
= (r:[word], incr_addr:[word]) where
(next_addr, incr_addr) = calc_address(r, partial_jump_addr, imm, jump, branch, is_jr);
r = meta_reg<word>(next_addr, not wait);
value = r;
end where
couter4(init) = ctrl:[2] where
......@@ -53,7 +52,7 @@ end where
(* Reads the next instruction and handles the syscalls *)
next_instruction(partial_jump_addr:[word-6], imm:[word], jump, branch, is_jr)
= (instruction:[word], syscall, ctrl:[2], pc_incr:[word], pc_value:[word]) where
= (instruction:[word], pc_incr:[word]) where
(* The real instruction read from the ROM *)
(pc_value, pc_incr) = PC(partial_jump_addr, imm, jump, branch, is_jr, wait);
......
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