Interrupt handling in UVM Test

Blog-poster-for-UVM-TB-01-1536x968
Uncategorized

Interrupt handling in UVM Test

In this blog post, we will go over the implementation of interrupt handling in the UVM Test bench(TB) environment.

In a DUT, typically there will be one or more interrupt pins.  Related to interrupts, TB

  1. Would need to check the correctness of interrupts
  2. May need to have routines to service the interrupts
  3. May have mask registers that would need to be checked for correctness.

When there are multiple functionalities in a DUT that trigger interrupt (s), it is better than in the TB, all interrupt-related checking and service routine logic are centrally handled.

When there are multiple interrupt pins in a DUT to indicate each individual interrupt, the TB can use the individual interrupt pins in interrupt checkers and trigger interrupt service routines.  When there is a single interrupt pin, there will be a status register that has bits to indicate which particular interrupt status caused the interrupt to assert.  In either case, the chip interface can have individual interrupt events for each of the functionality in the DUT and a centralized interrupt handler can take up triggering these individual interrupts which can be used within the Test environment by the interrupt checkers and the interrupt service routines.

The interrupt handler flow for a single interrupt pin is as shown in this block diagram.

Learn NowSystemVerilog for Verification

In this flow, when the DUT asserts the interrupt, in the TB, first the status register is read and then the mask register value can be got from a register model or read from DUT and then based on the mask value and the status value, the interrupt bits that are set by the DUT are derived and the respective interrupt events in the chip interface are triggered.  Subsequent to that, an optional mask checking can be added – that is the mask bits can be turned on to check if the interrupt gets masked/de-asserted.  In the TB, there typically needs to be separate interrupt service routines for each of the interrupts.  These routines will wait for the respective interrupt to be triggered and then would service the interrupt and then would trigger interrupt service done.  For each of the interrupt, the chip interface would also need to have separate interrupt service done events.  Separately, interrupt checkers will get triggered based on respective TB interrupts and the checkers would check to see if the respective interrupt is expected and then display pass/fail accordingly.

The main interrupt handling thread waits for all interrupt service routines done and then clears the respective interrupt status bits and asserts respective interrupt cleared event.  For each of the interrupt, chip interface need to have interrupt cleared events. 

While the interrupts are getting serviced, more interrupts could have happened in the DUT- to check that, again the status is read and mask is read – if there are new interrupts then the whole process of triggering the respective interrupts are started – else the thread waits for main interrupt to de-assert and then goes back to the start.

Given below is an illustration of interrupt handler for a router. 

https://marvel.edvlearn.com/wp-content/uploads/2023/04/Interupt-Handling.gif

In an UVM TB, the interrupt handler can be a separate uvm component.  A video illustration of interrupt handler is in the following link: 

http://<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/fyOB6ygHfYo” frameborder=”0″ allow=”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe>

A code snippet of the interrupt handler is given below:

To get the full UVM TB code of this illustrated interrupt handler, email us at coderequest@edveon.com

Leave your thought here

Your email address will not be published. Required fields are marked *

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare