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.

counter_gen.sv 608B

123456789101112131415161718192021222324252627282930313233
  1. class counter_gen;
  2. counter_trans trans_h;
  3. counter_trans trans2wr_h;
  4. mailbox #(counter_trans) gen2wr;
  5. function new(mailbox #(counter_trans) gen2wr);
  6. this.gen2wr = gen2wr;
  7. trans_h = new;
  8. endfunction
  9. virtual task start();
  10. fork
  11. begin
  12. trans_h.trans_id++;
  13. trans_h.load = 1;
  14. trans_h.data = 0;
  15. trans2wr_h = new trans_h;
  16. gen2wr.put(trans2wr_h);
  17. for(int i = 0; i < (no_of_transaction - 1); i++)
  18. begin
  19. trans_h.trans_id++;
  20. assert(trans_h.randomize());
  21. trans2wr_h = new trans_h;
  22. gen2wr.put(trans2wr_h);
  23. end
  24. end
  25. join_none
  26. endtask
  27. endclass: counter_gen