mounika há 5 meses
ascendente
cometimento
21c59b9753
1 ficheiros alterados com 117 adições e 0 eliminações
  1. +117
    -0
      axi_seq.sv

+ 117
- 0
axi_seq.sv Ver ficheiro

@@ -0,0 +1,117 @@

//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

Carregando…
Cancelar
Guardar