SystemC:
Hardware / Software
Co-Simulation II
Objectives
Design Problems
1. GCD Calculator.
a. SW/SW' implementation: In a
separate project, design two concurrent modules that determines the
greatest common divisor of two numbers. The first module should ask the user for
the two numbers. The
second module
should use a software implementation to interface with the first module using
standard
handshake module. The second module should input the two numbers,
calculate the GCD, and output the
answer of the GCD.
b. HW/SW implementation: In a
separate project, design two concurrent modules that determines the
greatest
common divisor of two numbers. The first module should ask the user for the two
numbers. The
second module should be the controller of your GCD calculator and
it should interface with the first module
using a standard handshake protocol.
Preferably, you should modify your GCD model from the previous
lab to complete
your design.
2. The "Netbench" Benchmark: HW/SW Partitioning C code using SystemC
a.) Download the C-code benchmark files. Add all the files to the project except "extras.cpp" This particular component of the Netbench benchmark helps to generate security keys. Build and Execute the program. Find the function "NN_DigitMult( )" in a file called digit.c. This function performs 64-bit multiplication on two 32-bit NN_DIGITs (Natural Numbers). However, in software, this function is expensive considering the number of clock-cycles needed to complete the operation.
b.) Design a hardware model that has the functionality of the NN_DigitMult( ) function. The model should have the following specifications:
1) The model should take in as external input two 32-bit unsigned integer inputs and enable signal.
2) The model should output two 32-bit unsigned integer outputs ( for the low and high bits of the 64-bit multiplication ) and a done signal.
3) The model should use a simple FSM with 4 states:
a.) WAIT: wait for enable signal to be asserted
b.) EXECUTE: multiply the two inputs
c.) OUTPUT: write to output ports of module, assert done_signal
d.) FINISH: check if the enable signal is de-asserted. if so, de-assert the done signal.
c.) Download the templated benchmark files: Tdigit.c and Tdh_mod.cpp and save them as "digit.c" and "dh_mod.cpp" (Overwrite older version from part (b) of the project). Edit the NN_DigitMult( ) function in the digit.c file so that it calls the "extern 'C'" function at the top of dh_mod.cpp. Modify "dh_mod.cpp" where specified. Build and Execute the program.