Changes between Version 42 and Version 43 of Writing Rules/Tlmt
- Timestamp:
- Feb 19, 2008, 9:41:08 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Tlmt
v42 v43 40 40 To send a VCI command packet, the '''execLoop()''' method must use the '''send()''' method, that is a member function of the '''p_vci''' port. The prototype is the following: 41 41 {{{ 42 void send(vci_cmd_ t*cmd, // VCI command packet43 uint32_t time);// initiator local time42 void send(vci_cmd_packet<vci_param> *cmd, // VCI command packet 43 tlmt_core::tlmt_time time); // initiator local time 44 44 }}} 45 45 46 46 The informations transported by a VCI command packet are defined below: 47 47 {{{ 48 class vci_cmd_t { 49 vci_param::vci_command_t cmd; // VCI transaction type 50 vci_param::vci_address_t *address; // pointer to an array of addresses on the target side 51 uint32_t be; // byte_enable value (same value for all packet words) 52 bool contig; // contiguous addresses (when true) 53 vci_param::vci_data_t *buf; // pointer to the local buffer on the initiator 54 uint32_t length; // number of words in the packet 55 uint32_t srcid; // VCI Source ID 56 uint32_t trdid; // VCI Thread ID 57 uint32_t pktid; // VCI Packet ID 58 } 59 }}} 60 61 The possible values for the '''cmd''' fied are `vci_param::CMD_READ`, `vci_param::CMD_WRITE`, `vci_param::CMD_READ_LOCKED`, 48 template<typename vci_param> 49 class vci_cmd_packet 50 { 51 public: 52 typename vci_param::cmd_t cmd; // VCI transaction type 53 typename vci_param::addr_t *address; // pointer to an array of addresses on the target side 54 unsigned int be; // byte_enable value (same value for all packet words) 55 bool contig; // contiguous addresses (when true) 56 typename vci_param::data_t *buf; // pointer to the local buffer on the initiator 57 size_t length; // number of words in the packet 58 uint32_t srcid; // VCI Source ID 59 uint32_t trdid; // VCI Thread ID 60 uint32_t pktid; // VCI Packet ID 61 }; 62 }}} 63 64 The possible values for the '''cmd''' filed are `vci_param::CMD_READ`, `vci_param::CMD_WRITE`, `vci_param::CMD_READ_LOCKED`, 62 65 and `vci_param::CMD_STORE_COND`. 63 66 The '''contig''' field can be used for optimisation. 64 67 65 The '''send()''' function is non-blocking. To implement a blocking transaction (such as a cache line read, where the processor is ''frozen'' during the VCI transaction), the model designer must use the '''wait()''' primitive : the '''execLoop()''' thread is suspended, and will be activated when the response packet isreceived.68 The '''send()''' function is non-blocking. To implement a blocking transaction (such as a cache line read, where the processor is ''frozen'' during the VCI transaction), the model designer must use the SystemC '''sc_core::wait(x)''' primitive ('''x''' being of type '''sc_core::sc_event''') : the '''execLoop()''' thread is then suspended, and will be reactivated when the response packet is actually received. 66 69 67 70 == C.2) Receiving a VCI response packet ==