SystemC Tutorial
- Copy 4-bit counter example into your working directory.
o cnt.h and cnt.cpp: counter header file and c++ source file
o cnt_display.h and cnt_display.cpp: display module header file and c++ source file
o cnt_tb.cpp: counter testbench
- Copy makefiles into your working directory.
o Makefile.defs and Makefile.gcc: makefiles for gcc compilation
o Open Makefile.defs and change the SystemC installation path, which is shown in the second line of Makefile.defs
- Setup Synopsys environment
o
Synopsys
- Compile the source files
o Compile the source files of counter example
o gmake –f Makefile.gcc
- Run the executable file
o Run the counter example
o cnt.x
The counter outputs are printed on the screen, and the waveform file, cnt.vcd, is generated.
- View the waveform
o Open CoCentric System Studio VirSim
o virsim
&
VirSim main window appears.

o Click Waveform button. VirSim – Waveform window appears.

o Click Hierarchy button. VirSim - Hierarchy window appears.

o Select File/open in menu bar. Open File Dialog window appears.

o Change Type to VCD
o Type VCD file name, “cnt.vcd” at the end of Selection line.
o Click OK button
o Info window appears. Click OK button.
o In VirSim Hierarchy window, click SystemC button in Hierarchy section. Signals appear in Signal Select section.
o Select all signals in Signal Select section. Click Add button.
o Waveforms appear in VirSim – Waveform window.



Next Page