| |||
Home > Components > Connection section > Port array connections |
LISA+ simplifies connecting port arrays by permitting port arrays in connection statements. Each connection statement consists of a left and right-hand side. There are therefore the following combinations:
single port to single port
port array to single port
single port to port array
port array to port array.
A single port can be either a port declared as single or a single element of a port array. Port arrays are used in connection statements as the array identifier without an index.
Example 2.28 shows the cases:
Example 2.28. Port array connections
protocol MyProtocol { /* protocol behaviors */ } component Foo { master port<MyProtocol> mPortArray[4]; } component Bar { slave port<MyProtocol> sPort; slave port<MyProtocol> sPortArray[4]; } component MyComponent { composition { foo : Foo; bar : Bar; } connection { // single port to single port foo.mPortArray[2] => bar.sPort; foo.mPortArray[2] => bar.sPortArray[3]; // single port to port array foo.mPortArray[2] => bar.sPortArray; // port array to single port foo.mPortArray => bar.sPortArray[3]; // port array to port array foo.mPortArray => bar.sPortArray; } }
The following rules apply to array connections:
The master port is connected to every element of the slave port array.
Every element of the master port array is connected to the slave port.
Each element of the master port array is connected to the element of the slave port array that has the same index. This mode of connection is only valid for port arrays of equal size. If the arrays or not the same size, an error is issued.