Jump to content
NickIlieskou

Problem with sc_create_vcd_trace_file

Recommended Posts

Hi to everybody,

 

I am new to the SystemC world and I have some difficulties. I am trying to create a vcd file where I can see all my signals. The program compiles without any errors however the vcd file is not created in the project folder or anywhere else. Any ideas? Thank you in advance. 

Share this post


Link to post
Share on other sites

First of all thank you for the quick response. 

  1. Yes I had added signals
  2. I am not sure what you mean but I have no errors during compilation and when I run the program everything works fine\
  3. Yes

I also run various examples from the internet using trace files but none of the worked. For example : 

 

#define _CRT_SECURE_NO_WARNINGS
#include <systemc.h>
#include "ror.h"
 
int sc_main(int argc, char* argv[])
{
   //   sc_signal<sc_lv<8> > din, dout1, dout2;
    sc_signal<sc_uint<8> > din, dout1, dout2;
 
    sc_clock clk("clk",10,SC_NS,0.5,10,SC_NS,false);    // Create a clock signal
    
    ror DUT("ror");                     // Instantiate Device Under Test
 
    DUT.din(din);
    DUT.dout1(dout1);
    DUT.dout2(dout2);
    DUT.clk(clk);
 
    sc_trace_file *fp;                  // Create VCD file
    fp=sc_create_vcd_trace_file("wave");// open(fp), create wave.vcd file
    fp->set_time_unit(100, SC_PS);      // set tracing resolution to ns
 
    sc_trace(fp,clk,"clk");             // Add signals to trace file
    sc_trace(fp,din,"din");             
    sc_trace(fp,dout1,"dout1");
    sc_trace(fp,dout2,"dout2");
 
    din=0;
    sc_start(20, SC_NS);                // Run simulation
    din=0x01;                           
    sc_start(20, SC_NS);                // Run simulation
    din=0xC3;                           
    sc_start(20, SC_NS);                // Run simulation
    din=0x0F;                           
    sc_start(20, SC_NS);                // Run simulation
 
    sc_close_vcd_trace_file(fp);        // close(fp)
 
    return 0;
}

Share this post


Link to post
Share on other sites

You code looks ok on the first glance.

 

The trace file should appear in the directory from where you start the executable (which is not necessarily the directory of the "project").

 

Which compiler do you use?  Which operating system?

 

You can try to open a command prompt in the folder of the generated executable and start the simulation from there.

 

/Philipp

Share this post


Link to post
Share on other sites

Ok i found the problem. 

1) First mistake i made was that I was only building the program and not executing it. 

2) If you execute the program from the .exe file the vcd file will apear in a different folder than the one that will apear if you run the program from the Visual studio. 

Thank you again Philipp!!! I know that my mistake was a little bit dummy but I am trying to learn.  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×