NickIlieskou Posted February 20, 2014 Report Share Posted February 20, 2014 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. Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted February 20, 2014 Report Share Posted February 20, 2014 Try to show the relevant parts of your code, e.g. the 'sc_main' function. Have you added any signals? Has the simulation completed successfully? Did you properly close the file again after the simulation? /Philipp Quote Link to comment Share on other sites More sharing options...
NickIlieskou Posted February 20, 2014 Author Report Share Posted February 20, 2014 First of all thank you for the quick response. Yes I had added signals I am not sure what you mean but I have no errors during compilation and when I run the program everything works fine\ 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; } Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted February 20, 2014 Report Share Posted February 20, 2014 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 Quote Link to comment Share on other sites More sharing options...
NickIlieskou Posted February 20, 2014 Author Report Share Posted February 20, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.