Jump to content

Dev

Members
  • Content Count

    8
  • Joined

  • Last visited


Reputation Activity

  1. Like
    Dev reacted to Philipp A Hartmann in Casting in systemC   
    The implicit conversion between these types is not possible in all cases, mostly due to the danger of ambiguities in the API.
     
    Just add an explicit type conversion instead in terms of a C++ static_cast here:
        void do_cast(){         castout.write( static_cast<sc_uint<8> >(castin.read() ) );     } Greetings from Oldenburg,
      Philipp
  2. Like
    Dev reacted to apfitch in Reset method in SC_FIFO   
    OK, the problem is that you assert the reset for 1 second. At 1400ms (the second RESET), the read_en signal is still true, so the code attempts to read from an empty fifo, and hangs (as you're using a blocking read),
     
    regards
    Alan
     
    P.S. One fix is to change the structure to 
     
    if reset
     
    elsif read
     
    else write
     
    i.e. only go on to attempt a read or write if the reset is not enabled.
  3. Like
    Dev reacted to Philipp A Hartmann in problem with constructor   
    As the error says (emphasis mine)
     
     
    you need a default constructor (a constructor without arguments) in your case.
     
    In the module, you create an instance of 'decimal' without explicitly initializing it in the constructor of 'seprate_digit'.  Theoretically, you could use an initializer list:
    SC_CTOR (seprate_digit) : in("in"), clk("clk"), d("d") // port names -> recommended practice , decimal(0,0,0,0) // <-- explicitly initialize decimal member Since you use 'decimal' as a signal type, you'll definitely need a default constructor.  This could look like the following
    decimal() /* : dec0(), dec1(), dec2(), dec3() */ // optional, as sc_int has an explicit default constructor {} Secondly, you'll need to define more helper functions to use sc_signal with your own data types, see http://www.doulos.com/knowhow/systemc/faq/#q1
     
    Greetings from Oldenburg,
      Philipp

    NB: Why do you post the question three times in 10 minutes? ;-)
×
×
  • Create New...