Search code examples
system-veriloguvm

How to update regmodel with writes going from RTL blocks


I understand that regmodel values are updated as soon as transaction initiates from test environment on any of the connected interfaces.

However consider a scenario:

  1. RTL registers being updated from ROM on boot-up (different value than default)
  2. Processor in RTL writing to register as compared to test environment.

In these 2 cases regmodel doesn't get updated/mirrored with correct RTL value. I would like to know what is correct procedure to get regmodel updated, if there is none at the moment what other approach can be taken to keep these 2 in sync?


Solution

  • For the first case you have to pre-load your memory model with your ROM contents at the start of the simulation. There isn't any infrastructure to do this in uvm_memory (unfortunately), so you'll have to implement it yourself.

    For the second case, you have to use a more grey-box approach to verification. You have to monitor the bus accesses that the processor does to the peripherals and update the register values based on those transactions. This should be OK to do from a maintainability point of view, because the architecture of your SoC should be pretty stable in that sense (you've already decided to use a processor so that will always be there, but you might not know which peripherals will make it to the end).