trying a code to check expect statement in specman

441 views Asked by At

The following gives error for event a, b declaration as "unrecognized struct member". Please help me understand.

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

There are 1 answers

0
Tudor Timi On

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