This page does not represent the most current semester of this course; it is present merely as an archive.
Use the simulator distribution described in Lab 3 for this lab.
Due to the reading day issue, there will not be a homework due next week. Expect more pipe-based HCL the following week.
iaddl
and leave
to Y86Work in the sim/pipe
directory for this part.
Extend the PIPE processor to support two new instructions: iaddl
and leave
, just as you did with SEQ last lab/homework. To add these instructions, modify the file pipe-full.hcl
, which implements the version of PIPE described in the CS:APP2e textbook. In addition, it contains declarations of some constants that you will need for your solution.
You might be interested in this guide to simulator HCL signal names.
The basic testing process is
linux> make psim VERSION=full
linux> ./psim -t ../y86-code/asumi.yo # tests iaddl
linux> ./psim -t ../y86-code/asuml.yo # tests leave
(-t
means text-only interface. For the GUI, use -g
instead).
Once it seems to work, try
linux> cd ../y86-code; make testpsim
That doesn't test the new instructions, just that you didn't break any of the old ones.
If that passes, try the regression tests:
linux> cd ../ptest; make SIM=../pipe/psim
linux> cd ../ptest; make SIM=../pipe/psim TFLAGS=-il
ptest
does not test leave
very well. Heres how I'll test it:
rrmovl %ebp, %ecx
to asuml.ys
between the leave
and the ret
instructions;make asum.yo
./psim ../y86-code/asuml.yo
finishes you should see 00000400
in %ecx
not 000003f0
If all of that passes, you passed everything!
Submit your pipe-full.hcl in the usual place.