| |||
| Home > SystemC Export > Using the generated ports > 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_nameThe 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_nameThe 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_nameThe 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:
sc_slave_export_class_name and sc_master_port_class_name describe
the type of the port instances in the SystemC domain
sc_slave_base_class_name denotes
the base class from which the SystemC component is publicly derived.
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.