Main

Assignment 1 (50 Points) - Due M February 1, 11:59PM

Testfiles

testfiles.tgz

Announcements and Clarification (Updated January 14th, 1:30pm):

  • Libraries: Only the standard C and C++ libraries including STL may be utilized within your assigment.
  • Supporting Tools: For parsing inputs files, you may utilize lexical analyzers (e.g. lex) and parsers (yacc or bison). If you choose to utilize these tools, you must provide all files needed to run lex and yacc on ece3 and ensure your code can be compiled in its entirety using CMake (i.e. specifically using the commands specified within this assignment). Given the simplicity of the technology and netlist file formats (i.e. full tab/space delimited tokens), directly parsing the file in C/C++ may require less work.

Critical Path Calculation

Create a program capable of calculating the critical path for a logic circuit specified by a netlist file given a technology library file. Generally, the critical path can be defined as the longest register to register delay path. For this assignment, your program must be able to calculate the critical path from any input (implicitly assumed to be a register) to any output (explicitly required to be a register).

ECE 574A: For this assignment, your program must be able to calculate the critical path from any input (implicitly assumed to be a register) or instantiated register to any output (explicitly required to be a register) or instantiated register.

Commandline Arguments

Your program must be capable of utilizing commandline arguments specifying the location of the technology library and netlist files along with an option flag ("-cp") indicating that the critical path operation should be performed. The following provides an example of the acceptable commandline arguments:

critpath -cp techfile netlist

Your program must ensure the user has correctly provided the required commandline options and display a usage statement if the provided arguments are incorrect.

Technology File

The technology library file provides the specification for those components that are available to be utilized within the netlist, where:

  • All empty lines should be ignored
  • All line beginning with "//" are considered comment and should be ignored
  • The technology library file can be assumed to be fully space/tab delimited, i.e. at least one space or tab should appear between each token that needs to be parsed, including semicolons.
  • Component declarations are declared on a single line using the format:
COMPONENTNAME : NUMBEROFINPUTS DELAY
  • All technology library files must at least declare the REG component
  • All components must have unique names
  • Component names are case sensitive and can consists of any number of letters or digits
  • The number of inputs for a component must be at least 1
  • The delay for each component is specified in nanoseconds as a real number (floating point).

When parsing the technology library file, your program must provide descriptive error messages indicating if the technology library file does not adhere the above specifications.

Netlist File

The netlist file provides an acyclic connection of components specified within the technology library file, where

  • All empty lines should be ignored
  • All line beginning with "//" are considered comment and should be ignored
  • The netlist file can be assumed to be fully space/tab delimited, i.e. at least one space or tab should appear between each token that needs to be parsed, including semicolons.
  • All inputs must be explicitly declared on a single line using the format:
INPUTS : INPUT1 INPUT2 INPUTN
  • All outputs must be explicitly declared on a single line using the format:
OUTPUTS : OUTPUT1 OUTPUT2 OUTPUTN
  • All wires (internal connections between components) must be explicitly declared on a single line using the format:
WIRES : WIRE1 WIRE2 WIREN
  • All outputs must be explicitly connected to the output of a REG component.
  • Component instantiations are declared on a single line using the format:
COMPONENTNAME INSTANCENAME : OUTPUT INPUT1 INPUT2 INPUTN
Note: the output from all components is specified as the first token following the semicolon.
  • All names for components, inputs, outputs, wires, and instances must be unique.
  • All names for inputs, outputs, wires, and instances are case sensitive and can consists of any number of letters or digits
  • ECE474A: You can assume that all REG components will only be used for the outputs.
  • ECE574A: Any number of REG components can be declared within the netlist.

When parsing a netlist file, your program must provide descriptive error messages indicating if the netlist file does not adhere the above specifications.

Critical Path Calculation

Given the technology library file and netlist file provided on the commandline, your program must create a direct acyclic graph (DAG) representation of the specific netlist and calculate the critical path. Assuming the input files do not contain any errors, the critical path should be output as:

Critical Path : 5.124 ns

Distribution Files

critpath.tgz

The distribution files critpath.tgz for this assignment include a basic example of checking commandline arguments along with a simple framework for using CMake. The distribution files also include two public technology files and five public netlist files that will be used to test and grade your assignment. In addition, one private technology file and five private technology files will be also be used to test and grade your assignment.

Given the provided TAR/GZIPPED archive, the following commands can be used to extract, compile, and execute the program:

tar xvzf critpath.tgz
cd critpath
mkdir build
cd build
cmake ..
make
./src/critpath

Submission Requirements and Grading

  • All programming assignments must be submitted via D2L as a single ZIP or TAR/GZIPPED archive.
  • All programming assignments must be implemented with C or C++ using the CMake cross platform make tools.
  • All programming assignments will be compiled and tested using the ECE department server ece3.
  • All programming assignments will be compiled using the following commands:
mkdir build
cd build
cmake ..
make
./src/critpath
  • Programs that fail to compile or terminate in a segmentation fault will receive a score of 0. NO EXCEPTIONS.
  • The instructor will NOT answer any questions regarding assignments (by email or in person) on the day the assignment is due.
  • All programming assignments will be tested using the provided public test files along with several additional private test files.