5.4.2 Protocol definition

The ports of the top level Fast Models component, used to create SystemC ports, have protocols. Here are examples of a TLM 1.0 signal protocol and a TLM 2.0 bus protocol.

  • The behaviors in a Fast Models protocol definition must match exactly the functions in the SystemC port class. System Canvas does not check this for consistency, but the C++ compiler can find inconsistencies when compiling the generated SystemC component.
  • The set of functions and behaviors, their arguments, and their return value must be the same. The order of the functions and behaviors does not matter.
  • All behaviors in the Fast Models protocol must be slave behaviors. There is no corresponding concept of master behaviors.
  • The protocol definition also contains a properties section that contains the properties that describe the SystemC C++ classes that implement the corresponding ports on the SystemC side.
TLM 1.0 protocol for an exported SystemC component
protocol MySignalProtocol 
{ 
  includes 
  { 
    #include <mySystemCClasses.h> 
  } 
properties 
  { 
    sc_master_port_class_name= "my_signal_base<bool>"; 
    sc_slave_base_class_name = "my_slave_base<bool>"; 
    sc_slave_export_class_name = "my_slave_export<bool>"; 
  } 
  slave behavior set_state(const bool & state); 
}
TLM 2.0 bus protocol for an exported SystemC component
protocol MyProtocol 
{ 
  includes 
  { 
    #include <mySystemCClasses.h> 
  } 
  properties 
  { 
    sc_master_base_class_name = "my_master_base"; 
    sc_master_socket_class_name = "my_master_socket<64>"; 
    sc_slave_base_class_name = "my_slave_base<64>"; 
    sc_slave_socket_class_name = "my_slave_socket<64>"; 
  } 
  slave behavior read(uint32_t addr, uint32_t &data); 
  slave behavior write(uint32_t addr, uint32_t data); 
  master behavior invalidate_dmi(uint32_t addr); 
}
This protocol enables declaring ports that have read() and write() functions. This protocol can declare master and slave ports.
Non-ConfidentialPDF file icon PDF versionARM DUI0370S
Copyright © 2007-2014 ARM. All rights reserved.