Jump to content

meera

Members
  • Content Count

    24
  • Joined

  • Last visited

  1. meera

    thread

    hi, In systemc is in possible to invoke the same function using multiple threads ? like in c++: std::thread th1 (print_block,50,); std::thread th2 (print_block,50,);
  2. hi, Since iam new to systemc and am trying out new things in order to learn , iam getting lot of doubts, hope someone can help me out!! like i verilog where we use case statement for implementing fsm,similarly in systemc to implement some fsm i hope we use switch statement, so is it possible to switch from one case to another? if so how is it done? This is part of the code i wanted to realize: #include "systemc.h" enum htrans_type { IDLE, BUSY,NONSEQ,SEQ}; SC_MODULE(trans){ sc_in<htrans_type> HTRANS; void p1(){ while(true) { wait(); switch(HTRANS){ case IDL
  3. hi, when i use switch statement,is it possible to transfer control from one case to another case? #include "systemc.h" enum htrans_type { IDLE, BUSY,NONSEQ,SEQ}; SC_MODULE(trans){ sc_in<htrans_type> HTRANS; void p1(){ while(true) { wait(); switch(HTRANS){ ///////////////////////////// case IDLE: { ................... ................................. ....................... } case NONSEQ:{....} .... ... now if i want to go in between from one switch case to other( say previous) what should i do?
  4. iam getting error upon using "wait_until" #include "systemc.h" SC_MODULE (counter2) { sc_in_clk clock ; sc_in<bool> reset ; sc_in<bool> enable; sc_out<sc_uint<4> > counter_out; sc_uint<4> count; void incr_count () { while (true) { wait(10); WAIT_UNTIL(reset.delayed() == true || enable.delayed() == true); ERROR!! if (reset.read() == 1) { count = 0; counter_out.write(count); } else if (enable.read() == 1) { count = count + 1;
  5. well , i just wanted to see the values of ff after running the program.
  6. #include "systemc.h" #include "vector" SC_MODULE(w1){ sc_in<bool> on; void work(){ sc_bv<8> ff[10]; int i; if(on){ for (i=0;i<10;++i) { ff=0; cout<<"ff["<<i<<"]"<<ff<<endl; } } } SC_CTOR(w1){ SC_METHOD(work); sensitive<<on; } }; hi could anyone tell me why iam not getting :- ff=00000000 for all i
  7. hi, i was able to overcome the error, since iam new to systemc i didn't know that i had to include: #include "vector" as the header .
  8. hi, when i try to assign a particular bti in a vector by using the statement ff=o..it is showing error. Could any one pls tell what the mistake is. ..... sc_signal<sc_bv<8> > ff; void func(){ sc_int<size> i; if(rst){ for(i=0;i<10;i++) ff=0;//error } ......
  9. hi, when i try to assign a particular bti in a vector by using the statement ff=o..it is showing error. Could any one pls tell what the mistake is. ..... sc_signal<sc_bv<8> > ff; void func(){ sc_int<size> i; if(rst){ for(i=0;i<10;i++) ff=0;//error } ......
  10. Hi Alan, is there any other keyword instead of sensitive? which could be used, to achieve the desired output . thanks
  11. Hi, i was trying to obtain a fulladder through half adder. i was able to build and run the program but i find that outputs are not as expected. i feel it must be something to do with sensitivity. could anyone pls suggest that the mistake is. full_adder.h #include "half_adder.h" SC_MODULE (full_adder) { sc_in<bool>a,b ,cin; sc_out<bool>sum,carry; sc_signal<bool> c1,c2,s1; void disp() { cout<<"a="<<a<<endl; cout<<"b="<<b<<endl; cout<<"cin="<<cin<<endl; cout<<"sum="<<sum<<endl; cout<<"
  12. Hi Alan, Now iam able to see the correct output. Thanks for helping me out with the issues. thank you Meera
  13. sorry yes u r correct. but if you could execute the lines in my recent post probably you might understand what iam trying to say.
  14. hi, if u execute is u will get to know what iam trying to say as .cpp #include "systemc.h" #include "and.h" int sc_main(int argc, char* argv[]) { sc_signal<sc_uint <3> > a ; sc_signal<sc_uint <3> > b ; sc_signal<sc_uint <3> > s ; and d1("And"); d1.a(a); d1.b( ; d1.s(s); a=3; b=4; sc_start(20,SC_NS); a = 1; b = 2; sc_start(20,SC_NS); a = 3; b = 4; sc_start(20, SC_NS); a = 4; b = 2; sc_start(20, SC_NS); a = 1; b = 1; sc_start(20, SC_NS); return 0; }
  15. Hi, i did try doing that , but as i pointed out i feel result of "s" is seen only in the next cycle...what should i do for that?
×
×
  • Create New...