Changes between Version 4 and Version 5 of Writing Rules/Caba
- Timestamp:
- Mar 27, 2007, 7:30:02 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Caba
v4 v5 255 255 sc_signal<int> r_vci_fsm; 256 256 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 259 258 sc_signal<typename vci_param::srcid_t> r_buf_srcid; 260 259 sc_signal<typename vci_param::trdid_t> r_buf_trdid; 261 260 sc_signal<typename vci_param::pktid_t> r_buf_pktid; 262 261 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 268 268 soclib::common::Segment m_segment; 269 270 // The actual data handled by this component: the locks271 bool *m_contents;272 269 273 270 protected: … … 330 327 // allocate an array for the locks, one every 4 addressable 331 328 // byte. 332 m_contents = new bool[m_segment.size()/4];329 m_contents = new sc_signal<bool>[r_segment.size()/4]; 333 330 334 331 // Sensitivity list for transition() and genMoore(), no genMealy() … … 354 351 // from FSMs to internal data. 355 352 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; 358 355 r_vci_fsm = IDLE; 359 356 return; … … 381 378 switch (p_vci.cmd.read()) { 382 379 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; 385 382 r_vci_fsm = READ_RSP; 386 383 break; 387 384 case VCI_CMD_WRITE: 388 m_contents[cell] = false;385 r_contents[cell] = false; 389 386 r_vci_fsm = WRITE_RSP; 390 387 break;