尝试使用代码检查specman中的expect语句

时间:2014-11-14 09:02:08

标签: specman

以下内容将事件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;
};

1 个答案:

答案 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 ; ~[..]};
};