Skip to content

End to end flow instantiation creates nonsense flow #2009

Description

@AaronGreenhouse

In the example below, the end to end flow e2e is broken because the destination of connection c1 doesn't match the starting point of flow fpath. An error about this is generated on the declarative model. But when you instantiate the system top.specific an end to end flow instance for e2e is created, and it contains the erroneous connection. No error is reported on the instance model.

package fred2
public
    thread th
        features
            i: in event port;
            i_wrong: in event port;
            o: out event port;
        flows
            fpath: flow path i -> o;
    end th;
    
    thread implementation th.specific
--        flows
--            fpath: flow path i -> o;
    end th.specific;
        
    thread th2
        features
            o: out event port;
            i: in event port;
        flows
            fsrc: flow source o;
            fsnk: flow sink i;
    end th2;
    
    thread implementation th2.i
        -- trivial
    end th2.i;
    
    process top
    end top;
    
    process implementation top.specific
        subcomponents
            t: thread th.specific;
            q: thread th2.i;
        connections
            c1: port q.o -> t.i_wrong;
            c2: port t.o -> q.i;
        flows
            e2e: end to end flow q.fsrc -> c1 -> t.fpath -> c2 -> q.fsnk;
    end top.specific;
end fred2;

However, if you uncomment the (superfluous) flow path implementation in th.specific, then the end to end flow is not created and the instance model has the error message:

Cannot create end to end flow 'e2e' because the end of the semantic connection 'q.o -> t.i_wrong' does not connect to the start of flow 'fpath'

This is because the error checking of connection endpoints in instantiation only happens when there is a flow implementation. The methods isValidContinuation() are used.

(These methods are currently causing other problems, however, see issue #1984.)

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions