0

下面给出了事件 a、b 声明为“无法识别的结构成员”的错误。请帮我理解。

unit true_match_op {
  event a, b;

  my_task() @sys.any is {
  emit a;
  wait [2]*cycle;
  emit b;
  wait [5]*cycle;
  emit a;
  expect @b => {@a ; ~[..]};
};
run() is also {
start my_task();
stop_run();
};
};

extend sys {
  my_unit : true_match_op is instance;
};
4

1 回答 1

3

First of all, you have to add a different event declaration for each event (this isn't C/C++). Also, an expect is a declarative construct. You have to declare it outside of the method:

unit true_match_op {
  event a;
  event b;

  my_task() @sys.any is {
  emit a;
  wait [2]*cycle;
  emit b;
  wait [5]*cycle;
  emit a;
  };

  expect @b => {@a ; ~[..]};
};
于 2014-11-14T14:02:51.567 回答