does anyone have a RAL sequence to test register aliasing ?
- write one register adn read back all register
- write all registers with uniq values and read back
Thanks
does anyone have a RAL sequence to test register aliasing ?
Thanks
In reply to neel_11:
you can use inbuilt register sequences for that.like bit bash seq, reg access seq etc for register operations.
In reply to neel_11:
does anyone have a RAL sequence to test register aliasing ?
It is just easy. Whar you are requesting and you should be able to do this on your own.
pre-defined sequences do not provide such functionality.
In reply to chr_sue:
Agree to your point, pre-defined sequence do not provide mentioned functionality.
Hi neel_11,
following code may helpful to you.
uvm_reg regs[$];
bit[31:0] rand_value;
bit[31:0] read_value;
ral_model.get_regiters(regs);
//Shuffling the register queue
regs.shuffle();
/** write random register and read all registers back **/
regs[0].write(status, rand_value);
foreach(regs[i])
begin
regs[i].read(status, read_value);
// Perform checks
end
/** write all registers with random value and read back **/
foreach(regs[j])
begin
rand_value = $urandom; //Add randomization based on your requirement
regs[i].write(staus, rand_value);
regs[i].read(status,read_value);
//Perform checks
end
In reply to mitesh.patel:
How does the last piece of the test “write all registers with random value and read back” help with aliasing test? When you write to a register followed by a read, it will return the same value that you write. I’m not clear how this helps with testing register aliasing.
I believe what you are suggesting is to write all registers with unique values first and then read back all registers and ensure that none of the register values are corrupted and they have the expected unique values.
/** write all registers with random value **/
foreach(regs[i])
begin
rand_value = $urandom; //Add randomization based on your requirement
regs[i].write(staus, rand_value);
end
/** Read back all the registers and check against mirror value **/
foreach(regs[i])
begin
regs[i].read(status,read_value);
//Perform checks
end