Hello:
My question is what the recommended way to access one or more registers?
I saw in the ovm examples, in that a sequence is used for this purpose, for a single register access, just set the address and data via ovm_do_with { ... } inside function body(), for access more registers, just using multiple times of
ovm_do_with { … }, or using for loop to calculate the addresses.
Can I say for each register I want to access, I have to create a sequence for it? Can I reuse the same sequence to access a different register with different address and/or data value, by passing the new address and/or data via the new constructor?
instead of this:
function new(string name=“”, ovm_object parent=null);
super.new(name);
endfunction
I do this way
function new(string name=“”, ovm_object parent=null,
bit[31:] addr, bit[31:0] data);
super.new(name);
start_addr[31:0] = addr[31:0];
start_data[31:0] = data[31:0];
endfunction
…
`ovm_do_with {seq_item_addr = start_addr,
seq_item_data = star_data,
…}
In my testbench environment, I plan to perform read and write test for all the registers. Also I need to configure certain registers to perform traffic operation, can anyone please let me know what’s the possible way to do what I want to do here and what’s the most recommended way is and why?
Thanks,
Bob