sarit8
Newbie level 6
I have the following transaction:
typedef enum {READ = 0, WRITE = 1} direction_enum;
I understood that I have to use uvm_config_db, so I can initializes the transaction in the sequence with arguments which initialize some of the transaction members (like addr, transfers) by, but I'm not sure how to do it.
typedef enum {READ = 0, WRITE = 1} direction_enum;
Code:
//Transaction
class axi_transaction extends uvm_sequence_item();
bit id = 0; //const
bit [31:0] addr;
bit [2:0] size = 0'b100;//const
direction_enum rw;
bit [31:0] transfers [$];
//factory registration
`uvm_object_utils_begin(axi_transaction)
`uvm_field_int(id, UVM_ALL_ON)
`uvm_field_int(addr, UVM_ALL_ON)
`uvm_field_int(size, UVM_ALL_ON)
`uvm_field_enum(rw, UVM_ALL_ON)
`uvm_field_int(transfers, UVM_ALL_ON)
`uvm_object_utils_end
//constructor
function new(string name = "axi_transaction");
super.new(name);
endfunction: new
endclass: axi_transaction
Code:
ax_trx = axi_transaction::type_id::create();