Changes between Version 5 and Version 6 of Writing Rules/Caba
- Timestamp:
- Mar 27, 2007, 7:51:09 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Caba
v5 v6 1 1 = Introduction = 2 2 3 This manual describes the modeling rules for writing "cycle-accurate / bit-accurate" SystemC simulation models . Those models can be used with the "standard" OSCI simulation engine (SystemC 2.x), but can be used also with others simulation engines, such as [SystemCass SystemCASS], which is optimized for models complying with those rules.3 This manual describes the modeling rules for writing "cycle-accurate / bit-accurate" SystemC simulation models for SoCLib. Models complying with those rules can be used with the "standard" OSCI simulation engine (SystemC 2.x), but can be used also with others simulation engines, such as [SystemCass SystemCASS], which is optimized for such models. 4 4 5 5 Those modeling rules are based on the "Synchronous Communicating Finite State Machines" theory. The idea is to force the "event driven" SystemC simulation engine to run as a cycle based simulator. … … 16 16 In this figure we represented a single FSM, but a SoCLib component contains generally several small FSMs running in parallel inside a single module. This internal parallelism should be properly described. 17 17 18 = How to write simulation models = 19 20 == Component's module == 18 = Components = 21 19 22 20 A SoCLib CABA component `XXX` is generally described as a class derived from the … … 27 25 * `XXX.cc` contains the code of the methods associated to this component. 28 26 29 = = Namespaces ==27 = Namespaces = 30 28 31 29 SystemC is built upon C++. We can benefit from C++ constructs. Namespaces allows us to create unambiguous names … … 36 34 * `soclib::tlmt` 37 35 38 = = Component indexation ==39 40 In a VCI-based architecture, all initiators must be indexed. Targets are identified by their assigned address space . However, for simplification purposes, we'll also give an index to the targets. Index space for targets is different from index space for initiators.41 * The target index is the connection port number on interconnects, this index will be decoded from target address in VCI cmd packet.36 = Component indexation = 37 38 In a VCI-based architecture, all initiators must be indexed. Targets are identified by their assigned address space segment. However, for simplification purposes, we'll also give an index to the targets. Index space for targets is different from index space for initiators. 39 * The target index is used by interconnects, that decode the VCI address MSB bits to get the target index. 42 40 * The initiator index is used by the interconnect components to route the response packets. 43 41 … … 50 48 [source:trunk/soclib/systemc/include/common/int_tab.h common/int_tab.h] defines an utility class storing list of indexes. All indexes are `IntTab`s. 51 49 52 = = VCI Interface ==50 = VCI Interface = 53 51 54 52 In order to enforce interoperability between components, all SoCLib hardware components should respect the advanced VCI standard. … … 79 77 80 78 81 == Address space segmentation == 82 83 In a shared memory architecture, the address space segmentation (or memory map) is a global characteristic of the system. This memory map must be defined by the system designer, and is used by both software, and hardware components. 79 = Address space segmentation = 80 81 In a shared memory architecture, the address space segmentation (or memory map) is a global characteristic of the system. 82 This memory map must be defined by the system designer, and is used by both software, and hardware components. 84 83 85 84 Most hardware components use this memory map: 86 * VCI interconnect components contain a « routing table »used to decode the addresses and87 route VCI commands to the proper targets. This routing table is implemented as a ROM.85 * VCI interconnect components contain a ''routing table'' used to decode the addresses and 86 route VCI commands to the proper targets. 88 87 * VCI target components must be able to check for segmentation violation when receiving a 89 88 command packet. Therefore, the base address and size of the segment allocated to a given … … 109 108 Any hardware component using the memory map should have a constant reference to the mapping table as constructor argument. 110 109 111 == Constructor arguments == 112 113 Any hardware component must have an instance name, and most SoCLib component must have 114 a VCI index. Moreover, generic simulation models can have structural parameters defined as 115 arguments in the constructor. A typical VCI component will have the following constructor arguments: 116 117 {{{ 118 VciExampleModule( 119 sc_module_name insname, 120 const soclib::common::IntTab &index, 121 const soclib::common::MappingTable &mt); 122 }}} 123 124 In this example, the first argument is the instance name, the second argument is the VCI target index, and the third argument is the mapping table. 125 126 == Naming conventions == 110 = Naming conventions = 127 111 128 112 The following conventions are not mandatory, but can help to read the code. … … 131 115 * All member variables should be prefixed with `m_` 132 116 133 = = Component ressources ==117 = Component ressources = 134 118 135 119 The component ''XXX.h'' file contains the following informations 136 120 137 == = Interface definition ===121 == Interface definition == 138 122 139 123 A typical VCI target component will contain the following ports: … … 144 128 }}} 145 129 146 == = Internal registers ===130 == Internal registers == 147 131 148 132 All internal registers must be defined with the type ''sc_signal'' … … 166 150 ''`typename vci_param::trdid_t` and others are generically-defined VCI field types'' 167 151 168 == = Structural parameters ===152 == Structural parameters == 169 153 170 154 All structural parameters must be be defined as member variables. The values are generally defined by a constructor argument. … … 178 162 }}} 179 163 180 == Constructor & descructor == 181 182 The first constructor argument must be the instance name. Other arguments can be identifiers 183 (such as a target VCI index or initiator VCI index). The constructor must configure some hardware 184 ressources, such as the address decoding ROM that exists in any VCI interconnect. An argument frequently 164 = Constructor & destructor = 165 166 Any hardware component must have an instance name, and most SoCLib component must have 167 a VCI index. Moreover, generic simulation models can have structural parameters defined as 168 arguments in the constructor, and used by the constructor to configure the hardware ressources. 169 A constructor argument frequently 185 170 used is a reference on the [source:trunk/soclib/systemc/include/common/mapping_table.h soclib::common::MappingTable], 186 171 that defines the segmentation of the system address space. 172 A typical VCI component will have the following constructor arguments: 173 174 {{{ 175 VciExampleModule( 176 sc_module_name insname, 177 const soclib::common::IntTab &index, 178 const soclib::common::MappingTable &mt); 179 }}} 180 181 In this example, the first argument is the instance name, the second argument is the VCI target index, and the third argument is the mapping table. 187 182 188 183 Moreover, the constructor must define the sensitivity list of the Transition(), genMoore() and genMealy() … … 194 189 Be careful: the constructor should NOT initialize the registers. 195 190 The register initialization must be an hardware mechanism explicitly described in the Transition function on reset condition. 191 192 = component behaviour = 193 194 The component is described by simple sc_methods as member functions. 196 195 197 196 == transition() method ==