Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Thanks Alan. Changing to SC_METHOD() solved the issue. The output seems to be: At time 0s: i/p:0000 o/p :0000 At time 5ns: i/p: 0001 o/p: 0000 At time 5ns: i/p: 0001 o/p:0001 At time 110ns: i/p: 0000 o/p:0001 At time 110ns: i/p: 0000 o/p:0000 At time 115ns: i/p: 0001 o/p:0000 At time 115ns: i/p: 0001 o/p:0001 1.At time 5ns, the first output is 0 , and the next displayed output is 1. Is this what they call the delta delay which occurs when writing to a port? 2.Also, after 5ns, why does it jump to 110ns instead of 105ns? Please help me in finding answers for these . Thanks
  2. Hello all , This is my complete code: #include"systemc.h" SC_MODULE(gtb) { sc_in<sc_uint<3> > bin; sc_out<sc_uint<3> > grayout; void proc_graytobinary(); SC_CTOR(gtb) { SC_THREAD(proc_graytobinary); sensitive<<bin; } }; Gtb.cpp include"gtb.h" void gtb::proc_graytobinary() { switch(bin.read()) { case 0: grayout = 0; break; case 1: grayout = 1; break; default: grayout = 3; break; } Driver.cpp #include "driver.h" void driver::proc_driver() { while(1) { d_bin = 0; wait(5, SC_NS); d_bin = 1; wait(5, SC_NS);
  3. Hey Roman, I tried assigning "1" to bin, as well some other value which is not listed in the case statement. I did this to check whether "default" as well as the other case statements are executed. But, all it does is just prints "0" for any input value, i.e only the first case statement is executed. I tried changing the value in the first case statement, but still only that value is printed and rest all case statements are ignored. Please help me solve this issue
  4. Hello there, Am trying to implement binary to gray converter using simple case statements. When I try to execute, only the first statement of the switch case is being executed. Here's my gtb.cpp and driver module // driver.cpp #include "driver.h" void driver::proc_driver() { while(1) { d_bin = 0; wait(5, SC_NS); d_bin = 4; wait(5, SC_NS); } } #include"gtb.h" void gtb::proc_graytobinary() { switch(bin.read()) { case 0 : grayout = 0; break; case 1 : grayout = 1; break; default: grayout = 2; break; } } Please help me solve this
  5. Hello Roman, sc_start command has been passed in my main module. But, still the simulation stops at exactly 55 ns, where all my inputs are finished driven. I would love to know , how to extend the simulation time even after all my inputs are driven.
  6. Hello there, The simulation for my module stops at 55 ns. This might probably happen because of my driver. In GTKwave , am not able to view what is the input and output at 55(th) ns, since the simulation stops exactly stops at 55. How to keep the simulation time to be infinite or extend more so that I can also view the last set of inputs? I also tried deactivating the "sc_stop()" command, but no change was found. If so, what's the need of sc_stop() ? Any help would be appreciated. Thanks in advance.
  7. Hello Gerth. Since am a beginner to SystemC, am facing some difficulty in understanding what really the issue is. Can you please explain in detail? //File: decoder_top.cpp #include "driver.h" #include "monitor.h" #include "2_by_4_decoder.h" int sc_main(int argc, char* argv[]) { sc_signal<bool> t_enable; sc_signal<sc_uint<2> > t_select; sc_signal<sc_uint<4> > t_z; sc_trace_file *wf = sc_create_vcd_trace_file("decoder"); wf->set_time_unit(1, SC_NS); decoder2by4 dcdr("2by4decodr"); dcdr.enable(t_enable); dcdr.select(t_select);
  8. Hello there, While trying to run the executable, I get the following message: Info: (I703) tracing timescale unit set: 1 ns (decoder.vcd) At time0 s:: (select, enable) 00output is 0 Info: /OSCI/SystemC: Simulation stopped by user. Please suggest me on how to solve this issue. Thanks in advance.
  9. Hello Alan, Finally, I got the output! Thanks for the help! Have a question, after "make", a file is created of this type- "driver.h.gch". What type of file is this ?
  10. Hello Alan, As told by Stephen, he could run the code successfully! But, am not able to understand why it doesn't run for me. I even tried deleting all the object files, moved the source codes to a new directory and compiled again. But, still am getting the same error. What possibly would be the issue, can you please help me solve this? Thanks in advance.
  11. Hello Alan, The "driver" module has just two ports. //File:driver.h #include "systemc.h" SC_MODULE (driver) { sc_out<bool> d_enable ; sc_out<sc_uint<2> > d_select; sc_uint<2> pattern; void prc_driver(); SC_CTOR(driver) { SC_THREAD(prc_driver); } }; Still I don't know why the error has popped up this way! Please help me solve this issue. Thanks in advance.
  12. Hello there, Am facing the same issue. Info: (I703) tracing timescale unit set: 1 ns (decoder.vcd) Error: (E109) complete binding failed: port not bound: port 'Waveform.port_2' (sc_out) In file: ../../../../src/sysc/communication/sc_port.cpp:231 What does this mean? I have bounded both ports of the driver(concerned) module to the top module (no port is left unbounded ). Is there something else that I need to change?
  13. Hello Gerth, Am sorry for bugging you a lot! Am still getting the same error, if I just change the type d_select port in the driver module from sc_lv to sc_uint. I've also attached the Makefile. Please help me sort this out. SYSTEMC=/usr/local/systemc231 ARCH=linux64 CPP_FLAGS= -I. -I$(SYSTEMC)/include LDFLAGS=-L$(SYSTEMC)/lib-linux64 -lsystemc SRC= decoder2by4.cpp decoder_top.cpp monitor.cpp driver.cpp OBJS= decoder2by4.o decoder_top.o driver.o monitor.o all: 2by4decoder decoder_top.o: decoder_top.cpp g++ $(CPP_FLAGS) -c decoder_top.cpp decoder2by4.o: decoder2
  14. Hello Gerth, I get the idea behind defining the argument for instances. Thanks! Let me post the complete code of mine: //File : 2-by-4 decoder.h #include "systemc.h" SC_MODULE(decoder2by4) { sc_in<bool>enable; sc_in<sc_uint<2> > select; sc_out<sc_lv<4> > z; void prc_decoder2by4(); SC_CTOR(decoder2by4) { SC_METHOD(prc_decoder2by4); sensitive<<enable<<select; } }; //File: decoder2by4.cpp #include"2_by_4_decoder.h" void decoder2by4::prc_decoder2by4() { if(enable) { switch(select.read()) { case 0: z = 0001; break;
  • Create New...