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
627713d5
Commit
627713d5
authored
Jan 17, 2017
by
Noémie Fong
Browse files
Merge branch 'master' of git.eleves.ens.fr:mpepin/sysdig
parents
c4b9b2c1
e43a6bc8
Changes
2
Hide whitespace changes
Inline
Side-by-side
cpu/src/main.mj
View file @
627713d5
...
...
@@ -10,6 +10,11 @@ require alu/main
(* The global CPU architecture *)
(* --------------------------- *)
(*
main () = (instruction:[word], pc_value:[word], is_jr,
imm_addr:[word], is_jal, pc_incr:[word])
where
*)
main () = () where
(* Reading the next instruction from the ROM *)
(instruction, pc_incr) = next_instruction(
...
...
@@ -58,8 +63,8 @@ main () = () where
read_data_mem = data_mem<32,word>(alu_result, read_data2, mem_read,
mem_write);
(* If is_jal is set, PC+4 is taken as input for registers *)
(* If is_jal is set,
(
PC+4
)/4
is taken as input for registers *)
write_data = mux_n<word>(is_jal,
pc_incr,
0.0.(
pc_incr
[..word-3])
,
mux_n<word>(mem_to_reg, read_data_mem, alu_result));
end where
test/asm/jumps.s
View file @
627713d5
...
...
@@ -8,7 +8,6 @@ main:
jal
print_1
#
Affiche
2
la
$ra
,
here
j
print_2
here
:
...
...
@@ -22,7 +21,9 @@ here:
print_1
:
li
$a0
,
1
add
$t1
,
$zero
,
$ra
jal
print_int
add
$ra
,
$zero
,
$t1
jr
$ra
#
Ne
devrait
pas
arriver
!
...
...
@@ -31,7 +32,9 @@ print_1:
print_2
:
li
$a0
,
2
add
$t1
,
$zero
,
$ra
jal
print_int
add
$ra
,
$zero
,
$t1
jr
$ra
#
Ne
devrait
pas
arriver
!
...
...
@@ -40,7 +43,9 @@ print_2:
print_3_and_exit
:
li
$a0
,
3
add
$t1
,
$zero
,
$ra
jal
print_int
add
$ra
,
$zero
,
$t1
j
exit
#
Ne
devrait
pas
arriver
!
...
...
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