Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

axi_seq.sv 2.3 KiB

7 månader sedan
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. class write_sequence_fixed extends uvm_sequence#(axi_seq_item);
  2. `uvm_object_utils(write_sequence)
  3. axi_seq_item txn;
  4. function new(string name = "write_sequence");
  5. super.new(name);
  6. endfunction
  7. virtual task body();
  8. `uvm_info(get_type_name(), $sformatf("//---------------- FIXED SEQUENCE is started -----------------//"), UVM_MEDIUM)
  9. txn = axi_seq_item::type_id::create("txn");
  10. start_item(txn);
  11. assert(txn.randomize() with {awburst=2'b00;awlen=3;awsize=4};} );//FIXED
  12. txn.wr_rd=1;
  13. finish_item(txn);
  14. endtask
  15. endclass
  16. class write_sequence_incremental extends uvm_sequence#(axi_seq_item);
  17. `uvm_object_utils(write_sequence)
  18. axi_seq_item txn;
  19. function new(string name = "write_sequence");
  20. super.new(name);
  21. endfunction
  22. virtual task body();
  23. `uvm_info(get_type_name(), $sformatf("//---------------- INCREMENTAL SEQUENCE is started -----------------//"), UVM_MEDIUM)
  24. txn = axi_seq_item::type_id::create("txn");
  25. start_item(txn);
  26. assert(txn.randomize() with {awburst=2'b10;awaddr==awaddr+2**awsize};} );//INCREMENTAL
  27. txn.wr_rd=1;
  28. finish_item(txn);
  29. endtask
  30. endclass
  31. class write_sequence_wrap extends uvm_sequence#(axi_seq_item);
  32. `uvm_object_utils(write_sequence)
  33. axi_seq_item txn;
  34. function new(string name = "write_sequence");
  35. super.new(name);
  36. endfunction
  37. virtual task body();
  38. `uvm_info(get_type_name(), $sformatf("//---------------- WRAP SEQUENCE is started -----------------//"), UVM_MEDIUM)
  39. txn = axi_seq_item::type_id::create("txn");
  40. start_item(txn);
  41. assert(txn.randomize() with {awburst=2'b10;awlen=3;awsize=4};} );//WRAP
  42. txn.write=1;
  43. finish_item(txn);
  44. endtask
  45. endclass
  46. class write_sequence extends uvm_sequence#(axi_seq_item);
  47. `uvm_object_utils(write_sequence)
  48. axi_seq_item txn;
  49. function new(string name = "write_sequence");
  50. super.new(name);
  51. endfunction
  52. virtual task body();
  53. `uvm_info(get_type_name(), $sformatf("//---------------- WRITE SEQUENCE is started -----------------//"), UVM_MEDIUM)
  54. txn = axi_seq_item::type_id::create("txn");
  55. start_item(txn);
  56. assert(txn.randomize() with {foreach(awlen[i]) if(i==awlen+1) wlast==1};} );//for last transfer
  57. txn.wr_rd=1;
  58. finish_item(txn);
  59. endtask
  60. endclass