Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Pepin
sysdig
Commits
a22a55c1
Commit
a22a55c1
authored
Jan 17, 2017
by
Martin Pépin
Browse files
Merge branch 'theend'
parents
c3eddb46
5eaa6853
Changes
2
Hide whitespace changes
Inline
Side-by-side
cpu/src/main.mj
View file @
a22a55c1
...
...
@@ -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);
...
...
cpu/src/prog_counter.mj
View file @
a22a55c1
...
...
@@ -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);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment