5.4.2. Properties for TLM1.0 based protocols

TLM1.0 based protocols are mapped to their SystemC counterparts using three properties in the LISA protocol definition. These properties must be set in the protocol description:

sc_master_port_class_name

The sc_master_port_class_name property is the class name of the SystemC class that is instantiated in the generated SystemC component for master ports on the SystemC side. This class must implement the functions defined in the corresponding protocol such as, for example,:

my_master_port<bool>::set_state(bool state).

sc_slave_base_class_name

The sc_slave_base_class_name property is the class name of the SystemC class that is specialized in the generated SystemC component for slave ports on the SystemC side. This class must declare the functions defined in the corresponding protocol such as, for example:

my_slave_base<bool>::set_state(const bool &state).

It must be derived in the SystemC component to forward the protocol functions from the SystemC component to the Fast Models top level component corresponding port. It must also provide a constructor taking the argument:

const std::string &

sc_slave_export_class_name

The sc_slave_export_class_name property is the class name of the SystemC class that is instantiated in the generated SystemC component for slave ports (exports) on the SystemC side. It is bound to the derived sc_slave_base_class_name SystemC class and forwards calls from the SystemC side to the bound class.

In Example 5.3:

Example 5.3. AMBAPV Signal protocol in Fast Models

protocol AMBAPVSignal {

  includes {
    #include <amba_pv.h>
  }
    
  properties { 
    version = "1.0";
    description = "AMBA-PV signal protocol";
    sc_master_port_class_name = "amba_pv::signal_master_port<bool>";
    sc_slave_base_class_name = "amba_pv::signal_slave_port<bool>";
    sc_slave_export_class_name = "amba_pv::signal_slave_export<bool>";
  }
 . . .

The SystemC module ports must use the corresponding names in the SystemC code as shown in Example 5.4.

Example 5.4. AMBAPV Signal protocol in SystemC component class

class pv_dma: public sc_module, 
              public amba_pv::amba_pv_slave_base<addr_t, data_t>
   {
    /* Module ports */
    amba_pv::signal_master_port<bool> signal_out;
    amba_pv::signal_slave_export<bool> signal_in;
 . . .

The SystemC port names must also match the Fast Models port names. For example, signal_out is the instance name for the master port in the Fast Models AMBAPVBus component and the SystemC port shown in Example 5.4.

Figure 5.3. SGSignal component in System Canvas

SGSignal component in System Canvas

Copyright © 2007-2009 ARM Limited. All rights reserved.ARM DUI 0370H
Non-Confidential