by François Cerisier and Mathieu Maisonneuve, Test and Verification Solutions
The increase of SoC complexity with more cores, IPs and other subsystems has led SoC architects to demand more from the main interconnect or network-on-chip (NoC), which is thus becoming a key component of the system. Power management, multiple clocks, protocol conversions, security management, virtual address space, cache coherency are among the features that must be managed by main interconnect and that demand proper verification. In addition, IP reuse and NoC generation solutions have enabled the conception of new SoC architectures within months or even weeks.
Simple point-to-point scoreboard methodology is taught in most good verification methodology books and tutorials. However, building a generic verification solution for an SoC interconnect that can quickly adapt to any bus protocols and SoC architectures, and can deal with SoC advanced features, requires much more than dealing with point-topoint transaction matching.
At Test and Verification Solutions (TVS), we have developed a UVM NoC scoreboard verification IP (VIP) to provide a generic approach for accelerating verification of interconnects, fabrics and NoCs.
The Basis Of Interconnect Verification
Interconnect verification methodologies first attempt to verify the end-to-end transaction routes from a master interface to a slave interface. Figure 1 shows a typical SoC interconnect, and also the testbench and UVM agents driving and monitoring the interconnect.
Figure 1 – SoC interconnect and testbench
Verification of this interconnect must include the following:
- Checking functional correctness of the transaction (scoreboard)
- Checking that the various protocols are being obeyed (VIP checkers)
- Adding architecture-specific constraints and test scenarios (use cases)
- Measuring the quality of the verification performed (functional coverage)
Whichever interconnect implementation is used (full shared bus, arbiters, switches, NoC), the interconnect can be modeled as routes between master and slaves.
The use of VIPs of the different protocols enables the generation of transactions through the interconnect, randomly covering the address space and different interconnect routes. Appropriate sequences can also be automatically extracted from the address map to cover each valid and invalid segment min and max addresses.
Protocol checkers included with any VIP should also automatically check timing and protocol violations but not further functional aspects of the interconnect.
A proper scoreboard then needs to be added so that the transaction contents and messages between masters and slaves are accurately verified.
An interconnect scoreboard should go beyond simple oneto- one data checking and also check:
- Transaction content (address, direction, attributes) no matter which interface protocol is being monitored
- Transaction routes, including that transactions arrive at the correct destination
- Address translations, virtual addresses
- Response codes
The interconnect scoreboard requires taking into account each possible route of the SoC and the address map. Routes and address map configuration is therefore a key feature of the generic interconnect scoreboard.
Additionally, the generic UVM NoC/interconnect scoreboard VIP we have developed supports the following features:
- Multiple protocols
- Transaction attributes checking
- Reconfigurable address map and route configuration
- Security management user entry point
- Power management user entry point
- Error response (invalid address, unsecured, power off, error response from slave)
- Cache coherency (ACE, ACE-Lite and similar)
Support For Multiple Protocols
Today's SoC use several different protocols such as AXI, AHB, APB, OCP, Wishbone or other in-house bus protocols. This is generally either directly supported by the main NoC or implemented by adding further bridges. Experience has shown that verifying interconnects at the SoC level, including these bridges, is essential to stress all buffers, clock domain crossing and interactions that occur between the different interfaces.
It is therefore required to be able to match transactions between these different protocols, some being symmetrical and sequential such as the APB, others being asymmetrical and using split request/response transfers such as AXI. Accordingly, one needs a representation of the transactions that is independent of the protocols and that uniquely represents transfers across the interconnect. Figure 2 below shows the conversion of an AXI transaction to its internal representation.
Figure 2 - Generic transfer representation
Additionally, the scoreboard needs to interoperate with external VIPs that may or may not be built in SystemVerilog UVM.
In order to deal with these different protocols and VIPs, we have used the adapter design pattern in order to convert specific transactions into an internal representation that matches both split transfers and sequential or pipelined protocols.
Figure 3 - VIP monitor to scoreboard adapter
Transactions are monitored by the VIP monitor and then sent (via the uvm_analysis_port) to the specific adapter class, which in turn sends the appropriate transaction format to the generic scoreboard. The UVM factory is therefore used at this level so that the right adapters are used for each interface, as shown in Figure 3 above.
The NoC scoreboard then checks both request and response transfers at the master and slave interfaces. The check is done once the master completes its transaction and gets its response, which is when the transaction is supposed to have been through the interconnect to the slave and back to the master. This is illustrated in Figure 4.
Figure 4 - Scoreboard check mechanism triggered when master response is received
Support For Transaction Attributes Checking
Transaction attributes (bufferable, cacheable, priority…) also need to be verified and compared by the scoreboard. Some protocol standards specify mandatory attributes, while others use different attributes or let the user define them. Additionally, not all attributes are transferred on each path from master to slave. These include priority and QoS-related attributes that target the interconnect itself and not necessarily the slave.
There is therefore no way to automatically match different protocol attributes.
Using the UVM factory and a base attribute virtual class, the NoC scoreboard VIP provides support for custom attributes and comparisons on a per path basis so that the appropriate attributes are checked.
Reconfigurable Address Map And Route Configuration
As interconnects and NoCs may include system-level MMUs or other dynamic translation mechanisms, the NoC scoreboard VIP needs to support dynamic reconfiguration. Besides providing the appropriate API, the scoreboard also needs to deal with uncertainties that may occur during reconfiguration.
One issue with dynamic NoC reconfiguration is that it could change while transactions are still being transmitted. In practice, the operating system should follow clear sequences prior to changing the interconnect configuration. For instance, when switching off a memory controller, the OS should make sure there is no more traffic from DMAs or video streams to this memory.
Interconnect verification should account for this dynamism in one of these ways:
- Semaphores should be implemented in the verification environment so that the random generation of the VIP is dynamically constrained such that transactions are not generated during the configuration switch; or
- The scoreboard should implement further algorithms to deal with uncertain states
For interconnects that include security management features, the basics apply—namely, forbidding unsecured transactions targeting a secured area. Further security policies could also be added such as dealing with digital rights management (DRM) or different software layers. The NoC scoreboard provides a means to deal with security features for basic common fields. This could potentially be overridden using the UVM factory in order to handle custom security policy by providing a new inherited class with userdefined security attributes and functions.
Today's complex SoCs include power management techniques to reduce power consumption. This includes dynamically switching different IPs on and off in the SoC. When an IP is off, some interconnect architecture may be configured to forbid direct access to this slave. Alternatively, a wrapper could be added around the power domain to forbid such accesses.
In this case, either an error response is returned from the interconnect (as in the security breach case) or the interconnect triggers an event to let the power management state machine wake up the corresponding IP. This is similar to dynamically reconfiguring the interconnect and removing a path. Taking in account the same precautions, the NoC scoreboard VIP provides ways to deal with these power states through user-defined extensions through the UVM factory.
Response Code Checking
Error management is a key component of a stable system. Verifying the interconnect under error conditions should therefore be addressed with appropriate scenarios. This includes addressing undefined address spaces and unmapped registers, and also generating errors from the different slaves. Additionally, power management and security management should be addressed, and the transaction response be checked under error conditions. The NoC scoreboard proposes automatically checking the response code of:
- Unmapped addresses
- Unsecured accesses to secured memories
- Transactions to a closed path (for power off or other reasons)
- Custom policy
For other valid transactions, the response code received at the master interface is checked against the response code returned by the slave interface. Since some protocol conversion may not keep the granularity of the bursts and transfer response code, this is done globally on a per burst basis.
With more cores in an SoC, cache coherency has become a system-level issue. The latest protocols such as ACE address this issue by providing ways for masters to communicate coherent cache data.
Cache coherency verification attempts to verify:
- Communication between coherent masters
- Proper passing of shared data between coherent masters
- Accurate master ACE responses in regards to cache states
Cache coherency affects interconnect verification either by adding a need to address ACE communication as well (if we consider masters as being the cache) or because transactions initiated by the CPU are not necessarily the transactions being seen at the memory controller interface (if we consider the master as being the CPU before the cache).
Figure 5 - NoC scoreboard structure with ACE layer
The ACE communication can be checked by adding an additional ACE scoreboard layer between masters (Figure 5 above). This layer will check that whenever a ACE or ACE-Lite master is initiating an access to a shared data, this access is properly communicated to all ACE masters and that the return value is either coming from the cache or the memory.
Checking ACE communication requires monitoring both the AXI and ACE interfaces and connecting them to the scoreboard.
When a master initiates a shared access from its AXI interface, it is registered in the ACE scoreboard. All other masters are then expected to receive the ACE request. If one of them responds with the shared data, the AXI response is checked by the scoreboard against this ACE response. If not, the ACE scoreboard passes the AXI transaction to the appropriate slave for a check at the memory interface.
This ACE scoreboard mechanism therefore checks the adequacy of the response to the initiating master in regards to the communication to the other coherent masters. Because the ACE response is dependent on the cache state, this mechanism accordingly relies on the fact that the ACE response is accurate and that cache states are verified.
There are several options to complete the cache coherency verification picture:
- The cache itself can be modeled so that the cache state is known. This requires monitoring the CPU interface and having a transaction-accurate cache model (see Figure 6).
- The cache state can also be retrieved by snooping both the CPU and the cache master interfaces. A cache scoreboard can then analyze read and write data and determine if a data address is dirty. Assuming the cache itself is verified by other means, this could be a viable solution to check the coherency interaction (Figure 7).
The NoC Scoreboard VIP
The NoC scoreboard VIP that has been developed attempts to provide:
- Adapters to any bus VIP monitors allowing the use of any bus protocols
- Multiple address maps
- Easy configuration of address segments and routes allowing any kind of topology
- On-the-fly reconfiguration
- End-to-end transaction checking, including user attributes and response code
- ACE-Lite and ACE communication
- Connectors to cache models or cache scoreboards
- User hooks for additional checks, such as QoS analysis
- Functional coverage The scoreboard has been built using UVM 1.1a classes and relies on the UVM factory to enable user defined features.
The integration task requires:
- Instantiating the scoreboard as an additional UVM component in your environment
- Configuring the address map and paths
- Linking the scoreboard adapters to the appropriate monitors
- Optionally linking the NoC scoreboard to a cache model An example of the testbench scoreboard configuration.
// instantiate the scoreboard
scbd0 = noc_scbd::type_id::create("scbd0",this);
// create two address domains
// address domain 0 configuration
scbd0.add_address_segment("CPU0","","RAM", 'h0000_0000 , 'h2000000 , BUS);
scbd0.add_address_segment("CPU0","","UART", 'h9000_0000 , 'hFFFF , BUS);
scbd0.add_address_segment("CPU0","","ID0", 'hFFFF_FFF0 , 1 , BUS);
// address domain 1 configuration
scbd0.add_address_segment("CPU1","","RAM", 'h0000_0000 , 'h2000000 , BUS);
scbd0.add_master("CPU0_data" , "CPU0");
scbd0.add_path("CPU0_data" , "ROM");
scbd0.add_path("CPU0_data" , "RAM");
scbd0.add_path("CPU0_data" , "UART");
noc_scbd_axi_adapter CPU0_instr_adapter ;
// connect monitors to scoreboard adapters
Verifying a system interconnect goes far beyond data checking. While a typical UVM tutorial explains scoreboard mechanisms within a few lines, building a NoC scoreboard requires incorporating many more features. The generic NoC scoreboard allows a quick integration with any protocols and interconnect architectures and provides support for advanced and user defined virtual address space, power management, security features and cache coherency.
Back to Top