I have a general questions about how to improve the ISR(interrupt service routine) in a verification environment.
Usually we have will define an ISR for a particular block in the block verification environment. The block ISR will be called once the block interrupt output is triggered, and it will call write/read APIs of uvm_reg through register model to respond to the interrupt. And we want to reuse the ISR to system level testing also.
In my mind, in system level ISR, it usually polls some system registers to find out the source of the interrupt, and if it is due to the particular block interrupt, it will call the ISR for the block which is reused from the block environment. This is just to emulate real software ISR behavior.
But the question is since block environment and system environment has different contexts, and the register models visible in block level and system level are different. If we use hierarchical reference such as regmodel.$block.$reg.write() to do the write, the hierarchical path will be different for block and system level, so the the same block ISR can’t be reused from block level to system level. I know uvm_reg provide method to search for the register through the register name, but it may have problems if we have multiple registers with the same name, and I am also concerned about the performance.
Another solution I can think of is use universal Macros for register accessing and replace those Macro with different definitions in system level, but that seems not a graceful way.
Can anyone give some suggestions? Thanks a lot.