Bit stream simulation method and device, computer storage medium and terminal
By extracting and matching the functional configuration information in the FPGA hardware netlist, converting it into Verilog hardware netlist files and conducting simulations, the problem of long FPGA bit stream simulation time is solved and development efficiency is improved.
Patent Information
- Application Number
- CN202410780774.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-08
AI Technical Summary
When the size of the hardware circuit netlist file of the existing FPGA bit stream simulation system increases, the simulation time increases significantly, resulting in reduced development efficiency and increased R&D time costs.
Extract the functional configuration information in the FPGA hardware netlist, match the address and data in the bitstream file of the test case, convert it into a Verilog hardware netlist file, compile the simulation dependency library and hardware netlist file to generate an operating system executable simulation program , parse the test stimulus file and call the simulation program to perform bit stream simulation.
It reduces the scale and simulation time of bit stream simulation, improves the efficiency of FPGA development, and avoids the problem of long simulation system time due to the expansion of the scale of the hardware circuit netlist.
Smart Images

Figure CN118747487A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, field programmable gate array technology, and particularly to a method, device, computer storage medium, and terminal for bitstream simulation. Background Art
[0002] The simulation process of the Field Programmable Gate Array (FPGA) development tool mainly includes functional simulation (pre-simulation) and bitstream simulation (post-simulation); among them, the FPGA bitstream simulation system is a hardware circuit functional analysis and verification tool, which aims to assist FPGA developers in verifying whether the design obtains the ideal output signal according to the given input signal in the FPGA chip after layout and routing. The principle of the FPGA bitstream simulation system is to first map the hardware circuit to the executable program of the operating system, and then give the input according to the test stimulus file, and pass the input signal to the output port or the specified module in sequence through the path after layout and routing inside the FPGA; generally, the FPGA bitstream simulation system includes two processes: compilation and simulation.
[0003] In the FPGA bitstream simulation system in the related art, the compilation process needs to compile the complete FPGA hardware circuit netlist file, and the simulation time mainly depends on the size of the FPGA hardware circuit netlist file. Generally, the logic of the simulation case is usually relatively simple, but regardless of the size of the simulation case, the bitstream simulation process must compile the complete FPGA hardware circuit netlist file. Figure 1 It is a flowchart of the bitstream simulation in the related technology, such as Figure 1 As shown in the figure, in the compilation stage, the FPGA hardware circuit netlist, FPGA bitstream file, simulation dependent library file and other files are compiled to generate a simulation program executable by the operating system, and then the test stimulus file is input for simulation; as the size of the FPGA hardware circuit netlist file increases, the time for FPGA bitstream simulation also increases accordingly. When FPGA developers need to repeatedly modify circuits or configuration information and perform simulation verification multiple times, the above simulation method reduces the efficiency of FPGA development and increases the time cost of R&D.
[0004] In summary, how to reduce the FPGA bitstream simulation time and improve the FPGA development efficiency has become a problem to be solved. Summary of the invention
[0005] The following is a summary of the subject matter described in detail in this application. This summary is not intended to limit the scope of the claims.
[0006] The embodiments of the present disclosure provide a method, device, computer storage medium and terminal for bitstream simulation, which can reduce the duration of FPGA bitstream simulation and improve the development efficiency of FPGA.
[0007] The present disclosure provides a method for bitstream simulation, including:
[0008] Extract configuration information of all functions contained in the field programmable gate array FPGA from the hardware netlist of the FPGA, the configuration information including the following information of the function: name, address and data;
[0009] Matching the addresses and data contained in the bitstream file of the predetermined test case with the addresses and data in the extracted configuration information of all functions to determine the functions involved in the test case;
[0010] Determine the names and data of the functions involved in the test case based on the extracted configuration information of all functions;
[0011] According to the names and data of the functions involved in the determined test cases, the test cases are converted into register transfer level RTL files containing only addresses and data corresponding to the test cases, so as to obtain a Verilog hardware netlist file corresponding to the test cases;
[0012] Compile the simulation dependent library files and the obtained Verilog hardware netlist files to generate a simulation program executable by the operating system;
[0013] Parsing the test stimulus file into an input format recognizable by the simulation program to obtain a test stimulus file recognizable by the simulation program;
[0014] The executable simulation program is called through the obtained test stimulus file that can be recognized by the simulation program to perform bit stream simulation.
[0015] On the other hand, an embodiment of the present disclosure further provides a computer storage medium, in which a computer program is stored. When the computer program is executed by a processor, the above-mentioned bit stream simulation method is implemented.
[0016] In another aspect, an embodiment of the present disclosure further provides a terminal, comprising: a memory and a processor, wherein the memory stores a computer program; wherein:
[0017] The processor is configured to execute the computer program in the memory;
[0018] When the computer program is executed by the processor, the method for bit stream simulation as described above is implemented.
[0019] In another aspect, the embodiment of the present disclosure further provides a bitstream simulation device, comprising: an extraction unit, a matching unit, a determination unit, a conversion unit, a compilation unit, a parsing unit and a simulation unit; wherein,
[0020] The extraction unit is configured to: extract configuration information of all functions included in the field programmable gate array FPGA from a hardware netlist of the FPGA, the configuration information including the following information of the function: name, address and data;
[0021] The matching unit is configured to: match the addresses and data contained in the bit stream file of the predetermined test case with the addresses and data in the extracted configuration information of all functions to determine the functions involved in the test case;
[0022] The determination unit is set to: determine the names and data of functions involved in the test case according to the extracted configuration information of all functions;
[0023] The conversion unit is set to: according to the names and data of the functions involved in the determined test case, convert the test case into a register transfer level RTL file containing only the address and data corresponding to the test case, so as to obtain a Verilog hardware netlist file corresponding to the test case;
[0024] The compilation unit is set to: compile the simulation dependent library file and the obtained Verilog hardware netlist file to generate a simulation program executable by the operating system;
[0025] The parsing unit is configured to: parse the test stimulus file into an input format recognizable by the simulation program, and obtain the test stimulus file recognizable by the simulation program;
[0026] The simulation unit is configured to call an executable simulation program through a test stimulus file that can be identified by the obtained simulation program to perform bit stream simulation.
[0027] The disclosed embodiment obtains the Verilog hardware netlist file corresponding to the test case based on the bitstream file and the configuration information of all functions, and performs bitstream simulation based on the Verilog hardware netlist file, thereby reducing the scale and simulation time of the bitstream simulation and improving the development efficiency of the FPGA.
[0028] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0030] Figure 1 It is a flowchart of the bit flow simulation in the related art;
[0031] Figure 2 A flowchart of a method for bitstream simulation according to an embodiment of the present disclosure;
[0032] Figure 3 A schematic diagram of the process of bitstream simulation according to an embodiment of the present disclosure;
[0033] Figure 4 The present invention is a structural block diagram of a device for bitstream simulation according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0035] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0036] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.
[0037] Figure 2Flow chart of the method for bitstream simulation according to an embodiment of the present disclosure, as shown in FIG. Figure 1 As shown, including:
[0038] Step 201: extracting configuration information of all functions included in a field programmable gate array (FPGA) from a FPGA hardware netlist;
[0039] In an exemplary embodiment, the configuration information in the embodiment of the present disclosure includes: name, address and data; the embodiment of the present disclosure can extract the configuration information of all functions from the FPGA hardware netlist according to the function configuration document;
[0040] In an exemplary embodiment, all functions included in the above-mentioned functional FPGA in the embodiment of the present disclosure may be functions included inside the FPGA. The above-mentioned functions in the embodiment of the present disclosure may include: routing, flip-flops (DFFs), look-up tables (LUTs), digital signal processors (DSPs), and memories, etc.
[0041] Step 202: Match the addresses and data contained in the bitstream file of the predetermined test case with the addresses and data in the extracted configuration information of all functions to determine the functions involved in the test case;
[0042] Step 203: Determine the names and data of the functions involved in the test case based on the extracted configuration information of all functions;
[0043] Step 204: according to the names and data of the functions involved in the determined test case, convert the test case into a register transfer level (RTL) file containing only the addresses and data corresponding to the test case, so as to obtain a Verilog hardware netlist file corresponding to the test case;
[0044] The Verilog hardware netlist file in the disclosed embodiment is a simplified netlist file with a reduced size; Verilog is a hardware description language. After being compiled and downloaded to the FPGA, the FPGA will generate a circuit, and all Verilog is processed and run in parallel.
[0045] In an exemplary embodiment, the bitstream file in the embodiment of the present disclosure may include:
[0046] The bitstream file generated when the FPGA internal layout and routing is performed through test cases and the input signal is passed to the output port or specified module in sequence through the path after layout and routing.
[0047] Step 205, compile the simulation dependency library file and the obtained Verilog hardware netlist file to generate a simulation program executable by the operating system;
[0048] Step 206: Parse the test stimulus file into an input format recognizable by the simulation program to obtain a test stimulus file recognizable by the simulation program;
[0049] Step 207: Call the executable simulation program through the obtained test stimulus file that can be recognized by the simulation program to perform bit stream simulation.
[0050] The disclosed embodiment avoids the problem of a long simulation system time-consuming when the simulation verification is performed multiple times due to the expansion of the scale of the FPGA hardware circuit netlist, repeated modifications of the circuit or configuration information, and multiple simulation verifications. Based on the bitstream file and the configuration information of all functions, the Verilog hardware netlist file corresponding to the test case is obtained, and the bitstream simulation is performed based on the Verilog hardware netlist file, which reduces the scale and simulation time of the bitstream simulation and improves the development efficiency of the FPGA.
[0051] In an exemplary embodiment, before compiling the simulation dependent library file and the obtained Verilog hardware netlist file, the method of the embodiment of the present disclosure further includes:
[0052] Preprocess the Verilog hardware netlist file;
[0053] The preprocessing includes: analyzing and processing grammatical errors and / or semantic errors.
[0054] In an exemplary embodiment, when the executable simulation program is called by the obtained test stimulus file identifiable by the simulation program and the bitstream simulation is performed, the method of the embodiment of the present disclosure further includes:
[0055] Generates simulation output files for bitstream simulation that are recognizable by waveform display tools.
[0056] In an exemplary embodiment, after the embodiment of the present disclosure generates a simulation output file of a bit stream simulation recognizable by a waveform display tool, the method further includes:
[0057] Compare the generated simulation output files with the user RTL files to obtain consistency verification results.
[0058] Figure 3 FIG. 1 is a flow chart of the bitstream simulation of the embodiment of the present disclosure, as shown in FIG. Figure 3As shown, after obtaining the Verilog hardware netlist file corresponding to the test case, the Verilog hardware netlist file is preprocessed. If the preprocessing finds that the Verilog hardware netlist file has syntax errors and / or semantic errors, an error is reported and the simulation process is exited; when no error is found in the preprocessing, the simulation dependency library file and the obtained Verilog hardware netlist file are compiled to generate a simulation program executable by the operating system; the test stimulus file is parsed into an input format recognizable by the simulation program to obtain a test stimulus file recognizable by the simulation program; the executable simulation program is called through the obtained test stimulus file recognizable by the simulation program to perform bitstream simulation; a simulation output file of the bitstream simulation recognizable by the waveform display tool is generated; the generated simulation output file is compared with the user RTL file to obtain a consistency verification result.
[0059] The embodiment of the present disclosure takes the function of the wiring from A to B as an example, and the configuration information of the wiring from A to B is extracted as: Name: Wire_A_B, address: 24'h000000, bitfield: [0], and data: 1'h1; the configuration information of the wiring from A to B is converted into an expression of the RTL file: assign B = A; the Verilog hardware netlist file of the wiring from A to B is obtained through the conversion process. After the Verilog hardware netlist file of the wiring from A to B is obtained through the conversion, the embodiment of the present disclosure performs subsequent bit stream simulation processing based on the test stimulus file.
[0060] In the embodiment of the present disclosure, if the functions involved in the test case include routing, it needs to be converted into RTL. The routing is a 20-to-1 MUX. When the bitfield[4:0] of address A0 is 00001, A->B. If the address bitfield[4:0] in the configuration information of all functions is 00001, the routing is converted into an RTL file containing only the address and data corresponding to the test case and implemented as: assign B=A;
[0061] In the embodiment of the present disclosure, if the functional PLL involved in the test case needs to be converted into RTL, for example, if the data value of the bitfield[5:0] of address A1 in the configuration information of all functions obtained is 6'h3f, and this address is the value 63 of the configuration PLL IDIV input division coefficient, then the function is converted into an RTL file containing only the corresponding address and data of the test case and implemented as: parameter IDIV=1.
[0062] The embodiment of the present disclosure further provides a computer storage medium, in which a computer program is stored. When the computer program is executed by a processor, the above-mentioned bit stream simulation method is implemented.
[0063] The embodiment of the present disclosure also provides a terminal, including: a memory and a processor, wherein a computer program is stored in the memory;
[0064] in,
[0065] The processor is configured to execute the computer program in the memory;
[0066] When the computer program is executed by a processor, the method of bit stream simulation as described above is implemented.
[0067] Figure 4 The structure block diagram of the device for bitstream simulation of the embodiment of the present disclosure is as follows: Figure 4 As shown, it includes: an extraction unit, a matching unit, a determination unit, a conversion unit, a compilation unit, a parsing unit and a simulation unit; wherein,
[0068] The extraction unit is configured to: extract configuration information of all functions included in the field programmable gate array FPGA from a hardware netlist of the FPGA, the configuration information including the following information of the function: name, address and data;
[0069] The matching unit is configured to: match the addresses and data contained in the bit stream file of the predetermined test case with the addresses and data in the extracted configuration information of all functions to determine the functions involved in the test case;
[0070] The determination unit is set to: determine the name and data of the function involved in the test case according to the extracted configuration information of all functions;
[0071] The conversion unit is set to: according to the names and data of the functions involved in the determined test case, convert the test case into a register transfer level RTL file containing only the address and data corresponding to the test case, so as to obtain a Verilog hardware netlist file corresponding to the test case;
[0072] The compilation unit is set to: compile the simulation dependent library file and the obtained Verilog hardware netlist file to generate a simulation program executable by the operating system;
[0073] The parsing unit is configured to: parse the test stimulus file into an input format recognizable by the simulation program, and obtain the test stimulus file recognizable by the simulation program;
[0074] The simulation unit is configured to call an executable simulation program through a test stimulus file that can be identified by the obtained simulation program to perform bit stream simulation.
[0075] The disclosed embodiment obtains the Verilog hardware netlist file corresponding to the test case based on the bitstream file and the configuration information of all functions, and performs bitstream simulation based on the Verilog hardware netlist file, thereby reducing the scale and simulation time of the bitstream simulation and improving the development efficiency of the FPGA.
[0076] In an exemplary embodiment, the functions in the embodiments of the present disclosure include one or any combination of the following:
[0077] Routing, DFF, LUT, DSP and memory.
[0078] In an exemplary embodiment, the extraction unit of the embodiment of the present disclosure is configured as follows:
[0079] Extract configuration information of all functions from the FPGA hardware netlist according to the function configuration document.
[0080] In an exemplary embodiment, the bitstream file in the embodiment of the present disclosure includes:
[0081] The bitstream file generated when the FPGA internal layout and routing is performed according to the test case, and the input signal is passed to the output port or specified module in sequence through the layout and routing path.
[0082] In an exemplary embodiment, the simulation unit of the embodiment of the present disclosure is further configured to:
[0083] Generates simulation output files for bitstream simulation that are recognizable by waveform display tools.
[0084] In an exemplary embodiment, the apparatus of the embodiment of the present disclosure further includes a consistency verification unit, which is configured to:
[0085] Compare the generated simulation output files with the user RTL files to obtain consistency verification results.
[0086] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A method for bitstream simulation, It is characterized in that include: Extract configuration information of all functions contained in the field programmable gate array FPGA from the hardware netlist of the FPGA, the configuration information including the following information of the function: name, address and data; Matching the addresses and data contained in the bitstream file of the predetermined test case with the addresses and data in the extracted configuration information of all functions to determine the functions involved in the test case; Determine the names and data of the functions involved in the test case based on the extracted configuration information of all functions; According to the names and data of the functions involved in the determined test cases, the test cases are converted into register transfer level RTL files containing only addresses and data corresponding to the test cases, so as to obtain a Verilog hardware netlist file corresponding to the test cases; Compile the simulation dependent library files and the obtained Verilog hardware netlist files to generate a simulation program executable by the operating system; Parsing the test stimulus file into an input format recognizable by the simulation program to obtain a test stimulus file recognizable by the simulation program; The executable simulation program is called through the obtained test stimulus file that can be recognized by the simulation program to perform bit stream simulation.
2. The method according to claim 1, It is characterized in that The functions include one or any combination of the following: Routing, flip-flop DFF, look-up table LUT, digital signal processor DSP and memory.
3. The method according to claim 1, It is characterized in that The configuration information of all functions is extracted from the FPGA hardware netlist, including: The configuration information of all functions is extracted from the FPGA hardware netlist according to the functional configuration document.
4. The method according to claim 1, It is characterized in that The bitstream file includes: The bit stream file is generated when the FPGA internal layout and routing are performed according to the test case, and the input signal is sequentially transmitted to the output port or the specified module through the path after layout and routing.
5. The method according to any one of claims 1 to 4, It is characterized in that When the test stimulus file identifiable by the obtained simulation program is called to execute the simulation program and the bit stream simulation is performed, the method further comprises: A simulation output file of the bitstream simulation recognizable by a waveform display tool is generated.
6. The method according to any one of claims 1 to 4, It is characterized in that After generating the simulation output file of the bitstream simulation recognizable by the waveform display tool, the method further includes: The generated simulation output file is compared with the user RTL file to obtain a consistency verification result.
7. A computer storage medium, wherein a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the method for bit stream simulation according to any one of claims 1 to 6 is implemented.
8. A terminal, include: A memory and a processor, wherein the memory stores a computer program; wherein, The processor is configured to execute the computer program in the memory; When the computer program is executed by the processor, the method for bitstream simulation according to any one of claims 1 to 6 is implemented.
9. A device for bitstream simulation, include: extraction unit, matching unit, determination unit, conversion unit, compilation unit, parsing unit and simulation unit; wherein, The extraction unit is configured to: extract configuration information of all functions included in the field programmable gate array FPGA from a hardware netlist of the FPGA, the configuration information including the following information of the function: name, address and data; The matching unit is configured to: match the addresses and data contained in the bit stream file of the predetermined test case with the addresses and data in the extracted configuration information of all functions to determine the functions involved in the test case; The determination unit is set to: determine the name and data of the function involved in the test case according to the extracted configuration information of all functions; The conversion unit is set to: according to the names and data of the functions involved in the determined test case, convert the test case into a register transfer level RTL file containing only the address and data corresponding to the test case, so as to obtain a Verilog hardware netlist file corresponding to the test case; The compilation unit is set to: compile the simulation dependent library file and the obtained Verilog hardware netlist file to generate a simulation program executable by the operating system; The parsing unit is configured to: parse the test stimulus file into an input format recognizable by the simulation program, and obtain the test stimulus file recognizable by the simulation program; The simulation unit is configured to call an executable simulation program through a test stimulus file that can be identified by the obtained simulation program to perform bit stream simulation.
10. The device according to claim 9, It is characterized in that The functions include one or any combination of the following: Routing, flip-flop DFF, look-up table LUT, digital signal processor DSP and memory.
Citation Information
Cited By
FPGA (Field Programmable Gate Array) chip DSP (Digital Signal Processor) module bit stream verification method and device
CN121881936A
FPGA chip DSP module bit stream verification method and device
CN121881936B
