How to use SoCView

To use the debugger simulator, you have to make a few small changes in your SystemC platform :

1. The simulation loop

Just replace the simulation loop at the end of your top cell by calling the function debug()

before :

for (int i = 0; i < ncycles ; i++) 
    /* ... */
  /* ... */
  return EXIT_SUCCESS;

after :



2. Naming the signals

You'll have to name all the signals inside your design to be able to recognize them when debugging. Otherwise the simulator will rename them with generic names (signal_0, signal_1 ...)

You have two methods to do it :

  • name them in the constructor, as you would naturally do in SystemC
  • use the function rename()

The function rename() is used especially for renaming signals declared as n-dimensional array of signals, which you can't do in standard SystemC.

Here's an example of haw to do both methods

/* The Constructor */


MY_COMPONENT (sc_module_name insname):
  clk("Clock"),            // the standard way of naming signals

//  clk.rename("Clock");   // you can use function rename to name simple signals instead of doing it the standard way
//  reset.rename("Reset");
  char newname[100];
  for (int i=0; i<tab_size; i++ ) 
    sprintf(newname, "Tab_Signal_%2.2d", i);

  SC_METHOD (my_method);
  sensitive << clk.pos();

  /* ... */


Note the use of #ifdef NONAME_RENAME to keep the compatibility of your code with SystemC/OSCI

3. The Makefile

Some flags need to be added to compile the simulator

  • for Compilation Flags, add -I${SOCVIEW}/include
  • for Linker Flags, add -lreadline -lhistory

Now to compile your design, replace the ${SYSTEMC} by the path to the SOCVIEW simulator.

Last modified 12 years ago Last modified on Jun 28, 2007, 4:45:55 PM