0

I am new to specman, I am now writing a testbench which i want to give many specific test cases to debug a calculator.

For example,

I have two files, the first one called "test1" and the second called "test2". Here is my code for "test1":

extend instruction_s {
       keep cmd_in_1 == ADD;
       keep din1_1 < 10;
       keep din2_1 < 10;
};
extend driver_u {
       keep instructions_to_drive.size() == 10;
};

And here is my code for "test2":

extend instruction_s {
       keep cmd_in_1 == SUB;
       keep din1_1 < 10;
       keep din2_1 < 10;
};
extend driver_u {
       keep instructions_to_drive.size() == 10;
};

However, when I tried to test my code, specman shows error, it seems I can't do this like that. Is there any possible way that I can let specman execute "test1" file first and then run "test2" file? Or if there is some other way that I can achieve my goal?

Thanks for your helping.

1 Answers1

0

Do you really want to have one test that executes 10 ADD instructions, and run another test that executes 10 SUB instructions?

If so, the common way to do so is to compile your testbench, and run multiple times - each time loading another test file.

For a start, try this:

 xrun my_device.v my_testbench.e test1.e
 xrun my_device.v my_testbench.e test2.e
user3467290
  • 706
  • 3
  • 4
  • Thx for answering, if I want to test many instructions, must I import many files? Can I write all tests, such like add and sub in one file, and the specman will execute add and then execute sub? – Harvey Wang Dec 14 '18 at 22:12
  • you can implement many tests in one file. it can be random ("mix some subs and some adds"), it can be directed ("first have 50 subs, and then 50 adds"), whatever you want – user3467290 Dec 16 '18 at 06:51