| |||
| Home > Components > Connection section | |||
The connection section is used to connect component ports with each other.
The scope of the connection section is defined by the composition section. Only the component’s own ports and ports of components declared in the composition section can be connected in the connection section.
The connections section contains a list of connection statements.
The syntax of a connection statement is shown in Example 2.25. and MAR are
the optional Master Address Range and Slave Address Range. The address
range includes both the low address and high address. SAR
masterComponent and slaveComponent can
be the instance name of any subcomponent, as defined in the composition
section, or the keyword self that stands for
the component that contains the connection section. masterComponent is
always the transaction initiator (master) and slaveComponent is
the transaction receiver (slave).
Example 2.25. Connection section syntax
masterComponent.masterPort[MAR] => slaveComponent.slavePort[SAR];
For addressable ports an address range must be specified. See Addressable ports. No address range can be specified, however, for non-addressable ports.
The following rules apply for address ranges:
If a range is only specified for the master, the range of the slave has the same size as the address range of the master and always starts from 0.
If the address range of the slave is smaller then the address range of the master port, multiple addresses of the master port are linked to the same slave port address.
If, for example, the master port has range 0 to 0x1FFF and
the slave port range is from 0 to 0xFFF, the
master port addresses 0x0001 and 0x1001 are
both linked to address 0x0001 of the slave port.
Overlapping address ranges are permitted but the order of the connection statements is significant. Later connection statements override earlier connection statements. The first connection statement, therefor, has the lowest priority. The priority of connections simplifies creating a default bus slave that covers the whole address space of the bus.
Example 2.26 shows
how ports are connected in the connection section.
Example 2.26. Connecting ports
component MyComponent
{
composition
{
mem: MyMemory(size=0x1000);
mem2: MyMemory(size=0x1000);
otherComp: MyOtherComp;
probe: MyProbe;
}
addressable master port<MyMemProtocol> memport;
master port<MyOtherProtocol> otherPort;
connection
{
// default bus slave comes first and gets all addresses which
// are not overridden by the other connection statements
self.memport[0..0xffffffff] => probe.access;
// addressable master ports can have address ranges
self.memport[0..0xfff] => mem.access[0..0xfff];
// this is equivalent to => mem2.access[0..0xfff]
self.memport[0x1000..0x1fff] => mem2.access;
self.otherPort => otherComp.otherPort;
}}
In Example 2.26, the
port memport is an external port and probe is
a component. The keyword self is used to identify
that the external port memport is connected to
the access port of the probe component.