SystemC Tutorial
  1. 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

 

  1. 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

 

  1. Setup Synopsys environment

o        Synopsys

 

  1. Compile the source files

o        Compile the source files of counter example

o       gmake –f Makefile.gcc

 

  1. 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.

 

  1. 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.