Reorganization of files
This commit is contained in:
43
src/axi/axi_transaction.sv
Normal file
43
src/axi/axi_transaction.sv
Normal file
@@ -0,0 +1,43 @@
|
||||
// ----------------------------------------------------------------------
|
||||
class axi_transaction extends uvm_sequence_item;
|
||||
// Declare AXI transaction fields
|
||||
rand axi_transaction_type_t txn_type; // Transaction type (read/write)
|
||||
rand bit [31:0] addr; // Address
|
||||
rand bit [31:0] data; // Data
|
||||
rand bit [3:0] strb; // Byte enable
|
||||
|
||||
`uvm_object_utils_begin(axi_transaction)
|
||||
`uvm_field_enum(axi_transaction_type_t, txn_type, UVM_DEFAULT)
|
||||
`uvm_field_int(addr, UVM_DEFAULT)
|
||||
`uvm_field_int(data, UVM_DEFAULT)
|
||||
`uvm_field_int(strb, UVM_DEFAULT)
|
||||
`uvm_object_utils_end
|
||||
|
||||
// Constructor
|
||||
function new(string name = "axi_transaction");
|
||||
super.new(name);
|
||||
endfunction
|
||||
|
||||
// Copy method for cloning
|
||||
virtual function uvm_object clone();
|
||||
axi_transaction copy;
|
||||
copy = axi_transaction::type_id::create(get_name());
|
||||
copy.txn_type = this.txn_type;
|
||||
copy.addr = this.addr;
|
||||
copy.data = this.data;
|
||||
copy.strb = this.strb;
|
||||
return copy;
|
||||
endfunction
|
||||
|
||||
// Comparison method for checking equality
|
||||
virtual function bit compare(uvm_object rhs);
|
||||
axi_transaction other;
|
||||
if (!$cast(other, rhs)) return 0; // Ensure type match
|
||||
return (this.txn_type == other.txn_type) &&
|
||||
(this.addr == other.addr) &&
|
||||
(this.data == other.data) &&
|
||||
(this.strb == other.strb);
|
||||
endfunction
|
||||
|
||||
endclass : axi_transaction
|
||||
|
Reference in New Issue
Block a user