3 Commits

Author SHA1 Message Date
  gandra_pravalika 7f5ef75581 axi_seqitem 6 months ago
  gandra_pravalika 159b70577b axi 6 months ago
  gandra_pravalika 427f888faa cov 6 months ago
3 changed files with 108 additions and 0 deletions
Split View
  1. +1
    -0
      axi_coverage.sv.bak
  2. +76
    -0
      axi_seqitem.sv.bak
  3. +31
    -0
      axi_sequence.sv.bak

+ 1
- 0
axi_coverage.sv.bak View File

@@ -0,0 +1 @@


+ 76
- 0
axi_seqitem.sv.bak View File

@@ -0,0 +1,76 @@
class seq_item extends uvm_sequence_item;
`uvm_object_utils (seq_item)

/////////////////write_address channel///////////////////
rand bit [3:0] awid;
rand logic [31:0]awaddr;
rand logic [3:0] awlen;
rand logic [2:0] awsize;
rand logic [1:0] awburst;
rand logic [3:0] awcache;
rand logic [2:0] awprot;
rand logic [1:0] awlock;
logic awvalid;
logic awready;

////////////write_data channel///////////////////////////

rand bit[3:0] wid;
rand logic [31:0]wdata[];
logic [3:0]wstrb;
logic wlast;
logic wvalid;
logic wready;

//////////write_response channel////////////////////////

bit [3:0]bid;
logic [1:0]bresp;
logic bvalid;
logic bready;

/////////////read_address//////////////////////////////

randc bit [3:0] arid;
rand logic [31:0]araddr;
rand logic [3:0]arlen;
rand logic [2:0]arsize;
rand logic [1:0]arburst;
rand logic [3:0]arcache;
rand logic [2:0]arprot;
rand logic [1:0]awlock;
logic arvalid;
logic arready;

//////////////read_data/////////////////////////////
bit [3:0] rid;
logic [31:0]rdata[];
logic [1:0]rresp;
logic rlast;
logic rvalid;
logic rready;

bit wr_rd;
int lower_boundary;
int upper_boundary;

constraint burst{awburst !=2'b11;}
constraint wrap{if(awburst==2'b10) awlen inside {1,3,7,15};}
constraint id {arlen == awlen;arsize == awsize;awid == wid;awid == arid;}
constraint aligned {(awaddr%(2**awsize)==0);}
constraint awburst{awburst inside {0,1,2}; awburst dist {2'b00:/10 , 2'b01:/60 , 2'b10:/30};}
constraint arburst{arburst inside {0,1,2}; arburst dist {2'b00:/10 , 2'b01:/60 , 2'b10:/30};}
constraint 4kb{((awaddr%4096) >=(awaddr+(awlen*awsize)%4096;}


function new(string name = "seq_item");
super.new(name);
endfunction
endclass








+ 31
- 0
axi_sequence.sv.bak View File

@@ -0,0 +1,31 @@
Class wrap_sequence extends uvm_sequence;
`uvm_object_utils(wrap_sequence)
seq_item s;
function new(string name="wrap_sequence");
super.new(name);
endfunction3
task body();
s=sequence::type_id::create("s");
start_item(s);
assert(s.randomize() with (s.awburst=2'b10; s.awlen=3; s.awsize=2));
finish_item();
endclass

class fixed_sequence extends uvm_sequence;
`uvm_object_utils(fixed_sequence)
seq_item s;
function new(string name="fixed_sequence");
super.new(name);
endfunction
task body();
s=sequence::type_id::create("s");
start_item(s);
wr_rd==1;
assert(s.randomize() with (s.awburst=0; s.awaddr= s.araddr; s.awaddr inside {[100:2000]}, s.wdata = 1000;);
////assert(s.randomize() with (s.awburst=0; s.awaddr!= s.araddr);
finish_item();
endclass




Loading…
Cancel
Save