Tutorial Exercises
Tutorial Exercises
4 2
Figure 1: ModelSim.
a) Synthesize and simulate example mul.cpp as in the previous exercises. Note the simulation execution time.
b) In hdl/mul wrapper.vhd, replace the 4-stage multiplier with an 8-stage multiplier by changing the multiplier
entity from work.mul 4 stage to work.mul 8 stage. In the same file, change the LATENCY constant to
reflect the component latency change. Simulate the design and compare the execution time to the prior one.
c) Integrate the information about the new multiplier into the Dynamatic flow:
– Invoke the Dynamatic shell using the command dynamatic and type manually the commands from
synthesis.tcl to set up the project and synthesize the design (i.e., all commands up to optimize).
– Before invoking the optimize command, in reports/example mul.dot, update the latency field of mul-
tiplier mul 8 to reflect the latency change.
– Run the remaining commands from synthesis.tcl to place buffers and produce the VHDL netlist.
– Repeat the steps from question 4b to replace the multiplier in hdl/mul wrapper.vhd.
Simulate the design, note the total execution time, and compare it from the one from the previous questions.
Using ModelSim
To complete the exercises, use the ModelSim features described in this section and depicted in Figure 1.
– After running the simulation.tcl script, wait for the simulation to complete; a green text line will appear
in the Transcript window (marked with number 1 in the figure), indicating simulation break.
– Extend the waveform across the entire screen by clicking on the undock button (number 2).
– To change the number format of a signal from binary to unsigned, right-click on the signal name (e.g., number
3) and choose Radix > Unsigned.
– Zoom in/out of the waveforms using the zoom in/out buttons (number 4).
– Scroll through simulation time using the horizontal bar (number 5) and through signals using the vertical bar
(number 6).
– Search for a signal by name using the find button (number 7).