Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 04/26/2020 in Posts

  1. 1 point
    You dot need a reference to the covergroup class. You can omit this line of code: cg_fsm_state cg_fsm_state_inst; In the constructor you are calling new directly on the coverage class name: cg_fsm_state = new();
  2. 1 point
    Hello @mo_ayman, Well you could get it early for review comments from the people in SystemC LWG. Plus people with similar setup to yours can also take a jab at it in getting it fixed. Regards, Ameya Vikram Singh
  3. 1 point
    Eyck

    no match for ‘operator|’

    Just as explanation: pos() returns an event_finder (a proxy object which allows to use an event which is not yet available) while posedge_event() returns the event itself. And the operator|() is ony defined for sc_event.
  4. 1 point
    You are writing to ports in the constructor of server. At this point they are not bound. Since you initialize them in the beginning of your thread this is not needed anyways. Aside of that you also do not need the sensitivity list for the monitor thread as you never use the default sensitivity (by using wait() ). And if you use C++11 or newer you should use In-class member initializers which eases the naming of signals (and you should name them to make debugging easier): sc_in<bool> begin1{"begin1"}, begin2{"begin2"}, begin3{"begin3"}; sc_in<bool> end1{"end1"}, end2{"end2"}, end3{"end3"}; sc_in<bool> incoming1{"incoming1"}, incoming2{"incoming2"}, incoming3{"incoming3"}; sc_out<bool> free{"free"}, outgoing1{"outgoing1"}, outgoing2{"outgoing2"}, outgoing3{"outgoing3"};
  5. 1 point
    This is easy. First, sc_int<N> and sc_uint<N> are limited to 64 bits. So you cannot use 256 there; however, you can use sc_bigint<N> and sc_biguint<N> for any value of N>64. Second, you will need to specify constants as strings since C++ itself does not support >64 native numbers; although, you can use C++ user-defined literals to get around this limitation if using C++ 2011 or better.
  6. 1 point
    Eyck

    Queue fifo

    Actually you created an array of inputs of type int, not a pipe. Without more code it is hard to give any advise
  7. 1 point
    hbhbts

    Fsm

    SC_MODULE(Fsm) { sc_in<bool> clk; sc_in<bool> reset; sc_in<bool> is_valid; sc_in<bool> is_half_dollar; sc_out<bool> is_dispensed; SC_CTOR(Fsm) { SC_THREAD(fsm_thread); sensitive << clk.pos(); }; void fsm_thread() { typedef enum {S0=0, S1=1, S2=2, S3=3} state_e; state_e state = S0; while(true) { is_dispensed.write(false); if(reset.read() == false) { switch(state) { case S0: if(is_valid.read() == true && is_half_dollar.read() == true) state = S1; else state = S2; break; case S1: if(is_valid.read() == true && is_half_dollar.read() == true) state = S2; else state = S3; break; case S2: if(is_valid.read() == true) state = S3; break; case S3: is_dispensed.write(true); state = S0; break; default: state = S0; } } else state = S0; wait(); } }//fsm_thread };
  8. 1 point
    David Black

    async_request_update example

    usleep() does not interact with the systemc kernel at all. SystemC time is different from real time.
×
×
  • Create New...