Skip to content

STP violations not handled across hierarchy #310

@edwardalee

Description

@edwardalee

In the following test case, the expected STP violation (the tardy handler in this notation) is not handled because of the hierarchy (this is identical to the test FederatedMaxWait2.lf except for the introduction of hierarchy):

target uC {
  platform: Native,
  timeout: 5sec
}

reactor Src(id: int = 0) {
  output out: int
  reaction(startup) -> out{=
    printf("Hello from Src!\n");
    env->platform->wait_for(env->platform, SEC(2));
    lf_set(out, 42);
    env->request_shutdown(env);
  =}
}

reactor Dst {
  input in: int
  state check2: bool = false
  reaction(startup, in) {=
    printf("Dst startup\n");
    validate(!self->check2);
    printf("Dst is input present? %d\n", lf_is_present(in));
    validate(lf_is_present(in));
    printf("Hello from Dst!\n");
    self->check2 = true;
    env->request_shutdown(env);
  =} tardy {=
    printf("STP violation\n");
    // STP violation should not happen because maxwait is forever.
    validate(false);
    env->request_shutdown(env);
  =}

  reaction(shutdown) {=
    validate(self->check2);
  =}
}

reactor Container {
  input in: int
  r1 = new Dst()
  in -> r1.in 
}

federated reactor {
  r1 = new Src()
  @maxwait(forever)
  r2 = new Container()
  r1.out -> r2.in 
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions