|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
-
- //write sequence
- class axi_wr_seq extends uvm_sequence #(axi_seq_item);
- `uvm_object_utils(axi_wr_seq)
-
- seq_item txn;
-
- function new(string name="axi_wr_seq");
- super.new(name);
- endfunction
-
- task body();
- txn=seq_item::type_id::create(txn);
- start_item(txn);
- assert(txn.randomize() with {txn.write==1;txn.awaddr==0x04;txn.wdata==0x2b1a;});
- finish_item(txn);
- endtask
-
- endclass
-
- //read sequence
- class axi_rd_seq extends uvm_sequence #axi_(seq_item);
- `uvm_object_utils(axi_rd_seq)
-
- seq_item txn;
-
- function new(string name="axi_rd_seq");
- super.new(name);
- endfunction
-
- task body();
- txn=seq_item::type_id::create(txn);
- start_item(txn);
- assert(txn.randomize() with {txn.write==0;txn.araddr==0x04;});
- finish_item(txn);
- endtask
-
- endclass
-
- //unaligned sequence
- class axi_rd_seq extends uvm_sequence #(axi_seq_item);
- `uvm_object_utils(axi_rd_seq)
-
- seq_item txn;
-
- function new(string name="axi_rd_seq");
- super.new(name);
- endfunction
-
- task body();
- txn=seq_item::type_id::create(txn);
- // if(txn.awaddr%2**awsize!=0)
- // begin
- txn.aligned_addr.constraint_mode(0);
- // end
- start_item(txn);
- assert(txn.randomize() with {txn.write==1;txn.awaddr==0x07;txn.awsize==3;});
- finish_item(txn);
- endtask
-
- endclass
-
-
- //locked access sequence
- class axi_locked_access_seq extends uvm_sequence #(axi_seq_item);
- `uvm_object_utils(axi_locked_acess_seq)
-
- seq_item txn;
-
- function new(string name="axi_locked_access_seq");
- super.new(name);
- endfunction
-
- task body();
- begin
- txn=seq_item::type_id::create(txn);
- start_item(txn);
- assert(txn.randomize() with {txn.write==1;txn.awaddr==0x04;txn.awlock==2'b10;txn.awid==01;});
- finish_item(txn);
- end
-
- begin
- txn=seq_item::type_id::create(txn);
- start_item(txn);
- assert(txn.randomize() with {txn.write==1;txn.awaddr==0x04;txn.awlock==2'b10;txn.awid==02;});
- finish_item(txn);
- end
-
-
- endtask
-
- endclass
-
-
-
- //write read sequence
- class axi_rd_seq extends uvm_sequence #(axi_seq_item);
- `uvm_object_utils(axi_rd_seq)
-
- seq_item txn;
- axi_wr_seq wr_seq;
- axi_rd_seq rd_seq;
-
-
- function new(string name="axi_rd_seq");
- super.new(name);
- endfunction
-
- task body();
- begin
- txn=seq_item::type_id::create(txn);
- `uvm_do(wr_seq);
- `uvm_do(rd_seq);
- end
- endtask
-
- endclass
|