Jump to content

Jeime_Rhee

Members
  • Content Count

    6
  • Joined

  • Last visited

Everything posted by Jeime_Rhee

  1. Jeime_Rhee

    systemC vcd trace file cannot open display

    Hello I see you problem I knew SystemC not allow space character in string so how about change your strings using _ instead of space as your code sc_trace_file *tf = sc_create_vcd_trace_file("VCD test"); // External Signals sc_trace(tf, ensignal, "Enable signal"); sc_trace(tf, outputsignal, "output signal"); change like this sc_trace_file *tf = sc_create_vcd_trace_file("VCD_test"); // External Signals sc_trace(tf, ensignal, "Enable_signal"); sc_trace(tf, outputsignal, "output_signal");
  2. Jeime_Rhee

    SystemC vcd file cannot open GTKwave

    Oh my god... I didn't know about this error Thank you so much Alan I edit that sentence and GTKwave work!! Thank you
  3. Hi I'm learning SystemC language and I made a JK flipflop and 8bit counter using 8-JK flipflop there's no problem building project but if I running GTKwave using vcd trace file it cannot show anything. please help me //test.h #include "systemc.h" SC_MODULE(test) { sc_in<bool> clock; sc_out<bool> go; void do_test(); SC_CTOR(test) { SC_CTHREAD(do_test, clock); go.initialize(0); } }; //test.cpp #include "test.h" void test::do_test() { go.write(1); while(true) { wait(1); } } //JK_FlipFlop.h #include "systemc.h" SC_MODULE(JK_FlipFlop) { sc_in<bool> Input_J; sc_in<bool> Input_K; sc_in<bool> Input_clk; sc_out<bool> Output_q1; sc_out<bool> Output_q2; void do_jk(); SC_CTOR(JK_FlipFlop) { SC_METHOD(do_jk); sensitive<< Input_clk.neg() << Input_J << Input_K; Output_q1.initialize(0); Output_q2.initialize(1); } }; //JK_FlipFlop.cpp #include "JK_FlipFlop.h" void JK_FlipFlop::do_jk() { if(Input_J == true && Input_K == false) { Output_q1.write(1); Output_q2.write(0); } else if(Input_J == false && Input_K == true) { Output_q1.write(0); Output_q2.write(1); } else if(Input_J == true && Input_K == true) { Output_q1.write(!Output_q1); Output_q2.write(!Output_q2); } else { Output_q1.write(Output_q1); Output_q2.write(Output_q2); } } //counter.h #include "JK_FlipFlop.h" SC_MODULE(counter) { sc_in<bool> clk, go; sc_out<unsigned char> value; sc_signal<bool> connect1; sc_signal<bool> connect2; sc_signal<bool> connect3; sc_signal<bool> connect4; sc_signal<bool> connect5; sc_signal<bool> connect6; sc_signal<bool> connect7; sc_signal<bool> connect8; sc_signal<bool> no1, no2, no3, no4, no5, no6, no7, no8; JK_FlipFlop *FF1; JK_FlipFlop *FF2; JK_FlipFlop *FF3; JK_FlipFlop *FF4; JK_FlipFlop *FF5; JK_FlipFlop *FF6; JK_FlipFlop *FF7; JK_FlipFlop *FF8; void do_count(); SC_CTOR(counter) { FF1 = new JK_FlipFlop("jk1"); FF2 = new JK_FlipFlop("jk2"); FF3 = new JK_FlipFlop("jk3"); FF4 = new JK_FlipFlop("jk4"); FF5 = new JK_FlipFlop("jk5"); FF6 = new JK_FlipFlop("jk6"); FF7 = new JK_FlipFlop("jk7"); FF8 = new JK_FlipFlop("jk8"); FF1->Input_clk(clk); FF1->Input_J(go); FF1->Input_K(go); FF1->Output_q1(connect1); FF1->Output_q2(no1); FF2->Input_clk(connect1); FF2->Input_J(go); FF2->Input_K(go); FF2->Output_q1(connect2); FF2->Output_q2(no2); FF3->Input_clk(connect2); FF3->Input_J(go); FF3->Input_K(go); FF3->Output_q1(connect3); FF3->Output_q2(no3); FF4->Input_clk(connect3); FF4->Input_J(go); FF4->Input_K(go); FF4->Output_q1(connect4); FF4->Output_q2(no4); FF5->Input_clk(connect4); FF5->Input_J(go); FF5->Input_K(go); FF5->Output_q1(connect5); FF5->Output_q2(no5); FF6->Input_clk(connect5); FF6->Input_J(go); FF6->Input_K(go); FF6->Output_q1(connect6); FF6->Output_q2(no6); FF7->Input_clk(connect6); FF7->Input_J(go); FF7->Input_K(go); FF7->Output_q1(connect7); FF7->Output_q2(no7); FF8->Input_clk(connect7); FF8->Input_J(go); FF8->Input_K(go); FF8->Output_q1(connect8); FF8->Output_q2(no8); SC_METHOD(do_count); sensitive << clk; sensitive << go; } }; //counter.cpp #include "counter.h" void counter::do_count() { unsigned char local_value = 0; local_value |= (FF1->Output_q1)<<0; local_value |= (FF2->Output_q1)<<1; local_value |= (FF3->Output_q1)<<2; local_value |= (FF4->Output_q1)<<3; local_value |= (FF5->Output_q1)<<4; local_value |= (FF6->Output_q1)<<5; local_value |= (FF7->Output_q1)<<6; local_value |= (FF8->Output_q1)<<7; value.write(local_value); } //main.cpp #include "counter.h" #include "test.h" int sc_main(int argc, char* argv[]) { sc_signal<unsigned char> Value; sc_signal<bool> Go; sc_clock CLK("clock", 50, SC_NS); counter COUNTER("ccc"); COUNTER.clk(CLK); COUNTER.go(Go); COUNTER.value(Value); test TST("TST"); TST.clock(CLK); TST.go(Go); sc_trace_file *tf = sc_create_vcd_trace_file("wave"); sc_trace(tf, COUNTER.connect1, "jk1"); sc_trace(tf, COUNTER.connect2, "jk2"); sc_trace(tf, COUNTER.connect3, "jk3"); sc_trace(tf, COUNTER.connect4, "jk4"); sc_trace(tf, COUNTER.connect5, "jk5"); sc_trace(tf, COUNTER.connect6, "jk6"); sc_trace(tf, COUNTER.connect7, "jk7"); sc_trace(tf, COUNTER.connect8, "jk8"); sc_trace(tf, CLK, "clock"); sc_trace(tf, Value, "SystemC value"); sc_start(20000, SC_NS); sc_close_vcd_trace_file(tf); return(0); } test is making signal always true jk flip-flop working only falling edge so I'm using clk.neg() counter have 8 flip-flop. first flip-flop clock accept main clock and second flip flop accept first flip-flop's q1 value the other flip-flop connected same way to second flip-flop is there any problem?? I can't find any problem but I can't see anything in GTKwave please tell me why. I need your help (P.S : Actually I can't speaking English very well. so please understand I'm using wrong grammar or vocabulary. Thanks)
  4. Jeime_Rhee

    SystemC vcd file cannot open GTKwave

    Thank you for your reply Dev, dakupoto That code correctly work that I expected. I check counter's value and that code can export vcd file but if I try to open in GTKwave using vcd file it does not work. even GTKwave doesn't running. I changed the code dakupoto's way but it still doesn't work. I have the other code that mostly same this code also don't using 'delete' operator but the other code is working. so I post this question.
  5. Hi I'm learning SystemC language and I made a JK flipflop and 8bit counter using 8-JK flipflop there's no problem building project but if I running GTKwave using vcd trace file it cannot show anything. please help me //test.h #include "systemc.h" SC_MODULE(test) { sc_in<bool> clock; sc_out<bool> go; void do_test(); SC_CTOR(test) { SC_CTHREAD(do_test, clock); go.initialize(0); } }; //test.cpp #include "test.h" void test::do_test() { go.write(1); while(true) { wait(1); } } //JK_FlipFlop.h #include "systemc.h" SC_MODULE(JK_FlipFlop) { sc_in<bool> Input_J; sc_in<bool> Input_K; sc_in<bool> Input_clk; sc_out<bool> Output_q1; sc_out<bool> Output_q2; void do_jk(); SC_CTOR(JK_FlipFlop) { SC_METHOD(do_jk); sensitive<< Input_clk.neg() << Input_J << Input_K; Output_q1.initialize(0); Output_q2.initialize(1); } }; //JK_FlipFlop.cpp #include "JK_FlipFlop.h" void JK_FlipFlop::do_jk() { if(Input_J == true && Input_K == false) { Output_q1.write(1); Output_q2.write(0); } else if(Input_J == false && Input_K == true) { Output_q1.write(0); Output_q2.write(1); } else if(Input_J == true && Input_K == true) { Output_q1.write(!Output_q1); Output_q2.write(!Output_q2); } else { Output_q1.write(Output_q1); Output_q2.write(Output_q2); } } //counter.h #include "JK_FlipFlop.h" SC_MODULE(counter) { sc_in<bool> clk, go; sc_out<unsigned char> value; sc_signal<bool> connect1; sc_signal<bool> connect2; sc_signal<bool> connect3; sc_signal<bool> connect4; sc_signal<bool> connect5; sc_signal<bool> connect6; sc_signal<bool> connect7; sc_signal<bool> connect8; sc_signal<bool> no1, no2, no3, no4, no5, no6, no7, no8; JK_FlipFlop *FF1; JK_FlipFlop *FF2; JK_FlipFlop *FF3; JK_FlipFlop *FF4; JK_FlipFlop *FF5; JK_FlipFlop *FF6; JK_FlipFlop *FF7; JK_FlipFlop *FF8; void do_count(); SC_CTOR(counter) { FF1 = new JK_FlipFlop("jk1"); FF2 = new JK_FlipFlop("jk2"); FF3 = new JK_FlipFlop("jk3"); FF4 = new JK_FlipFlop("jk4"); FF5 = new JK_FlipFlop("jk5"); FF6 = new JK_FlipFlop("jk6"); FF7 = new JK_FlipFlop("jk7"); FF8 = new JK_FlipFlop("jk8"); FF1->Input_clk(clk); FF1->Input_J(go); FF1->Input_K(go); FF1->Output_q1(connect1); FF1->Output_q2(no1); FF2->Input_clk(connect1); FF2->Input_J(go); FF2->Input_K(go); FF2->Output_q1(connect2); FF2->Output_q2(no2); FF3->Input_clk(connect2); FF3->Input_J(go); FF3->Input_K(go); FF3->Output_q1(connect3); FF3->Output_q2(no3); FF4->Input_clk(connect3); FF4->Input_J(go); FF4->Input_K(go); FF4->Output_q1(connect4); FF4->Output_q2(no4); FF5->Input_clk(connect4); FF5->Input_J(go); FF5->Input_K(go); FF5->Output_q1(connect5); FF5->Output_q2(no5); FF6->Input_clk(connect5); FF6->Input_J(go); FF6->Input_K(go); FF6->Output_q1(connect6); FF6->Output_q2(no6); FF7->Input_clk(connect6); FF7->Input_J(go); FF7->Input_K(go); FF7->Output_q1(connect7); FF7->Output_q2(no7); FF8->Input_clk(connect7); FF8->Input_J(go); FF8->Input_K(go); FF8->Output_q1(connect8); FF8->Output_q2(no8); SC_METHOD(do_count); sensitive << clk; sensitive << go; } }; //counter.cpp #include "counter.h" void counter::do_count() { unsigned char local_value = 0; local_value |= (FF1->Output_q1)<<0; local_value |= (FF2->Output_q1)<<1; local_value |= (FF3->Output_q1)<<2; local_value |= (FF4->Output_q1)<<3; local_value |= (FF5->Output_q1)<<4; local_value |= (FF6->Output_q1)<<5; local_value |= (FF7->Output_q1)<<6; local_value |= (FF8->Output_q1)<<7; value.write(local_value); } //main.cpp #include "counter.h" #include "test.h" int sc_main(int argc, char* argv[]) { sc_signal<unsigned char> Value; sc_signal<bool> Go; sc_clock CLK("clock", 50, SC_NS); counter COUNTER("ccc"); COUNTER.clk(CLK); COUNTER.go(Go); COUNTER.value(Value); test TST("TST"); TST.clock(CLK); TST.go(Go); sc_trace_file *tf = sc_create_vcd_trace_file("wave"); sc_trace(tf, COUNTER.connect1, "jk1"); sc_trace(tf, COUNTER.connect2, "jk2"); sc_trace(tf, COUNTER.connect3, "jk3"); sc_trace(tf, COUNTER.connect4, "jk4"); sc_trace(tf, COUNTER.connect5, "jk5"); sc_trace(tf, COUNTER.connect6, "jk6"); sc_trace(tf, COUNTER.connect7, "jk7"); sc_trace(tf, COUNTER.connect8, "jk8"); sc_trace(tf, CLK, "clock"); sc_trace(tf, Value, "SystemC value"); sc_start(20000, SC_NS); sc_close_vcd_trace_file(tf); return(0); } test is making signal always true jk flip-flop working only falling edge so I'm using clk.neg() counter have 8 flip-flop. first flip-flop clock accept main clock and second flip flop accept first flip-flop's q1 value the other flip-flop connected same way to second flip-flop is there any problem?? I can't find any problem but I can't see anything in GTKwave please tell me why. I need your help (P.S : Actually I can't speaking English very well. so please understand I'm using wrong grammar or vocabulary. Thanks)
  6. Hi I'm learning SystemC language and I made a JK flipflop and 8bit counter using 8-JK flipflop there's no problem building project but if I running GTKwave using vcd trace file it cannot show anything. please help me //test.h #include "systemc.h" SC_MODULE(test) { sc_in<bool> clock; sc_out<bool> go; void do_test(); SC_CTOR(test) { SC_CTHREAD(do_test, clock); go.initialize(0); } }; //test.cpp #include "test.h" void test::do_test() { go.write(1); while(true) { wait(1); } } //JK_FlipFlop.h #include "systemc.h" SC_MODULE(JK_FlipFlop) { sc_in<bool> Input_J; sc_in<bool> Input_K; sc_in<bool> Input_clk; sc_out<bool> Output_q1; sc_out<bool> Output_q2; void do_jk(); SC_CTOR(JK_FlipFlop) { SC_METHOD(do_jk); sensitive<< Input_clk.neg() << Input_J << Input_K; Output_q1.initialize(0); Output_q2.initialize(1); } }; //JK_FlipFlop.cpp #include "JK_FlipFlop.h" void JK_FlipFlop::do_jk() { if(Input_J == true && Input_K == false) { Output_q1.write(1); Output_q2.write(0); } else if(Input_J == false && Input_K == true) { Output_q1.write(0); Output_q2.write(1); } else if(Input_J == true && Input_K == true) { Output_q1.write(!Output_q1); Output_q2.write(!Output_q2); } else { Output_q1.write(Output_q1); Output_q2.write(Output_q2); } } //counter.h #include "JK_FlipFlop.h" SC_MODULE(counter) { sc_in<bool> clk, go; sc_out<unsigned char> value; sc_signal<bool> connect1; sc_signal<bool> connect2; sc_signal<bool> connect3; sc_signal<bool> connect4; sc_signal<bool> connect5; sc_signal<bool> connect6; sc_signal<bool> connect7; sc_signal<bool> connect8; sc_signal<bool> no1, no2, no3, no4, no5, no6, no7, no8; JK_FlipFlop *FF1; JK_FlipFlop *FF2; JK_FlipFlop *FF3; JK_FlipFlop *FF4; JK_FlipFlop *FF5; JK_FlipFlop *FF6; JK_FlipFlop *FF7; JK_FlipFlop *FF8; void do_count(); SC_CTOR(counter) { FF1 = new JK_FlipFlop("jk1"); FF2 = new JK_FlipFlop("jk2"); FF3 = new JK_FlipFlop("jk3"); FF4 = new JK_FlipFlop("jk4"); FF5 = new JK_FlipFlop("jk5"); FF6 = new JK_FlipFlop("jk6"); FF7 = new JK_FlipFlop("jk7"); FF8 = new JK_FlipFlop("jk8"); FF1->Input_clk(clk); FF1->Input_J(go); FF1->Input_K(go); FF1->Output_q1(connect1); FF1->Output_q2(no1); FF2->Input_clk(connect1); FF2->Input_J(go); FF2->Input_K(go); FF2->Output_q1(connect2); FF2->Output_q2(no2); FF3->Input_clk(connect2); FF3->Input_J(go); FF3->Input_K(go); FF3->Output_q1(connect3); FF3->Output_q2(no3); FF4->Input_clk(connect3); FF4->Input_J(go); FF4->Input_K(go); FF4->Output_q1(connect4); FF4->Output_q2(no4); FF5->Input_clk(connect4); FF5->Input_J(go); FF5->Input_K(go); FF5->Output_q1(connect5); FF5->Output_q2(no5); FF6->Input_clk(connect5); FF6->Input_J(go); FF6->Input_K(go); FF6->Output_q1(connect6); FF6->Output_q2(no6); FF7->Input_clk(connect6); FF7->Input_J(go); FF7->Input_K(go); FF7->Output_q1(connect7); FF7->Output_q2(no7); FF8->Input_clk(connect7); FF8->Input_J(go); FF8->Input_K(go); FF8->Output_q1(connect8); FF8->Output_q2(no8); SC_METHOD(do_count); sensitive << clk; sensitive << go; } }; //counter.cpp #include "counter.h" void counter::do_count() { unsigned char local_value = 0; local_value |= (FF1->Output_q1)<<0; local_value |= (FF2->Output_q1)<<1; local_value |= (FF3->Output_q1)<<2; local_value |= (FF4->Output_q1)<<3; local_value |= (FF5->Output_q1)<<4; local_value |= (FF6->Output_q1)<<5; local_value |= (FF7->Output_q1)<<6; local_value |= (FF8->Output_q1)<<7; value.write(local_value); } //main.cpp #include "counter.h" #include "test.h" int sc_main(int argc, char* argv[]) { sc_signal<unsigned char> Value; sc_signal<bool> Go; sc_clock CLK("clock", 50, SC_NS); counter COUNTER("ccc"); COUNTER.clk(CLK); COUNTER.go(Go); COUNTER.value(Value); test TST("TST"); TST.clock(CLK); TST.go(Go); sc_trace_file *tf = sc_create_vcd_trace_file("wave"); sc_trace(tf, COUNTER.connect1, "jk1"); sc_trace(tf, COUNTER.connect2, "jk2"); sc_trace(tf, COUNTER.connect3, "jk3"); sc_trace(tf, COUNTER.connect4, "jk4"); sc_trace(tf, COUNTER.connect5, "jk5"); sc_trace(tf, COUNTER.connect6, "jk6"); sc_trace(tf, COUNTER.connect7, "jk7"); sc_trace(tf, COUNTER.connect8, "jk8"); sc_trace(tf, CLK, "clock"); sc_trace(tf, Value, "SystemC value"); sc_start(20000, SC_NS); sc_close_vcd_trace_file(tf); return(0); } test is making signal always true jk flip-flop working only falling edge so I'm using clk.neg() counter have 8 flip-flop. first flip-flop clock accept main clock and second flip flop accept first flip-flop's q1 value the other flip-flop connected same way to second flip-flop is there any problem?? I can't find any problem but I can't see anything in GTKwave please tell me why. I need your help (P.S : Actually I can't speaking English very well. so please understand I'm using wrong grammar or vocabulary. Thanks)
×