Chip system-level verification system based on python language

Through a chip system-level verification system based on Python language, the traditional chip system-level verification process is simplified, efficiency is improved and costs are reduced, the problems of complex and cost of traditional methods are solved, and an automated verification process is realized.

CN119026561AActive Publication Date: 2024-11-26成都融见软件科技有限公司 +1

Patent Information

Application Number
CN202310597930.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-25
Publication Date
2024-11-26
Estimated Expiration
2043-05-25

AI Technical Summary

Technical Problem

Traditional chip system-level verification methods are difficult, complex, low-efficiency and high-cost, and require the coordinated cooperation of multiple professionals.

Method used

Adopt a chip system-level verification system based on Python language, build a verification process through preset Python scripts, set up the master and slave devices, generate the Python script main thread and verification platform simulation thread, and realize the simplification of the chip system-level verification process and automation.

Benefits of technology

The chip system-level verification process is simplified, verification efficiency is improved, verification costs are reduced, and the automation of the simulation platform's success and failure judgment is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026561A_ABST
    Figure CN119026561A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of chip verification, in particular to a python language-based chip system-level verification system, which comprises a preset python script arranged in a first verification module and a tested design arranged in a second verification module, a preset python script sets the first verification module as a master device side and sets the second verification module as a slave device side; the first verification module generates a python script main thread, a verification platform simulation thread starting instruction is sent to the second verification module, a verification platform simulation thread is started, and connection between the python script main thread and the verification platform simulation thread is established; the python script main thread controls the first verification module to send a verification request instruction to the second verification module, and the verification platform simulation thread controls the second verification module to process the verification request instruction. According to the invention, the system-level verification process of the chip is simplified, the verification efficiency is improved, and the verification cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of chip verification, and in particular to a chip system-level verification system based on Python language. Background Art

[0002] Chip system-level verification refers to the verification of the coordination and cooperation between the design under test (DUT) and the software. When using traditional technology to perform chip system-level verification, it is necessary to attach the IP (Intellectual Property) or model of a specific CPU, write related software, and compile it using a compiler that supports a specific instruction set. In this traditional process, hardware design engineers, model development engineers, and driver software engineers need to work together to complete it. For some special protocols, specific stimulus modules or models need to be written. It can be seen that the traditional chip system-level verification method is difficult, the verification process is complicated, the verification efficiency is low, and the personnel investment cost is high. It can be seen that how to simplify the chip system-level verification process, improve the chip system-level verification efficiency, and reduce the verification cost has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The purpose of the present invention is to provide a chip system-level verification system based on Python language, which simplifies the chip system-level verification process, improves the chip system-level verification efficiency, and reduces the chip system-level verification cost.

[0004] According to one aspect of the present invention, a chip system-level verification system based on Python language is provided, comprising: a first verification module and a second verification module, wherein the first verification module comprises a preset Python script, and the second verification module comprises a design under test.

[0005] The preset python script includes a verification process, in which the first verification module is set as a master device and the second verification module is set as a slave device.

[0006] The first verification module is used to generate a python script main thread in the first verification module based on the preset python script, and the python script main thread sends an instruction to start a verification platform simulation thread to the second verification module, starts the verification platform simulation thread in the second verification module, and establishes a connection between the python script main thread and the verification platform simulation thread, thereby establishing a connection between the first verification module and the second verification module.

[0007] The python script main thread controls the first verification module to send a verification request instruction to the second verification module based on a preset python script, and the verification platform simulation thread controls the second verification module to process the verification request instruction.

[0008] Compared with the prior art, the present invention has obvious advantages and beneficial effects. By means of the above technical solution, the chip system-level verification system based on Python language provided by the present invention can achieve considerable technical advancement and practicality, and has wide industrial utilization value, and has at least the following beneficial effects:

[0009] The system of the present invention constructs a verification process based on a python script, sets a preset python script side as a master device side, sets a device to be tested side as a slave device side, simulates host behavior based on a preset python script, and implements a chip system-level verification process based on the verification process in the preset python script, thereby simplifying the chip system-level verification process, improving the chip system-level verification efficiency, and reducing the chip system-level verification cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0011] Figure 1 A schematic diagram of a chip system-level verification system based on Python language provided by an embodiment of the present invention;

[0012] Figure 2 A schematic diagram of the flow of communication between a Python script main thread and a verification platform simulation thread provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0013] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0014] The embodiment of the present invention provides a chip system-level verification system based on Python language, such as Figure 1As shown, it includes: a first verification module and a second verification module, wherein the first verification module includes a preset python script, and the second verification module includes a design under test. The preset python script includes a verification process, in which the first verification module is set as a master device and the second verification module is set as a slave device.

[0015] The first verification module is used to generate a python script main thread in the first verification module based on the preset python script, and the python script main thread sends a start verification platform simulation thread instruction to the second verification module, starts the verification platform simulation thread in the second verification module, and establishes a connection between the python script main thread and the verification platform simulation thread, thereby establishing a connection between the first verification module and the second verification module. The python script main thread controls the first verification module to send a verification request instruction to the second verification module based on the preset python script, and the verification platform simulation thread controls the second verification module to process the verification request instruction. The process of communication between the python script main thread and the verification platform simulation thread is as follows: Figure 2 As shown, the verification request instruction includes an interrupt request instruction and / or a read / write register request instruction.

