RAL

Register Size/Definition Changes based on Mode Register Selection !! Suggestion for a better UVM Register Model ?

Hello !!

a. Have a scenario where my DUT works in two different modes. Say mode X and mode Y. And this selection is made using the mode register.
b. And based on the mode selection [either X or Y], the definition of other register changes.

For Example:
In Mode X, Register A size is 32-Bits.
Whereas in Mode Y, Register A size is 16-Bits.

In Mode X, definition of Register B is CTRL register of 32-bits in size.
Whereas in Mode Y, definition of Register B is DEBUG register of 32-bits in size with different field elements.

c. Keeping the above scenario, which would be a better way to define the UVM Register Model ? Is it better to have two separate register model one for Mode X and other for Mode Y ? Or to maintain only one register mode and internally change the register/field configurations based on the mode selection ?

Which would be a better approach and better for control-ability. Share in you inputs/suggestions !!

In reply to Sivasankaran M:

There is no general answer without knowing more details like what is the bus width etc.

In reply to chr_sue:

Consider bus width is 32bit only.

In Mode X, size of Register A is 32-Bits.(full)
Whereas in Mode Y, size of Register A is 16-Bits.(half)

In reply to Sivasankaran M:

Of course you can share your register model for different modes. But you have to consider that the meaning and the construction of the registers are different in both modes. I guess a register consists of a few register fiels. This might be different form mode to mode.
In my eyes it might be more safe amd easy to use 2 different register models.