Verwendeter Programmcode in Studienarbeit für ESY1B zum Thema "Verifikation mit SystemVerilog und Python"
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.sv 1001B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import counter_pkg::*;
  2. class counter_trans_load extends counter_trans;
  3. randc logic [3:0] data;
  4. constraint r1 {rst inside {0, 1};}
  5. constraint l1 {load inside {0, 1};}
  6. constraint d1{super.data == data;}
  7. endclass
  8. class test;
  9. virtual counter_if.WR_BFM wr_if;
  10. virtual counter_if.WR_MON wrmon_if;
  11. virtual counter_if.RD_MON rdmon_if;
  12. counter_env env;
  13. counter_trans_load trans_ld_h;
  14. function new( virtual counter_if.WR_BFM wr_if,
  15. virtual counter_if.WR_MON wrmon_if,
  16. virtual counter_if.RD_MON rdmon_if);
  17. this.wr_if = wr_if;
  18. this.wrmon_if = wrmon_if;
  19. this.rdmon_if = rdmon_if;
  20. env = new(wr_if, wrmon_if, rdmon_if);
  21. endfunction
  22. task build_and_run;
  23. if($test$plusargs("TEST1"))
  24. begin
  25. no_of_transaction = 250;
  26. env.build();
  27. env.run();
  28. $finish;
  29. end
  30. if($test$plusargs("TEST2"))
  31. begin
  32. trans_ld_h = new();
  33. no_of_transaction = 250;
  34. env.build();
  35. env.gen_h.trans_h = trans_ld_h;
  36. env.run();
  37. $finish;
  38. end
  39. endtask
  40. endclass :test