以下内容将事件a,b声明的错误视为"无法识别的struct member"。请帮我理解。
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;
};
答案 0 :(得分:3)
首先,您必须为每个事件添加不同的event
声明(这不是C / C ++)。此外,expect
是声明性构造。你必须在方法之外声明它:
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 ; ~[..]};
};