YARP Scoreboard

Using C++ models and DPI for checks!

This module would discuss the implementation of the yarp_scoreboard component for the YARP CPU testbench. This is a crucial component of the testbench as it is responsible for checking the transactions sent by the monitor and ensuring that they are correct. The scoreboard would be checking the architectural state of the YARP CPU by comparing the 32 architectural registers and the program counter (PC) with the expected values.

CPU Model and DPI Calls

In order for the scoreboard to check the architectural state of the YARP CPU, it would also need to decode, execute and write back the result of every instruction. This sounds like a lot of work, and in order to manage this complexity, we can leverage the DPI (Direct Programming Interface) calls to interact with the C++ model of the CPU. Usually, the C or C++ based models are more efficient and easier to maintain than SystemVerilog models, especially for complex components like CPUs. The DPI calls would allow us to call C++ functions from SystemVerilog and vice versa. In this case, we would be using the DPI calls to interact with the C++ model of the YARP CPU to maintain the architectural state and check the transactions sent by the monitor. The model supports the following API calls:

  • init(): This function initializes the CPU model.
  • step(instruction): This function would take an instruction as input and execute it, updating the architectural state of the CPU.
  • compare_instruction_address(address): This function basically checks if the program counter (PC) is at the expected address.

Loading the interactive workspace...