This directory contains the code to construct simulators for PIPE and
the variants of it described in the homework exercises.

***************************************
Directions for building the simulators
***************************************

Two forms of the simulator can be constructed:
	pipe_tk: Uses a graphic user interface.  Nice for visualizing
		and debugging.  Requires installation of Tcl/Tk.
	pipe_tty: Prints all information about its runtime behavior
		on the terminal.  Hard to understand what's going on,
		but useful for automated testing, and doesn't require
		any special installation features.

For each simulator, different "versions" can be constructed to use
	different HCL files when working on the different homework problems

	VERSION		HCL File	Description
	std		pipe-std.hcl	Standard simulator (default)
	broken		pipe-broken.hcl Does not handle any hazards
	full		pipe-full.hcl	For adding iaddl and leave
	nobypass	pipe-nobypass.hcl	For implementing PIPE-
	lf		pipe-lf.hcl	For implementing load forwarding
	nt		pipe-nt.hcl	For implementing NT branch prediction
	btfnt		pipe-btfnt.hcl	For implementing BTFNT branch pred.
	1w		pipe-1w.hcl	For implementing single write port

Simulators can be constructed using make.  Just say:

	make pipe_tty VERSION=xxx
		or
	make pipe_tk VERSION=xxx

Where "xxx" is one of the versions listed above.

*************************************************
Directions for building the ncopy driver programs
*************************************************

ncopy.{c,ys}
	C and Y86 versions of the function ncopy(int *src, int *dst,
	int len) that copies src to dst, returning the number of
	positive (k > 0) ints k in src. This is the program that you
	will be modifying for the lab.

sdriver.{ys,yo}
	Driver for testing ncopy.ys on a small example (len=4).
ldriver.{ys,yo}
	Driver for testing ncopy.ys on a larger example (len=63).

	Type "make drivers" to build and assembly these two examples
	from your current version of ncopy.ys.

gen-driver.pl
	Perl script that can generate driver file any length between
	1 and 64.

	Example:
		./gen-driver.pl -n 33 -f ncopy.ys > mdriver.ys
		make mdriver.yo

	Run ./gen-driver.pl -h for more information

benchmark.pl
	Perl script that will generate and measure the performance
	of the ncopy function over a range of lengths.  Computes
	the average CPE ovre all of the lengths.

	NOTE: This script does not check for correct functionality
	by ncopy.  It simply evaluates performance.

	Example:
		./benchmark.pl -n 64
	Run ./benchmark.pl -h for more information.

correctness.pl
	Perl script that tests ncopy function for correctness over a range
	of block lengths.

	Example
		./correctness.pl -n 64
	Run ./correctness.pl -h for more information
