Jump to content

Problem with sc_create_vcd_trace_file


NickIlieskou

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. 

Link to comment
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;
}
Link to comment
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

Link to comment
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.  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...