Unlock instant, AI-driven research and patent intelligence for your innovation.

Method and system for verifying debug function of RISCV architecture

A function verification and function technology, applied in the CPU field, can solve complex problems and achieve the effect of simple positioning problems, short verification cycle and wide coverage

Pending Publication Date: 2022-03-18
GUANGDONG STARFIVE TECH LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The whole process is complex and layered

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and system for verifying debug function of RISCV architecture
  • Method and system for verifying debug function of RISCV architecture
  • Method and system for verifying debug function of RISCV architecture

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0056] This embodiment provides a RISCV architecture debug function verification method, including the following steps:

[0057] S1 initialization, use the simulation tool to compile Testbench, and generate the simulation execution file;

[0058] S2 uses RISCV Toolchain to compile the CPU testcase and convert it into a hex file for Testbench to load on the DUT CPU;

[0059] S3 uses host toolchain to compile c model and model test to get .so dynamic library;

[0060] S4 runs the simulation execution file, and passes the hex file and so library file through parameters to realize the simulation execution file loading;

[0061] Finally, S5 completed the verification of the Debug function of the RISCV architecture through model test and DUT CPU test.

[0062] In this embodiment, the debug verification method in the riscv-tests toolkit is used in the prior art. It is a complete verification method combined with gdb, openocd, testbench, and DUT (Design Under Test). This method is...

Embodiment 2

[0066] In terms of specific implementation, this embodiment provides an implementation of JTAG Driver. JTAGDriver is defined as a system Verilog module, the input is clock, reset, jtag_TDI; the output is jtag_TCK, jtag_TMS, jtag_TDI, jtag_TRSTn. Declare the dpi function jtag_plugin_tick inside the module, and call the jtag_plugin_tick function when each jtagclock clock cycle arrives. The implementation of this function is in the JTAG Model of c modeldomain.

[0067] This embodiment also provides an implementation of the C model. It can be seen from the implementation of the JTAG Driver that each jtagclock will call the jtag_plugin_tick function once, and the jtag_plugin_tick function is called actively by the JTAG Driver end and passively executed by the C model end. From the whole design, it is hoped that the c model will actively execute and control the JTAG Driver through jtag. Therefore, the JTAG Model of the C model is designed as a multi-threaded program.

Embodiment 3

[0069] On the basis of embodiment 2, with reference to image 3 As shown, this embodiment provides a flow of the main thread function jtag_plugin_tick function, specifically as follows:

[0070] The Jtag_plugin_tick function comes in to first judge whether g_thread is null. If it is null, it means that it is called for the first time, and creates sem_wr and sem_rd semaphores for inter-thread synchronization, and then calls pthread_create to create g_thread sub-threads. If g_thread is not null, it means that child threads have been created.

[0071] Then judge whether the end flag is 1. If the end flag is 1, it means that the model test thinks that the use case can be ended. At this time, test_finish is called to end the simulation. Continue if the end flag is 0.

[0072] Waiting for the sem_wr semaphore, that is, waiting for the child thread to prepare the data that jtag needs to happen. This function will wait until the child thread has data to be generated before returnin...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to the technical field of CPUs, in particular to an RISCV architecture debug function verification method and system.The RISCV architecture debug function verification method comprises the steps that a simulation tool is used for compiling Testbench, and a simulation execution file is generated; the RISCV Toolchain is used for compiling the CPU test case, and the CPU test case is converted into a hex file, and the hex file is used for being loaded to the DUT CPU by the Testbench; the c model and the model test are compiled by using host toolchain, and a. So dynamic library is obtained; running the simulation execution file, and transmitting the hex file and the so library file through parameters to realize loading of the simulation execution file; and the verification of the Debug function of the RISCV architecture is completed through the cooperation of the model test and the DUT CPU test. The method is flexible, and verification personnel can customize cases according to own requirements. The method has the advantages of short simulation time, simple debugging, simple positioning problem, short verification period and rapid convergence. And the case or the model is modified, and the DUT and the Testbench do not need to be recompiled.

Description

technical field [0001] The invention relates to the technical field of CPUs, in particular to a method and system for verifying a debug function of a RISCV architecture. Background technique [0002] Riscv architecture debug function is, such as figure 1 As shown, the user sends a message to the openocd software through the gdb software on the Host host, and the openocd software sends the message specified by the RISCV architecture to the DUT CPU through the JTAG cable, so as to achieve the purpose of controlling the DUT CPU through the Host host. [0003] For the Debug function verification under the RISCV architecture, the Host and the DUT CPU work together. Although the Host is the main control end, the DUT CPU also needs to participate. Therefore, for traditional verification methods, only making Host use cases or DUTCPU use cases cannot achieve the purpose of verifying the debug function under the RISCV architecture. [0004] In addition, since the process from Host t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F11/22G06F11/26
CPCG06F11/2247G06F11/26
Inventor 郑丰翔蔡元婧张炜余红斌
Owner GUANGDONG STARFIVE TECH LTD