Jump to content

zareie.ehsan

Members
  • Content Count

    11
  • Joined

  • Last visited

Everything posted by zareie.ehsan

  1. zareie.ehsan

    synthesizeable systemc code

    Hi is object oriented systemc code synthesizable? for example I defined a new data type (a class) and used it in my code. I don't know I can synthesize it or no. is there any free synthesis tool for systemc? or should I translate my code to Verilog and then synthesize it by existing synthesis tools?
  2. zareie.ehsan

    synthesizeable systemc code

    yes I got it! thank you very much for your helpful reply
  3. zareie.ehsan

    synthesizeable systemc code

    thank you Mathieu... my class is : class digit { public: sc_int<4> dt; digit (sc_uint<4> d=0) { dt=d; } digit& operator =(const digit& d) { dt=d.dt; return(*this); } bool operator==(const digit& d) { return(dt==d.dt); } bool isvalid() { return(((dt[3]==1)&& (dt[2]==1)) | ((dt[3]==1)&& (dt[1]==1))); } inline friend ostream& operator<< (ostream& os,const digit& arg) { os<<arg.dt.to_string(SC_DEC)<<endl; return os; } inline friend void sc_trace(sc_trace_file* tf, const digit& arg , const sc_string& NAME) { sc_trace (tf,arg.dt,NAME +".dt"); } }; you mean that I have to use my class as a vector and the concept of my class will change or it have just a simple seeming change?
  4. zareie.ehsan

    user defined data type signal assignment

    thank you guys for your guide, it works
  5. I'm new to SystemC and I have problem with signal assignment. I defined a new data type "digit" : class digit { public: sc_uint<4> dt; ///////constructor///////// digit (sc_uint<4> d=0) { dt=d; } digit& operator =(const digit& d) { dt=d.dt; return(*this); } } here is the code I tried to assign a signal which is in digit type digit t1(3); sc_signal <digit> d1; d1.write(t1); I also tried d1=t1 (operator= is overloaded in class digit) but signal d1 does not take the value of t1 would you pleas help me?
  6. zareie.ehsan

    user defined data type signal assignment

    yes it has operator<<
  7. zareie.ehsan

    user defined data type signal assignment

    when I debug the program using F10 line by line and check the value of the signals I found the value does not change after d1. write. also with this below main() value is 0; int sc_main(int argc,char* argv[]) { digit t1(8); sc_signal <digit> d1; d1.write(t1); cout<<"value:"<<d1<<endl; }
  8. zareie.ehsan

    problem with constructor

    I wanna take a 4 digit integer value as an input an make an BCD equivalent, I tried this code but it has \error at red line error: 'decimal' : no appropriate default constructor available it mean the class constructor? is the constructor of class decimal wrong? plz help me class decimal { public: sc_int<4> dec0; sc_int<4> dec1; sc_int<4> dec2; sc_int<4> dec3; ///constructor decimal(sc_int<4> d0,sc_int<4> d1,sc_int<4> d2,sc_int<4> d3) { dec3=d3; dec2=d2; dec1=d1; dec0=d0; } } SC_MODULE (seprate_digit) { sc_in <sc_int<16>> in; sc_in <bool> clk; sc_out <decimal> d; decimal dtmp; SC_CTOR (seprate_digit) { SC_METHOD(process3); sensitive << clk.pos(); } void process3() { ///// } };
  9. zareie.ehsan

    problem with constructor

    thank you very much thank you very much for your help full guide. sorry, I thought my post was not successfully posted, so I posted my question many times :-)
  10. zareie.ehsan

    problem with constructor

    I wanna take an 4digit integer value and make the equivalent BCD value. I try this code but it has an error at red line error: 'decimal' : no appropriate default constructor available it mean the class constructor? is the constructor of class decimal wrong? class decimal { public: sc_int<4> dec0; sc_int<4> dec1; sc_int<4> dec2; sc_int<4> dec3; decimal(sc_int<4> d0,sc_int<4> d1,sc_int<4> d2,sc_int<4> d3) { dec3=d3; dec2=d2; dec1=d1; dec0=d0; } SC_MODULE (seprate_digit) { sc_in <sc_int<16>> in; sc_in <bool> clk; sc_out <decimal> d; decimal dtmp; SC_CTOR (seprate_digit) { SC_METHOD(process3); sensitive << in; } void process3() { /// } };
  11. zareie.ehsan

    problem with constructor

    I wanna take a 4 digit integer value as an input an make an BCD equivalent, I tried this code but it has error: error at red line error: 'decimal' : no appropriate default constructor available it mean the class constructor? is the constructor of class decimal wrong? plz help me class decimal { public: sc_int<4> dec0; sc_int<4> dec1; sc_int<4> dec2; sc_int<4> dec3; decimal(sc_int<4> d0,sc_int<4> d1,sc_int<4> d2,sc_int<4> d3) { dec3=d3; dec2=d2; dec1=d1; dec0=d0; } } SC_MODULE (seprate_digit) { sc_in <sc_int<16>> in; sc_in <bool> clk; sc_out <decimal> d; decimal dtmp; SC_CTOR (seprate_digit) { SC_METHOD(process3); sensitive << clk.pos(); } void process3() { ///// } };
×