Kamil.Khoury
Kamil.Khoury

Reputation: 220

How can i tell specman to terminate the test after 5 dut_erros

I need to specify to specman a maximal amount of dut_errors in the test, which after that limit the test should be terminated. Currently i have the option to terminate the test when an error accord or never.

Upvotes: 2

Views: 322

Answers (2)

Yuri Tsoglin
Yuri Tsoglin

Reputation: 963

You can also change the check_effect to ERROR, so it will cause the run to stop. For example (I am taking here Thorsten's example, and modify it):

extend sn_util {
  !count_errors: uint;
};
extend dut_error_struct {
  pre_error() is also {
    util.count_errors += 1;
    if util.count_errors > 5 {
       set_check_effect(ERROR);
    };
  };
};

Upvotes: 3

Thorsten
Thorsten

Reputation: 700

AFAIK this does not work out of the box. You could count the errors by using a global variable and extending the error struct, something in the line of

extend sn_util {
  !count_errors: uint;
  count() is {
    count_errors += 1;
    if count_errors > 5 { stop_run() };
  };
};
extend dut_error_struct {
  write() is also { util.count() };
};

There might even be an object in global that does the counting already, but probably not documented.

Upvotes: 2

Related Questions