| | 1 | {{{ |
| | 2 | #!html |
| | 3 | <h1>General rules for the SoCLib hardware components</h1> |
| | 4 | }}} |
| | 5 | [[PageOutline]] |
| | 6 | |
| | 7 | = A) Introduction = |
| | 8 | |
| | 9 | = B) Naming convention = |
| | 10 | |
| | 11 | '''namespaces''' |
| | 12 | |
| | 13 | SystemC being build upon C++, we use the C++ namespace constructs, to create unambiguous names. |
| | 14 | SoCLib defines the following namespaces: |
| | 15 | * `soclib` |
| | 16 | * `soclib::common` |
| | 17 | * `soclib::caba` |
| | 18 | *`soclib::tlmt` |
| | 19 | |
| | 20 | '''variables''' |
| | 21 | |
| | 22 | The following conventions have been defined : |
| | 23 | * All component port names should be prefixed with `p_` |
| | 24 | * All component register names should be prefixed with `r_` |
| | 25 | * All component member variable names should be prefixed with `m_` |
| | 26 | |
| | 27 | = C) Component indexation = |
| | 28 | |
| | 29 | In a VCI-based architecture, all initiators and targets must be indexed. Initiators and targets have different address spaces. |
| | 30 | * The target index is used by interconnect components : those components decode the VCI address MSB bits to get the target index and route the VCI command packets. |
| | 31 | * The initiator index is used by the interconnect components to route the VCI response packets : the initiator index is the VCI SRCID value. |
| | 32 | |
| | 33 | Indexes can be : |
| | 34 | * a simple scalar index, in case of a ''flat'' interconnect. |
| | 35 | * a composite index, in case of a ''clusterised'' architectures, using a two level hierarchical interconnect. Each component is identified by two scalars: cluster_index, local_index. |
| | 36 | |
| | 37 | The `common/int_tab.h`file defines an utility class storing a list of indexes : All indexes must be declared as IntTabs. |