Changes between Version 71 and Version 72 of Writing Rules/Tlmt


Ignore:
Timestamp:
Nov 15, 2008, 6:39:02 PM (15 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing Rules/Tlmt

    v71 v72  
    9090Experiments are currently in progress to evaluate the performance degradation incurred by this byte formatting.
    9191It is therefore  possible that the types of the '''m_data''' and '''m_byte_enable''' of the '''tlmt_vci_transaction'''
    92 will be changed to '''uint32*''' in a near future.
     92will be changed to '''uint32*''' .
    9393
    9494= D) VCI initiator Modeling =
    9595
    96 == D.1) Member variables ==
     96== D.1) Member variables & methods ==
    9797
    9898In the proposed example, the initiator module is modeled by the '''my_initiator''' class.
     
    122122The '''execLoop()''' method, describing the initiator behaviour must be declared as a member function.
    123123
    124 Finally, the class '''my_initiator''' must contain a member variable '''p_vci_init''', of type '''tlmt_simple_initiator_socket'''.
     124The '''my_initiator''' class must define a call-back function to handle the VCI response packets.
     125
     126Finally, the it must contain a member variable '''p_vci_init''', of type '''tlmt_simple_initiator_socket'''.
    125127This member variable represents the VCI initiator port.
    126128
    127129== D.2) Sending a VCI command packet ==
    128130
    129 To send a VCI command packet, the '''execLoop()''' method must use the '''nb_transport_fw()''' method, that is a member
    130 function of the '''p_vci_init''' port. The prototype of this method is the following:
     131To send a VCI command packet, the '''execLoop()''' method must use the '''nb_transport_fw()''' method, defined by TLM2.0,
     132that is a member function of the '''p_vci_init''' port. The prototype of this method is the following:
    131133{{{
    132134
    133135  tlm::tlm_sync_enum nb_transport_fw           
    134136  ( soclib_vci_types::tlm_payload_type &payload,      // VCI payload pointer
    135     soclib_vci_types::tlm_phase_type   &phase,       // transaction phase (TLMT_CMD)
     137    soclib_vci_types::tlm_phase_type   &phase,        // transaction phase (TLMT_CMD)
    136138    sc_core::sc_time                   &time);        // local time
    137139}}}
    138140
    139 The first argument is a pointer to the payload, the second represents the phase (TLMT_CMD in this case), and the third
     141The first argument is a pointer to the payload, the second represents the phase, and the third
    140142argument contains the initiator local time.
    141143
     
    148150
    149151To receive a VCI response packet, a call-back function must be defined as a member function of the
    150 class '''my_initiator'''. This call-back function (named '''vci_rsp_received()''' in the example),
    151 is executed each time a VCI response packet is received on the '''p_vci_init''' port. The function name is not
    152 constrained, but the arguments must respect the following prototype:
     152class '''my_initiator'''. This call-back function (named '''vci_rsp_received()''' in the example), must be linked to
     153the '''p_vci_init''' port, and is executed each time a VCI response packet is received on the '''p_vci_init''' port.
     154The function name is not constrained, but the arguments must respect the following prototype:
    153155{{{
    154156  tlm::tlm_sync_enum vci_rsp_received             
     
    159161The return value (type tlm::tlm_sync_enum)  is not used in this tlmt implementation, and must be sytematically set to tlm::TLM_COMPLETED.
    160162
    161 In the general case, the actions executed by the call-back function depend on the response transaction type ('''m_command''' field), as well as
    162 the '''pktid''' and '''trdid''' fields.
     163In the general case, the actions executed by the call-back function depend on the transaction type defined in the payload
     164('''m_command''', '''m_pktid''' and '''m_trdid''' fields).
    163165For sake of simplicity, the call-back function proposed in the example below does not make any distinction between transaction types.
    164166
     
    169171the response packet, a link between the '''p_vci_init''' port and this call-back function must be established.
    170172
    171 The '''my_initiator''' constructor for the '''p_vci_init''' object must be called with the following arguments:
     173The constructor for the '''p_vci_init''' port must be called with the following arguments:
    172174{{{
    173175  p_vci_init.register_nb_transport_bw(this, &my_initiator::vci_rsp_received);
     
    181183
    182184To solve this issue, it is necessary to define -for each initiator module- a '''lookahead''' parameter. This parameter defines the maximum
    183 number of cycles that can be executed by the thread before it is automatically stopped. The '''lookahead''' parameter allows the system designer
     185number of cycles that can be executed by the thread before it is descheduled. The '''lookahead''' parameter allows the system designer
    184186to bound the de-synchronization time interval between threads.
    185187