Changes between Version 16 and Version 17 of Writing Rules/Caba


Ignore:
Timestamp:
Apr 26, 2007, 3:29:33 PM (17 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Writing Rules/Caba

    v16 v17  
    88This 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.
    99
    10 Besides you may also want to follow some [WritingRules/NamingGuidelines naming guidelines] that increase code readability.
    11 
    12 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.
     10Besides you may also want to follow the [WritingRules/General general SoCLib rules].
     11
     12Those CABA 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.
    1313
    1414[[Image(fsm.png,align=right,nolink)]]
     
    2525= Components =
    2626
    27 A SoCLib CABA component `XXX` is generally described as a class derived from the
     27A SoCLib CABA simulation model for an hardware component `XXX` is generally described as a class derived from the
    2828[source:trunk/soclib/systemc/include/caba/util/base_module.h soclib::caba::BaseModule] class.
     29
     30
    2931
    3032At least two files are associated to each hardware component:
     
    3234 * `XXX.cc` contains the code of the methods associated to this component.
    3335
    34 = Namespaces =
    35 
    36 SystemC is built upon C++. We can benefit from C++ constructs. Namespaces allows us to create unambiguous names
    37 while keeping them short and clean. SoCLib defines some namespaces:
    38  * `soclib`
    39  * `soclib::common`
    40  * `soclib::caba`
    41  * `soclib::tlmt`
    42 
    43 = Component indexation =
    44 
    45 In a VCI-based architecture, all initiators and targets must be indexed.  Index space for targets is different from index space for initiators.
    46  * The target index is used by interconnects, that decode the VCI address MSB bits to get the target index.
    47  * The initiator index is used by the interconnect components to route the response packets.
    48 
    49 For the initiators, the index is the VCI SRCID value.
    50 
    51 Indexes can be
    52  * a simple scalar index, in case of a ''flat'' interconnect.
    53  * a composite index in case a hierarchical two level interconnect where each component is identified by two scalars: (cluster_index, local_index).
    54 
    55 [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.
    56 
    5736= VCI Interface =
    5837
    59 In order to enforce interoperability between components, all SoCLib hardware components should respect the advanced VCI standard.
    60 Any component having a VCI interface must include one of the the two following files
     38In order to enforce interoperability, all hardware architectures build with the SoCLib component library
     39will communicate through a "flat", shared address space, and all system interconnect will respect the VCI advanced standard. Therefore, most SoCLib components have  VCI interfaces :
     40
     41[[Image(WritingRules:mandatory.png, nolink)]]
     42
     43All SoCLib hardware components having a VCI interface is called a ''VCI component'', and must include
     44at least one of the the two following files, defining the VCI advanced ports :
    6145 * [source:trunk/soclib/systemc/include/caba/interface/vci_target.h caba/interface/vci_target.h]
    6246 * [source:trunk/soclib/systemc/include/caba/interface/vci_initiator.h caba/interface/vci_initiator.h]
    6347
    64 The advanced VCI signals are defined in [source:trunk/soclib/systemc/include/caba/interface/vci_signals.h caba/interface/vci_signals.h].
    65 
    6648As VCI signals can have variable widths, all VCI components must be defined with templates. The [source:trunk/soclib/systemc/include/caba/interface/vci_param.h caba/interface/vci_param.h] file contains the definition of the VCI parameters object. This object must be passed as a template parameter to the component.
    6749
    6850A typical VCI component declaration is:
    69 
    7051{{{
    7152#include "caba/util/base_module.h"
     
    8061
    8162};
    82 
    8363}}
    8464}}}
    8565
     66[[Image(WritingRules:mandatory.png, nolink)]]
     67
     68The SystemC top cell defining the system architecture must include the following file, defining the advanced VCI signals :
     69 * [source:trunk/soclib/systemc/include/caba/interface/vci_signals.h caba/interface/vci_signals.h].
     70
     71[[Image(WritingRules:guideline.png, nolink)]]
     72
     73A SoCLib hardware component that has no VCI interface should use a dedicated VCI  wrapper in order to be connected to the VCI interconnect.
    8674
    8775= Address space segmentation =
    8876
     77[[Image(WritingRules:guideline.png, nolink)]]
    8978In a shared memory architecture, the address space segmentation (or memory map) is a global characteristic of the system.
    9079This memory map must be defined by the system designer, and is used by both software, and hardware components.
     
    9988   addressed by the VCI address MSB bits.
    10089
     90[[Image(WritingRules:guideline.png, nolink)]]
     91
    10192In order to simplify the memory map definition, and the hardware component configuration, a
    10293generic object, called ''mapping table'' has been defined in
     
    118109= Component ressources =
    119110
     111[[Image(WritingRules:guideline.png, nolink)]]
     112
    120113The component ''XXX.h'' file contains the following informations
    121114
     
    223216
    224217= Complete example =
     218
     219== C1) Component definition ==
    225220
    226221Let's take the [source:trunk/soclib/systemc/include/caba/target/vci_locks.h soclib::caba::VciLocks]
     
    295290}}}
    296291
    297 And the [source:trunk/soclib/systemc/src/caba/target/vci_locks.cc implementation]:
     292== C2) Component implementation ==
     293
     294Here is the [source:trunk/soclib/systemc/src/caba/target/vci_locks.cc soclib::caba::VciLocks] component implementation:
    298295
    299296{{{