SoC Design Flow and Tools
Homework Assignment 1
SystemC GCD Calculator
Last Updated: March 9, 2005
Implement a GCD calculator in SystemC. The
details of the assignment are found here.
- The calculator must be implemented as shown in the schematic. Therefore,
you must have 7 different modules (controller, datapath, mux, register,
comparator, subtractor, and gcd).
- The gcd module corresponds to the box surrounding the entire design.
The GO_i, clk, x_i, and y_i inputs should also be inputs to the gcd module,
even though this is not explicitly shown. The gcd module and controller should
also have a "rst" input and "done" output, which is not shown. The rst resets
the FSM to an initial state, and the done output signals that the gcd has been
calculated.
- The gcd module should simply connect the controller and datapath. The
controller should be implemented as an FSM with any number of states.
- The datapath must be a structural module that simply connects the muxes,
registers, comparator, and subtractors.
- All outputs and inputs of each module should be named the same as the
schematic.
- You should also have a main function that simply connects the gcd module
and the testbench.
- Your testbench should test all 256 combinations of inputs for x_i and y_i.
Make sure to use the rst, go_i, and done signals in the testbench. Make sure
to check the Data_o output after the done signal has been asserted.
- Each module should be placed in a file with the same name as the module.
The main function should be in a file main.cc and the testbench should be in a
file testbench.cc.
- You must create a makefile that compiles the program and names the
executable "gcd".
- You will lose points for not following these guidelines, regardless of
whether or not your code works.
You need to submit your code to one of the TA. The method of submission will be announced later.
This SystemC assignment was obtained from a course UCR CS 122B by Prof. Vahid.