Changes between Version 4 and Version 5 of Writing Rules/Caba


Ignore:
Timestamp:
Mar 27, 2007, 7:30:02 PM (17 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing Rules/Caba

    v4 v5  
    255255    sc_signal<int> r_vci_fsm;
    256256
    257     // While we are handling a command, we save the VCI out-of-order markers in order to
    258     // send them back in response
     257    // Some registers used to save useful data between command & response
    259258    sc_signal<typename vci_param::srcid_t> r_buf_srcid;
    260259    sc_signal<typename vci_param::trdid_t> r_buf_trdid;
    261260    sc_signal<typename vci_param::pktid_t> r_buf_pktid;
    262261    sc_signal<typename vci_param::eop_t>   r_buf_eop;
    263 
    264     // Do we have a command to handle ?
    265     sc_signal<bool>                        r_buf_value;
    266 
    267     // Our assigned segment
     262    sc_signal<bool>                                      r_buf_value;
     263
     264    // Pointer on the table of locks (allocated in the constructor)
     265    sc_signal<bool>             *m_contents;
     266
     267    // The segment assigned to this peripheral
    268268    soclib::common::Segment m_segment;
    269 
    270     // The actual data handled by this component: the locks
    271     bool *m_contents;
    272269
    273270protected:
     
    330327    // allocate an array for the locks, one every 4 addressable
    331328    // byte.
    332     m_contents = new bool[m_segment.size()/4];
     329    m_contents = new sc_signal<bool>[r_segment.size()/4];
    333330
    334331    // Sensitivity list for transition() and genMoore(), no genMealy()
     
    354351    // from FSMs to internal data.
    355352    if (!p_resetn) {
    356         for (size_t i=0; i<m_segment.size()/4; ++i)
    357             m_contents[i] = false;
     353        for (size_t i=0; i<r_segment.size()/4; ++i)
     354            r_contents[i] = false;
    358355        r_vci_fsm = IDLE;
    359356        return;
     
    381378            switch (p_vci.cmd.read()) {
    382379            case VCI_CMD_READ:
    383                 r_buf_value = m_contents[cell];
    384                 m_contents[cell] = true;
     380                r_buf_value = r_contents[cell];
     381                r_contents[cell] = true;
    385382                r_vci_fsm = READ_RSP;
    386383                break;
    387384            case VCI_CMD_WRITE:
    388                 m_contents[cell] = false;
     385                r_contents[cell] = false;
    389386                r_vci_fsm = WRITE_RSP;
    390387                break;