[0016] It should be noted that the prior art usually needs to obtain a log file to determine whether the simulation platform has successfully completed the simulation. In the present application, the simulation platform is capable of automatically determining the success and failure of the simulation. As an embodiment, if all the verification processes in the preset python script are processed, the main thread of the python script calls the preset simulation end function to send a verification success instruction to the second verification module, and the second verification module ends the simulation based on the verification success instruction, and sets the verification flag to the verification success flag. If a verification failure occurs during the execution of the verification process of the preset python script, the main thread of the python script calls the preset simulation end function to send a verification failure instruction to the second verification module, and the second verification module ends the simulation based on the verification failure instruction, and sets the verification flag to the verification failure flag.

[0017] As an embodiment, the first verification module further includes a first verification control unit and a second verification control unit, wherein the first verification control unit is implemented based on Python, and the second verification control unit is implemented based on C++. It can be understood that Python and C++ are both existing programming languages, which will not be described in detail here. The main thread of the Python script controls the first verification control unit to obtain instruction parameters from the preset Python script, and generates a verification request instruction through the interaction between the first verification control unit and the second verification control unit, and sends the verification request instruction to the second verification module through the second verification control unit.

[0018] As an embodiment, the second verification control unit includes a C++ function, the C++ function includes an application programming interface (Application Programming Interface, referred to as API) function generated based on C++, and the first verification control unit encapsulates the C++ function into a python function through C++ and python mixed programming, so as to realize the interaction between the first verification control unit and the second verification control unit. Wherein, the first verification module includes a mixed programming library, and the first verification control unit implements C++ and python mixed programming based on the mixed programming library, and the mixed programming library is developed and generated based on ctypes or python native C++ library. Wherein, ctypes is an external function library of Python, which provides data types compatible with C language, and allows calling functions in dynamic link library files (Dynamic Link Library, referred to as DLL) or shared libraries, and ctypes can be used to encapsulate these libraries in pure Python form. Python native C++ library is also an existing library, which will not be repeated here.

[0019] As an embodiment, the python script main thread generates M master device channels in the first verification module based on a preset python script, and the M master device channels include a master device interrupt service channel and (M-1) master device read and write service channels. It should be noted that the first verification module generates an interrupt to a device in the DUT based on a master device interrupt service channel. The preset python script can simulate multiple master devices, each of which corresponds to a master device channel, for simulating multiple master devices sending stimuli to the DUT.

[0020] The slave device side will also set a corresponding number of slave device channels, and the number of master device channels is determined based on the number of slave device channels corresponding to the device under test. As an embodiment, the verification platform simulation thread is used to generate M slave device channels in the second verification module, and the M slave device channels include a slave device interrupt service channel and (M-1) slave device read and write service channels. The master device interrupt service channel corresponds to the slave device interrupt service channel, and each master device read and write service channel corresponds to a slave device read and write service channel.

[0021] At the end of the simulation, all channels of the master device and the slave device need to be closed. As an embodiment, when the main thread of the python script calls the preset simulation end function to send a verification success instruction or a verification failure instruction to the second verification module, a channel closing instruction is also sent to the M master device channels to close the M master device channels; after the second verification module receives the verification success instruction or the verification failure instruction, it closes the M slave device channels. After the master device channel and the slave device channel are closed, the connection between the first verification module and the second verification module is disconnected, and the chip system verification ends.

[0022] like Figure 1 In the example shown, the second verification module also includes a verification model, and the system establishes a connection between the main thread of the python script and the verification platform simulation thread by establishing a connection between the second verification control unit and the verification model. The second verification control unit communicates with the verification model through a communication interface such as TCP / IP, wherein TCP / IP is an existing communication method and is not described here. The verification platform simulation thread controls the verification model to receive the verification request instruction sent by the second verification control unit and forward it to the design under test. It should be noted that the verification model is usually written and generated based on SystemC and / or C++ language, and the second verification control unit includes a C++ function that can directly communicate with the verification model. The second verification control unit and the first verification control unit communicate based on a hybrid programming library, thereby enabling the verification model to communicate indirectly with the first verification control unit.

[0023] In the embodiment of the present invention, a preset python script can be used to initiate stimulus transmission to the design under test and initiate an interrupt simulation test. The stimulus transmission may specifically include data transmission and register read and write operations.

[0024] As an embodiment, the verification request instruction includes an interrupt request instruction and / or a read / write register request instruction, the interrupt request instruction includes an interrupt number and a slave device interrupt service channel, the read request instruction includes a slave device read / write service channel identifier and a target read address, the write request instruction includes a slave device read / write service channel identifier, a target write address and a target write data, the verification model forwards the interrupt request instruction to the design under test through the slave device interrupt service channel, and the verification model forwards the verification request instruction to the design under test through the corresponding slave device channel based on the slave device read / write service channel identifier.

