|
- class axi_tx extends uvm_sequence_item;
- rand bit wr_rd;
- rand bit [`ADDR_WIDTH-1:0] addr;
- rand bit [`WIDTH-1:0] dataQ[$]; //to support burst of data
- rand bit [3:0] burst_len;
- rand bit [2:0] burst_size;
- rand burst_type_t burst_type;
- rand bit [3:0] txid;
- bit [1:0] resp;
- bit [31:0] wrap_lower, wrap_upper;
- int tx_size;
- `uvm_object_utils_begin(axi_tx)
- `uvm_field_int(addr, UVM_ALL_ON|UVM_NOPACK);
- `uvm_field_queue_int(dataQ, UVM_ALL_ON|UVM_NOPACK);
- `uvm_field_int(wr_rd, UVM_ALL_ON|UVM_NOPACK);
- `uvm_field_int(burst_len, UVM_ALL_ON|UVM_NOPACK);
- `uvm_field_int(burst_size, UVM_ALL_ON|UVM_NOPACK);
- `uvm_field_enum(burst_type_t, burst_type, UVM_ALL_ON|UVM_NOPACK);
- `uvm_field_int(txid, UVM_ALL_ON|UVM_NOPACK);
- `uvm_field_int(wrap_lower, UVM_ALL_ON|UVM_NOPACK);
- `uvm_field_int(wrap_upper, UVM_ALL_ON|UVM_NOPACK);
- `uvm_object_utils_end
-
- `NEW_OBJ
- function void post_randomize();
- if (burst_type == WRAP) begin
- tx_size = (burst_len+1) * (2**burst_size);
- wrap_lower = addr - (addr%tx_size);
- wrap_upper = wrap_lower + tx_size - 1;
- end
- endfunction
- //constraint
- constraint dataQ_c{
- dataQ.size() == burst_len+1;
- }
- constraint burst_type_c{
- burst_type != RSVD_BT;
- }
- constraint wrap_aligned_c{
- (burst_type) == WRAP -> (addr%(2**burst_size)==0);
- }
- endclass
|