Jump to content

kybiss

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. Hi, I am trying to write a simple bus-based architecture. But I cant write the arbiter module. There are two processes M1 and M2. The arbiter allocates a different time slot for M1 or M2, so that they are both granted access to the bus at different times. Here is the m_bus : #define _CRT_SECURE_NO_WARNINGS #include"systemc.h" SC_MODULE(m_bus) { sc_in<char> char_in1; sc_in<char> char_in2; sc_in<bool> selector; sc_out<char> char_out; void prc_m_bus(); SC_CTOR(m_bus) { SC_METHOD (prc_m_bus); sensitive << char_in1 << char_in2 << selector; } void m_bus :: prc_m_bus(){ if (selector == 0) { char_out = char_in1; cout << "change_case" << endl; } else if (selector == 1) { char_out = char_in2; cout << "filter" << endl; } else; } }; Is there anyone who can help me for writing arbiter?
×