[0025] As an embodiment, the design under test includes a preset interrupt service function and a read-write service function, and the design under test calls the corresponding interrupt service function or the read-write service function based on the verification request instruction to process the verification request instruction.

[0026] Specifically, for an interrupt request, the design under test obtains a corresponding interrupt number based on the received interrupt request, and then calls a corresponding interrupt service function based on the interrupt number to perform an interrupt operation.

[0027] For the read register request instruction, the design under test parses the received read register request instruction to obtain the slave device read / write service channel identifier and the target read address, then reads data from the corresponding target read address through the corresponding slave device channel, and replies to the first verification module.

[0028] For the write register request instruction, the design under test parses the received write register request instruction to obtain the slave device read / write service channel identifier, target write address and target write data, and then writes the target write data to the target write address through the corresponding slave device channel. After the write is successful, the design under test replies to the first verification module to confirm the write success information.

[0029] The design under test can be a design generated based on RTL, or a design model generated based on SystemC. If the design under test is a design generated based on SystemC, the verification model communicates with the design under test through a SystemC interface or a transaction level modeling (TLM) interface. If the design under test is a design model generated based on RTL, the verification model communicates with the design under test through a direct programming language interface (DPI) or a device-kernel interface (DKI). It should be noted that the SystemC interface, TLM interface, DPI interface and DKI interface are all existing communication interfaces and will not be described in detail here.

[0030] The system of the present invention can quickly build a system-level test stimulus with a complexity comparable to that of a driver program based on a python script, and can use the python language to expand the complexity of the stimulus, such as building data packets of various high-speed bus interface protocols to communicate with the DUT.

[0031] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of the technical solution of the present invention.

Claims

1. A chip system-level verification system based on Python language, characterized in that: include: A first verification module and a second verification module, wherein the first verification module includes a preset python script, and the second verification module includes a design under test; The preset python script includes a verification process, in which the first verification module is set as a master device and the second verification module is set as a slave device; The first verification module is used to generate a python script main thread in the first verification module based on the preset python script, the python script main thread sends a start verification platform simulation thread instruction to the second verification module, starts the verification platform simulation thread in the second verification module, and establishes a connection between the python script main thread and the verification platform simulation thread, thereby establishing a connection between the first verification module and the second verification module; The python script main thread controls the first verification module to send a verification request instruction to the second verification module based on a preset python script, and the verification platform simulation thread controls the second verification module to process the verification request instruction.

2. The system according to claim 1, It is characterized in that If all verification processes in the preset Python script are completed, the Python script main thread calls the preset simulation end function to send a verification success instruction to the second verification module, and the second verification module ends the simulation based on the verification success instruction and sets the verification flag to the verification success flag; If verification failure occurs during the verification process of executing the preset python script, the python script main thread calls the preset simulation end function to send a verification failure instruction to the second verification module. The second verification module ends the simulation based on the verification failure instruction and sets the verification flag to the verification failure flag.

3. The system according to claim 1, It is characterized in that The first verification module further includes a first verification control unit and a second verification control unit, wherein the first verification control unit is implemented based on Python, and the second verification control unit is implemented based on C++; The python script main thread controls the first verification control unit to obtain instruction parameters from the preset python script, and generates a verification request instruction through the interaction between the first verification control unit and the second verification control unit, and sends the verification request instruction to the second verification module through the second verification control unit.

4. The system according to claim 3, It is characterized in that The second verification control unit includes a C++ function, and the first verification control unit encapsulates the C++ function into a python function through C++ and python mixed programming to achieve interaction between the first verification control unit and the second verification control unit.

5. The system according to claim 4, It is characterized in that The first verification module includes a hybrid programming library, and the first verification control unit implements C++ and python hybrid programming based on the hybrid programming library, and the hybrid programming library is developed and generated based on ctypes or python native C++ library.

6. The system according to claim 1, It is characterized in that The second verification module also includes a verification model. The system establishes a connection between the python script main thread and the verification platform simulation thread by establishing a connection between the second verification control unit and the verification model. The verification platform simulation thread controls the verification model to receive the verification request instruction sent by the second verification control unit and forward it to the design under test.

7. The system according to claim 6, It is characterized in that The second verification control unit communicates with the verification model via a TCP / IP communication interface.

8. The system according to claim 1, It is characterized in that If the design under test is a design generated based on RTL, the verification model communicates with the design under test via a DPI interface or a DKI interface; If the design under test is a design model generated based on SystemC, the verification model communicates with the design under test through a SystemC interface or a TLM interface.

Citation Information

Patent Citations

  • System and method for verifying SOC chip

    CN110865971A

  • SOC chip system-level verification system and method

    CN115828839A

  • Method and system for deterministic control of an emulation

    US20030225560A1

  • Software integration into hardware verification

    US20200272701A1

  • System-level verification method and system of chip and related apparatus

    WO2022148305A1

Cited By

  • Chip system-level verification system

    CN119026562A

  • Chip system-level verification system

    CN119026562B

  • Chip verification platform calling method and device, electronic equipment and storage medium

    CN119862829A