You copied the Doc URL to your clipboard.

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 these 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.

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;
    }
}

These rules apply:

Single-to-array connections
The master port is connected to every element of the slave port array.
Array-to-single connection
Every element of the master port array is connected to the slave port.
Array-to-array connections
Each element of the master port array is connected to the element of the slave port array that has the same index. The master must be equal to or smaller than the slave, otherwise an error is raised.
Was this page helpful? Yes No