CS 3330: Lab 5: Working with Pipe

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.

Add iaddl and leave to Y86

Work 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.

Testing

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:

  1. add rrmovl %ebp, %ecx to asuml.ys between the leave and the ret instructions;
  2. make asum.yo
  3. when ./psim ../y86-code/asuml.yo finishes you should see 00000400 in %ecx not 000003f0

If all of that passes, you passed everything!

Submission

Submit your pipe-full.hcl in the usual place.

Copyright © 2015 by Luther Tychonievich. All rights reserved.
Last updated 2014-10-09 13:38 -0400