|
||||||||||
Trace Based Approach for Unit Level Debug and Verification of C/C++ IP ModelsBy Amit Nene, Texas Instruments Abstract: Amongst various pre-silicon solutions, Software Simulation Platforms have always been the preferred environment due to early availability, ease of use, ease of access, lower cost as compared to FPGAs and higher speeds as compared to RTL simulators. We at Texas instruments leverage Pre-silicon software platforms for software benchmarking, architecture analysis, SOC validation as well as software development to meet time-to-market goals. These software platforms are mostly bit accurate, functionally accurate and even timing approximate, in some cases, compared to their hardware counterparts. These System On Chip platform simulators are developed by integrating C/C++ based IP models that are essentially the software variants of the hardware IP blocks like CPUs, Caches, Interrupt controllers, DMA’s, Hardware Accelerators, External Memory interface and Serial Peripherals. The functional and cycle accuracy of the software platform integration as well as that of individual IP models is critical for usefulness of these software platforms at an early stage of any chip program. The IP models are usually hand-coded in C/C++ or in SystemC (which is a C++ library), or developed by leveraging ESL tools that generate C/C++ / systemC and further tested using directed tests in a standalone unit test bench. These C/C++ models work at higher abstraction levels and have different interfaces when compared to RTL. Test vectors coming from dedicated Design Verification teams for RTL IP’s are not leveraged by the C/C++ IP models. Test vectors coming from different platforms in which this IP exists are not leveraged for unit testing of C/C++ IP models. Due to the limited coverage, each bug found in the platform simulator reduces the window of opportunity available to the software teams to leverage the pre-silicon solution. Further the time taken to fix a bug also depends on the simulation environment and the availability of applications from customers. Even, after, the SW is fully ready on the simulator, RTL – C model equivalence reports are required to increase the confidence, that the software will run as is during the silicon bring-up phases. Though ESL bodies & EDA tool vendors are trying to bridge the gaps by defining & leveraging standards for bus infrastructure and modeling like SystemC, SCV & TLM2, the current verification approach for a C/C++ IP model remains weak. This paper discusses a “Standalone” verification framework that is independent of any specific flow but still allows reuse of Design Verification & Application tests to measure & debug the Cycle Accuracy as well as Functional Accuracy of an IP. As an additional benefit, the component validation speed and turn-around time to fix bugs is improved since the full system simulation environment is not required. The framework constitutes a standard test bench, a VCD (Value Change Dump) file reader with a signal database, the mirror interface of C++ model and the C++ model (also termed as a DUT or “Design under Test”). This setup is generic and can be used for any C++ IP model. The DUT is connected to the test-bench via bus and signal interfaces. The test-bench uses a VCD Reader to read vcd files and stores necessary information (data and timing of signals/buses) in signal database. This information is used to drive the data/signals into the input interfaces of the C++ model or to compare the expected data with the data/signals received from the output interfaces of the C++ model. A log file is created for each VCD file which contains the pass/fail results for each test step, corresponding to data and the timing of each signal. Thus, the framework can be used as a setup for Functional verification as well as Cycle accuracy verification of C++ IP models. 1. INTRODUCTION Design & Verification flows for RTL and C/C++ models are typically different as the same model needs to be available in different flavors for architecture analysis (before specifications are defined) or software development (before micro-architecture specifications are defined) or for benchmarking (before cycle Accuracy is known). Though ESL & EDA tools try to bridge this gap by defining a “design by refinement” flow, it does not ensure equivalence of these models. Typically, the RTL developers are not the same as the C++ model developers. SystemC, which is based on C++ is the most popular language to write models. This cannot be used for refinement to RTL easily, as all constructs or semantics are not synthesizable. As performance or speed of these models is one of the most critical reasons for using early software SOC simulators, there is very less code reuse between the C model and the RTL. Each IP model gets integrated in highly complex SOCs containing multi-core or multi-board simulators. Further, these simulators are modeled using home-grown tools or several 3’rd party tools and this environment is very difficult to replicate & use for IP level debugging, as the purpose of this environment is to debug software. Most of the times, the environment is used by external customers, who refuse to share their applications for fixing bugs in the IP models or IP integrations. Problems faced by C++ IP model developers include:
The scale of the problem becomes larger for different configurations of a C++ IP model used in multiple platforms and the need to run all tests on all simulation platforms for every fix or feature. The IP developer needs to know these platforms as well as environments. 2. OBJECTIVES
The objective is to provide a C++ IP model verification methodology, equivalence with RTL and an isolated environment with a single trace based solution. 3. PRIOR WORK C++ IP models are developed for early pre-silicon activities. The current verification approaches used are not very robust and have lots of gaps. There is no exhaustive test coverage carried out on these models compared to RTL. These models need to be pre-tested before they get used by software developers for development and benchmarking of applications. The IP test coverage and equivalence is essential even for post-silicon usage of simulators Functional Accuracy was verified by:
Cycle Accuracy was verified by:
The existing solutions are clearly not enough for qualifying these simulators. 4. PROPOSED SOLUTION
Test cases are reused from various sources as traces:
Traces are played back on the C++ IP model:
Steps used by test bench to run the tests:
The test bench is designed to be generic & contains infrastructure components that are common to any IP and interface components that are specific to each IP. Each interface component can be further converted to an infrastructure component based on the standardization of the interface. The interface components can also be generated from an IPXACT flow. Description of each block in the framework is explained in the table below: For each test case, we will use the following flow:-
Each test case (VCD) is broken into various test steps, where each test step is a transaction from request to a response on the bus. Each transaction corresponds to signals. For each signal, the response (either logic or data bus) is compared between DUT and RTL. If the response differs, the result for the test step is logged as a FAILED Otherwise the result for the test step is logged as PASSED The model is reported to be functionally accurate, if all individual test steps have PASSED. The model developer can debug based on the first test step that has FAILED
Total number of cycles taken by RTL model r = ∑ Ri, where Ri = number of cycles taken by RTL in ith transaction. Deviation of DUT, d = ∑ absolute (Di – Ri), where, Di = Number of cycles taken by DUT in ith transaction % Cycle accuracy of the IP model is reported as [100 – d*100 / r] The model developer can debug based on the first CA deviation that has been reported.
For a particular Communication Infrastructure Chip, we had existing test vectors at the platform level for both the RTL as well as the simulator. The goal was to achieve upto 95% Cycle accuracy for the most critical path constituting a proprietary memory subsystem, interconnect & DDR2. We were facing difficulty in fine-tuning the cycle accuracy of each of the IPs in the critical path. We used the trace based verification approach separately for each IP by directly using the traces from RTL and fixing functional & cycle accuracy gaps in IPs w/o having to worry how the fix in one IP will affect the cycle accuracy at the platform level. The unit test bench provides us the true picture of the Cycle Accuracy for a C++ IP model.
There is a risk of being biased with platform level results, as a small tweak in the configuration of the IP models can lead to different results The time taken to get the results in the IP level test bench is faster compared to running the test on the platform simulator as that involves all other IPs as well. The IP Functional & Cycle Accuracy gaps can be fixed independently by directly procuring the RTL VCD trace files and can be reported independently as well. 6. CONCLUSIONS
7. LIMITATIONS Currently, CPU blocks cannot be tested with this framework. 8. FUTHER WORK The framework will be aligned with OSCI SystemC, TLM2 standards 9. REFERENCES Value Change Dump format ( IEEE 1364-1995)
|
Home | Feedback | Register | Site Map |
All material on this site Copyright © 2017 Design And Reuse S.A. All rights reserved. |