How to start  using Systemc

Step 1.
Create all modules in some directory.
For each module you have to write
I   - Interface file (usually with extension  .h)
II -  Implementation file (with extension  .cc)

e.g.  The example (string match counter) we discussed  in class  was having three processes stream generator, string  matcher and  match counter. Interface files written for these  processes are sg.h, fsmr.h and counter.h respectively. The implementation files for these processes are sg.cc, fsmr.cc and counter.cc respectively.

Step 2.
Create main module  named  main.cc in  which the main function will  not be main but will be sc_main. It will include systemc.h and interface files you have written.

Step 3.
Create input files if required. file  testcase in our case.

Step 4.
Write make file named Makefile.linux. Makefile for the example we discussed look as follows
 

TARGET_ARCH = linux

CC = g++
OPT = -O3
DEBUG =
CFLAGS = $(DEBUG) $(OPT) -fexceptions -Wall

MODULE = run
SRCS = counter.cc  fsmr.cc     main.cc  sg.cc
OBJS = $(SRCS:.cc=.o)

include /nfs/megh2/manoj/systemc-1.0.1/examples/Makefile.defs.bak
 

Step 5.
Use the following command on shell prompt.
make -f Makefile.linux

It will compile, link and make an executable code (named run.x in our case, because we defined this name in our Makefile.linux file).

Step 6.
Run the executable code to simulate your design.

NOTE :
All the files for the example we discussed are available for your reading  in directory
~manoj/systemc-1.0.1/examples/strmatchcounter

If you find any problem please email to
manoj@cse.iitd.ernet.in
 
 

site last updated on
Feb. 10,2001 by Manoj Kumar Jain