HDL code generation method supporting embedded scripting language
By embedding the script language in the HDL source code and generating the target HDL code file, the problems of low HDL language design efficiency and complex debugging are solved, and detailed circuit structure display and efficient debugging are achieved.
Patent Information
- Application Number
- CN202211116542.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-09-14
AI Technical Summary
In IP/SOC/AISC design, existing HDL languages require manual code writing when designing repetitive functional circuits and functionally close circuits, which affects design efficiency. Advanced data structures cannot be recognized and executed by all front-end design tools, and the debugging process is complex and low-precision.
Embed Perl and/or Python scripting languages in HDL source code files, identify script types by detecting flags and generate hidden executable script files, call API script library to translate and generate target HDL code files, and replace high-level data structures with pure HDL text.
It makes circuit debugging intuitive and detailed, reduces manual work, improves development efficiency, reduces the chance of errors, and solves the problem of tool limitations.
Smart Images

Figure CN115455873B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of software, and in particular to a method for generating HDL code that supports an embedded scripting language. Background Art
[0002] In IP / SoC / AISC design, the mainstream design approach is to use Hardware Description Language (HDL), including Verilog and VHDL. These languages describe the structure and behavior of digital system hardware in text form. They can represent logic circuit diagrams, logical expressions, and the logical functions performed by digital logic systems.
[0003] Traditional HDL languages have very simple syntax, requiring designers to manually describe detailed code to represent circuit details and structure. When encountering circuits with repetitive or similar functions, engineers often have to painstakingly write out each code manually, severely impacting circuit design and work efficiency. The latest HDL languages utilize advanced data structures, such as structure and generate statements. However, these advanced data structures cannot be fully recognized and executed by all front-end design tools. For example, they cannot automatically compile and display waveforms of structure statements. Some mid-end and back-end EDA tools also have limited support for structure and generate statements, and may even make incorrect judgments. Furthermore, during debugging, engineers cannot accurately translate and understand these advanced data structures, which may require complex manual conversion and analysis, further impacting debugging accuracy and development efficiency. Summary of the Invention
[0004] The present application provides a method for generating HDL code supporting an embedded scripting language, the method comprising:
[0005] Obtaining an HDL source code file and reading each line of HDL code in the file; the HDL source code file is embedded with Perl and / or Python scripting languages, and the scripting languages are used to interpret and generate HDL code files;
[0006] In response to reading a detection flag of the script language embedded in the HDL code line, determining a script type of the script language, and generating a hidden executable script file in a target script format according to the detection flag and the script type;
[0007] An API script library is called to execute the hidden executable script file to generate a target HDL code file; the API script library contains all library functions for translating the embedded script language; the target HDL code file does not contain the embedded script language, but contains HDL code lines for describing all circuit structures, parameters and names of hardware circuits.
[0008] Specifically, in response to reading a detection flag of the script language embedded in an HDL code line, determining a script type of the script language, and generating a hidden executable script file in a target script format according to the detection flag and the script type, includes:
[0009] When the embedded detection mark is read, the detection mark is numbered, and the script type of the script language and the language type of the script are determined according to the type of the detection mark; the script type is divided into single-line script language and multi-line script language;
[0010] When it is indicated that the script language is a single-line script language, directly extracting the line code of the single-line script language, and generating the hidden executable script file in the target script format according to the number and language type;
[0011] When it is indicated that the script language is a multi-line script language, the current position line is marked as the starting line, and code lines are continuously read until a detection end mark is read, wherein the detection mark is the end mark of the multi-line script language;
[0012] Line codes are extracted based on the detection flag and the end flag, and the hidden executable script file in the target script format is generated according to the number and language type.
[0013] Specifically, the calling of the API script library to execute the hidden executable script file to generate the target HDL code file includes:
[0014] Calling the API script library to execute the generated hidden executable script file, translating the multi-line script language or the single-line script language through the library function to generate a corresponding HDL code snippet;
[0015] According to the numbering sequence of the detection marks, the HDL code snippets are used to replace the corresponding single-line script language or multiple-line script language in the HDL source code file, and the target HDL code file is generated by splicing.
[0016] Specifically, the API script library includes at least one of a single script library function, a multi-script library function, hash array data, and a multi-dimensional array.
[0017] Specifically, when the single-line script language is a universal serial peripheral device SPI interface display instruction, the signal input / output HDL line code of all peripheral interfaces is generated based on the single-script library function; wherein the signal input / output HDL line code includes at least one of the interface name, input / output type and data bit width.
[0018] When the multi-line script language is a test signal display instruction, test HDL line codes for all test signals are generated based on the multi-script library function, and the input / output HDL line codes and the test HDL line codes are used to display the waveform diagram of the hardware interface and the test signal on the oscilloscope.
[0019] Specifically, when the multiple-line script language contains reused module data, the reused module data, the names and quantities of all circuit structures therein are determined; the reused module data is a common parameter template necessary for each circuit structure to perform a hardware circuit function;
[0020] Based on the API script library, the common parameters of the reused module data are obtained, and the HDL line code of the corresponding circuit structure is generated according to the circuit structure name and quantity; different hardware circuit description languages respectively contain the complete name, content and parameters of their own circuit structure, and there are no reused common parameters between the circuit structures.
[0021] Specifically, when a multi-line script language includes a hash array, the name, quantity, and function of the hardware interface or test signal are determined, and the hash array data is called to generate an HDL function line code based on the hardware interface or test signal; wherein the HDL function line code includes at least one of a chip select instruction, a signal name, an enable instruction, a function instruction, a read / write instruction, and a bit width instruction.
[0022] Specifically, the detection mark starts with " / / ", and the subsequent connection symbols are composed of no more than 4 placeholders;
[0023] The detection mark of the single-line script language includes at least one of " / / :", " / / ;", " / / |" and " / / !";
[0024] The detection flags of the multi-line script language include at least one of " / / :{" and " / / :Begin"; the corresponding detection end flags are " / / :}" and " / / :End"; the format of the generated hidden executable script file includes ".eperl.pl" or ".epython.py".
[0025] The beneficial effects of the above technical solution include at least the following: the target HDL code file output by this solution and the HDL source code file achieve exactly the same functionality when executing the hardware circuit. However, due to the conversion through the embedded scripting language, the parts that originally required high-level language programming are replaced with pure HDL text, resulting in a more detailed presentation of the content, namely, including the parameters of all circuit structures, rather than being presented in a shared template. Therefore, during debugging, selective line-by-line debugging is possible, and all parameter information for each circuit structure can be intuitively viewed through the target HDL code file, facilitating circuit debugging. This also reduces manual work, improves development efficiency, removes EDA tool limitations, and reduces the probability of errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a flowchart of a method for generating HDL code supporting an embedded scripting language provided in an embodiment of the present application;
[0027] Figure 2 is a flowchart of a method for generating HDL code supporting an embedded scripting language provided by another embodiment of the present application;
[0028] Figure 3 It is a flowchart for splicing and generating target HDL code. DETAILED DESCRIPTION
[0029] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0030] In this document, "plurality" refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates an "or" relationship between the associated objects.
[0031] As the world's most popular design language, HDL may encounter situations where the tool does not support or cannot recognize the high-level language when executing specific circuit functions or debugging. This requires engineers to manually describe it in the most original HDL text. This method can fully achieve the desired purpose, but it will slow down debugging efficiency and affect work progress.
[0032] In order to clearly describe the problems that may occur when a designer uses an HDL file to perform hardware debugging, this embodiment provides several possible situations.
[0033] Taking the example of listing 1024 test signals, when writing HDL language, technicians need to write 1024 lines of HDL code in sequence according to the signal names of the circuit structure, as follows:
[0034] wire test_sig0;
[0035] wire test_sig1;
[0036] wire test_sig2; ......
[0038] wire test_sig1021;
[0039] wire test_sig1022;
[0040] wire test_sig1023;
[0041] Or use advanced data structures, such as the generate statement structure, as follows:
[0042]
[0043]
[0044] The above code can largely solve the problem of writing repetitive and similar circuit structure code, but it cannot guarantee that front-end, mid-stage, and back-end design and testing tools can support and accurately translate it. When errors are detected, engineers often need to manually modify the code to circumvent these problems, which also reduces development efficiency.
[0045] For example, when designing circuit structures using HDL files, in order to simplify the tedious writing task, some common or functionally independent designs are adopted, using parameterized independent module designs. The modules are then made configurable by changing the parameters when calling the modules, as shown in the following example:
[0046] mod_a#(.a(1),.b(2),.c(3))inst_a();
[0047] mod_a#(.a(4),.b(2),.c(3))inst_b();
[0048] mod_a#(.a(1),.b(5),.c(2))inst_c();
[0049] This code describes three circuit structures. mod_a is a reused module data containing detailed code parameters. However, because there is only one copy of the design code for module mod_a, debugging is not what you see is what you get. Engineers must manually retrieve the common parameters within mod_a, understand the three code snippets, and "translate" the designs for three instances (inst_a, inst_b, and inst_c) with identical code but different functions. In other words, when engineers execute these lines of code, the system uses the common parameters in mod_a and then generates detailed circuit parameter data based on the specific design requirements for circuits a, b, and c. This approach improves code writing efficiency, but it prevents detailed fine-tuning of individual circuit structures during debugging due to the reuse of common parameters, requiring engineers to understand and translate the data. Furthermore, due to the reuse of the common parameters and nested loops in the advanced data structures, waveform display of the structure cannot display waveforms of any circuit section on an oscilloscope, limiting operational flexibility.
[0050] This solution addresses these potential issues and proposes an HDL code generation method that supports embedded scripting languages. This method embeds the scripting language within the HDL source code file. When the scripting language is executed, it is interpreted and translated, generating pure HDL code without advanced data structures. This approach eliminates the need for extensive coding work while also addressing data reuse and display issues.
[0051] like Figure 1 FIG. 1 is a flowchart of a method for generating HDL code supporting an embedded scripting language according to an embodiment of the present application. The method specifically includes the following steps:
[0052] Step 101: Obtain an HDL source code file and read each line of HDL code in the file.
[0053] HDL source code files can be embedded with Perl and / or Python scripting languages. However, Perl and Python are high-level languages themselves, and description files written directly using embedded Perl and / or Python scripting languages are not executable. Therefore, it is necessary to read each line of HDL code in the file and convert the HDL source code file.
[0054] Step 102 : In response to reading a detection flag of the script language embedded in the HDL code line, determining the script type of the script language, and generating a hidden executable script file in a target script format according to the detection flag and the script type.
[0055] Detection flags are the key to identifying embedded scripts. There may be multiple embedded script languages in an HDL source code file. Each embedded location requires a built-in flag. Moreover, the script type of the embedded script language of this solution can be Perl language or Python language. Different languages require different methods for interpretation and compilation, and the script format of the generated hidden executable script file is also the corresponding Perl language or Python language. Script types include single-line script languages and multi-line script languages. The generation of hidden executable script files is based on the specific script type and format. The generated file format is .eperl.pl format or .epython.py format.
[0056] Step 103: Call the API script library to execute the hidden executable script file to generate a target HDL code file.
[0057] An API script library is a set of routines that applications and developers can access based on certain software or hardware without requiring access to the source code or understanding the details of the internal workings. The API library functions are computer language library functions that support interconnect controller operations, cluster topology operations, memory segment operations, including segment management and data access. The script library in this solution stores the script programs and functions necessary to execute Perl and / or Python scripting languages. Compilation tools inherently only support compilation in HDL language environments. However, calling the API script library allows it to perform specific language translation to execute the hidden executable script file and then generate a target HDL code file. This target HDL code file is the final HDL code file used to describe the circuit structure and parameters. The target HDL code file does not contain embedded scripting languages (Perl and Python) but contains HDL code lines that describe all circuit structures, parameters, and names of the EDA circuit.
[0058] In summary, the target HDL code file and HDL source code file in this solution achieve exactly the same functionality when executing the hardware circuit. However, due to the conversion via an embedded scripting language, the high-level language-written sections are replaced with pure HDL text, presenting a more detailed presentation of all circuit structure parameters, rather than a shared template. Therefore, during debugging, selective line-by-line debugging is possible, and the target HDL code file allows for intuitive visualization of all parameter information for each circuit structure, facilitating circuit debugging. This also reduces manual work, improves development efficiency, removes EDA tool limitations, and reduces the likelihood of errors.
[0059] like Figure 2FIG. 1 is a flowchart of a method for generating HDL code supporting an embedded scripting language according to another embodiment of the present application. The method specifically includes the following steps:
[0060] Step 201: Obtain an HDL source code file and read each line of HDL code in the file.
[0061] Step 202: When the embedded detection mark is read, the detection mark is numbered, and the script type of the script language and the language type of the script are determined according to the type of the detection mark.
[0062] The detection mark needs to be distinguished from the HDL source code line, while not occupying too many bytes of memory. This solution uses " / / " as the detection mark symbol, followed by a connection symbol with no more than four placeholders to form the detection mark. The purpose of the detection mark is to identify the complete script language content, extract and compile it separately. There may be a large number of embedded script languages in a source file, so they need to be numbered and distinguished to determine the script type and language type, which also facilitates subsequent call translation. Script types are divided into single-line script languages and multi-line script languages. The language type of the script determines whether it is Perl or Python. Different languages require calling different API script libraries.
[0063] Step 203 : When the indicated script language is a single-line script language, the line code of the single-line script language is directly extracted, and a hidden executable script file in the target script format is generated according to the number and language type.
[0064] In a possible implementation, the detection mark of the single-line script language may be represented by at least one of “ / / :”, “ / / ;”, “ / / |”, or “ / / !”, to indicate that a non-HDL code language is detected.
[0065] For example, the code line labeled " / / :&PrintIntfPort("spi",";");" displays code related to the SPI interface. Executing this code outputs the hardware description language code for the SPI interface. It should be noted that single-line script languages only have a detection flag, not an end flag. Therefore, only the code line containing the current detection flag is extracted and numbered. Based on the number and language type, a hidden executable script file in the target script format is generated.
[0066] The above example uses Perl, generating a hidden executable script file named NOXX.eperl.pl. The number can be determined by the number of times the script is read from the beginning, or by the number of the line of code where the detection flag is located. The hidden executable script file serves as an intermediate file during the conversion and is therefore considered an intermediate hidden file. It can be deleted after the conversion is complete, or it can be represented by number to facilitate subsequent debugging and modification.
[0067] Step 204 : When the script language is indicated as a multi-line script language, the current position line is marked as the starting line, and code lines are read continuously until a detection end mark is read, indicating that the detection mark is the end mark of the multi-line script language.
[0068] In one possible implementation, the detection marker for a multi-line script language can be represented by " / / :{" or " / / :Begin". When the code is read to this position, it is first determined to be a multi-line script language. Then, the code line is read again to determine the end position. The end marker is based on the code line where the end marker is detected.
[0069] Step 204 : extracting line codes based on the detection flag and the end flag, and generating a hidden executable script file in the target script format according to the code number and language type.
[0070] The detection end marker for multi-line script languages corresponds to the detection marker: specifically, " / / :{" corresponds to " / / :}"; " / / :Begin" corresponds to " / / :End". After determining the detection end marker and detection marker, the code between them is extracted based on their positions. A hidden executable script file in the target script format is generated based on the code number and language type. The content of the hidden executable script file is the code content of the single-line or multi-line script language.
[0071] The following is a line of code in Perl that displays a test signal:
[0072]
[0073]
[0074] Step 205 : Calling the API script library to execute the generated hidden executable script file, translating the multi-line script language or the single-line script language through the library function, and generating a corresponding HDL code snippet.
[0075] The API script library stores a large number of defined callable library functions and programs. These programs can be pre-edited and customized based on the specific project. In this solution, the API script library includes at least one of single-script library functions, multi-script library functions, hash array data, and multidimensional arrays. Each of these is described in detail below.
[0076] 1. When the single-line script language displays instructions for the universal serial peripheral device SPI interface, the signal input / output HDL line codes of all peripheral interfaces are generated based on the single-script library function.
[0077] The built-in single-line scripting language (API) is as follows:
[0078] / / :&PrintIntfPort("spi",";");
[0079] The following HDL code snippet is generated by calling the single script library function and executing it:
[0080] output[0:0]sck_o;
[0081] output[0:0]mosi_o;
[0082] output[0:0]ss_o;
[0083] input[0:0]miso_i;
[0084] The PrintIntfPort command calls a single script library function to directly display all SPI defined ports, their inputs and outputs, and their byte widths. This solution uses four SPI inputs and outputs as an example, but other numbers are also possible. In other words, a single line of Perl embedded scripting can be converted into a multi-line HDL code snippet, while also displaying a more detailed view of the port definitions.
[0085] 2. When the multi-line script language is a test signal display instruction, test HDL line codes for all test signals are generated based on the multi-script library function, and the input / output HDL line codes and the test HDL line codes are used to display waveform diagrams of the hardware interface and the test signal on the oscilloscope.
[0086] The embedded scripting language (API) is as follows:
[0087]
[0088]
[0089] The following HDL code snippet is generated by calling multiple script library functions and executing them:
[0090] wire my_test_sig0;
[0091] wire my_test_sig1;
[0092] wire my_test_sig2; ......
[0094] wire my_test_sig1021;
[0095] wire my_test_sig1022;
[0096] wire my_test_sig1023;
[0097] In other words, using the advanced for loop structure described above to generate 1024 different test signals, traditional methods would require manually writing 1024 lines of code, or using for and generate statements, which would require additional manual translation or recognition. These for and generate statements also hinder later debugging, such as observing the waveform output and debugging the 892nd test signal individually. This inline approach, however, directly generates 1024 lines of code, allowing each signal to be tested sequentially during debugging, facilitating interrupt testing and troubleshooting.
[0098] 3. When a multi-line script language contains reused module data, determine the reused module data, all circuit structure names and quantities;
[0099] The public parameters of the reused module data are obtained based on the API script library, and the HDL line code of the corresponding circuit structure is generated according to the circuit structure name and quantity.
[0100] The API calls (API) for embedded reuse module data are as follows:
[0101] &GenMod_a("-name mod_c-a 1-b 2-c 3");
[0102] &GenMod_a("-name mod_b-a 4-b 2-c 1");
[0103] &GenMod_a("-name mod_c-a 1-b 5-c 2");
[0104] The following HDL code snippet is generated by calling the Mod_a library function:
[0105]
[0106]
[0107] As shown in the example above, which displays the reused module data for mod_a, the interface cannot directly display internal common parameters, making it impossible to debug individual circuit parameters. However, using this solution, each module code is displayed differently (the ellipsis indicates the detailed parameters of the circuit structure; a=4, b=2, c=1 indicates the internal parameters of the circuit). This means that each generated circuit has a complete name, content, and parameters, each independent of the others. There are no reused common parameters because the three generated components have already generated their own content based on mod_a. During debugging, engineers can test each structure individually, one by one, according to the line of code, without causing confusion in system parameters.
[0108] 4. When a multi-line script language includes a hash array, determine the name, quantity, and function of the hardware interface or test signal, and call the hash array data to generate HDL function line code based on the hardware interface or test signal.
[0109] The built-in hash array call (API) is as follows:
[0110]
[0111] The following HDL code snippet is generated by calling the hash array and executing:
[0112] assign test_wire0=test_input0&(sys_ctrl&sys_en&sys_off|sys_on);
[0113] assign test_wire1=test_input1&(sys_ctrl&sys_en&sys_off|sys_on);
[0114] assign test_wire2=test_input2&(sys_ctrl&sys_en&sys_off|sys_on);
[0115] assign test_wire3=test_input3&(sys_ctrl&sys_en&sys_off|sys_on);
[0116] The source code defines the names, quantities, and functions of the three test signal inputs and outputs. The functional description language has limited control and can be completed and understood manually. However, when the array size is too large, it needs to be stored in a hash array. The hash array is called when needed for display, showing each interface or signal's chip select instruction (sel), signal name (test_wire n), enable instruction (sys_en), function instruction (sys_ctrl, on and off), read and write instructions, and bit width instructions. These can be quickly displayed directly using the hash array. Furthermore, when it is necessary to add, remove, or modify the function of a specific interface signal, manual editing can be done directly through the debugging interface, greatly increasing operational flexibility.
[0117] The above examples are based on the Perl language. The Python language has similar functions and will not be described in detail in this embodiment.
[0118] Step 206 , according to the number sequence of the detection flags, the HDL code snippets are replaced with corresponding single-line script languages or multiple-line script languages in the HDL source code file, and the target HDL code file is generated by splicing.
[0119] Assuming that there are 100 embedded detection flags in an HDL source code file, 100 hidden executable script files in the target script format will be generated, and 100 HDL code snippets will be generated through 100 API script library calls.
[0120] As for the HDL source code file itself, it also contains a lot of pure HDL code. These are descriptive languages that do not need to be called. These non-script languages need to retain the original code, such as Figure 3 As shown, the retained original code needs to be spliced with the generated HDL code snippet. This means that the HDL code snippet replaces the corresponding single-line or multi-line script language. Finally, the target HDL code file is generated. In other words, the HDL code in the above example replaces the original script language.
[0121] It should be noted that, for the extracted hidden executable script file, if an error occurs during script execution, the file code content is debugged and the original file is modified according to the specific debugging content.
[0122] In summary, the present invention replaces the necessary circuit structure description language with Perl and / or Python scripting languages based on the original HDL code. Corresponding start detection flags and detection end flags are used to demarcate the scope of the script language for single-line and multi-line script languages, respectively, to generate a hidden executable script file in the target script format. The HDL detection tool interprets and translates each HDL code snippet by calling an API script library containing all library functions for translating embedded script languages. Each HDL code snippet is then numbered to replace the position of the embedded script language in the original file, ultimately generating a target HDL code file. The generated target HDL code file does not contain the embedded script language and contains HDL code lines that describe all circuit structures, parameters, and names of the EDA circuit. This makes code debugging and editing more convenient for engineers. For example, multidimensional arrays, hash arrays, dictionaries, etc., help engineers organize code more efficiently to increase reuse, improve code efficiency, and reduce the chance of errors.
[0123] The above describes the preferred embodiments of the present invention; it should be understood that the present invention is not limited to the above-mentioned specific embodiments, and the devices and structures not described in detail should be understood to be implemented in a common manner in the art; any technician familiar with the art can make many possible changes and modifications without departing from the technical solution of the present invention, or modify them into equivalent embodiments with equivalent changes, which does not affect the essential content of the present invention; therefore, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention that do not depart from the content of the technical solution of the present invention are still within the scope of protection of the technical solution of the present invention.
Claims
1. A method for generating HDL code supporting an embedded scripting language, characterized in that: The method comprises: Obtaining an HDL source code file and reading each line of HDL code in the file; the HDL source code file is embedded with Perl and / or Python scripting languages, and the scripting languages are used to interpret and generate HDL code files; In response to reading a detection flag of the script language embedded in an HDL code line, determining the script type of the script language, and generating a hidden executable script file in a target script format based on the detection flag and the script type; specifically, when the embedded detection flag is read, numbering the detection flag, and determining the script type of the script language based on the type of the detection flag, as well as determining the language type of the script; script types are divided into single-line script languages and multi-line script languages; When the script language is a single-line script language, the line code is directly extracted, and the hidden executable script file in the target script format is generated according to the number and language type; When the script language is a multi-line script language, the current position line is marked as the starting line, and code lines are continuously read until a detection end mark is read; code lines are extracted based on the detection mark and the end mark, and the hidden executable script file in the target script format is generated according to the number and language type; An API script library is called to execute the hidden executable script file to generate a target HDL code file; the API script library contains all library functions for translating the embedded script language; the target HDL code file does not contain the embedded script language, but contains HDL code lines for describing all circuit structures, parameters and names of hardware circuits.
2. The method according to claim 1, characterized in that The calling API script library executes the hidden executable script file to generate a target HDL code file, including: Calling the API script library to execute the generated hidden executable script file, translating the multi-line script language or the single-line script language through the library function to generate a corresponding HDL code snippet; According to the numbering sequence of the detection marks, the HDL code snippets are used to replace the corresponding single-line script language or multiple-line script language in the HDL source code file, and the target HDL code file is generated by splicing.
3. The method according to claim 2, characterized in that The API script library includes at least one of a single script library function, a multi-script library function, hash array data, and a multi-dimensional array.
4. The method according to claim 3, characterized in that When the single-line script language is a universal serial peripheral device SPI interface display instruction, generating signal input / output HDL line codes for all peripheral interfaces based on the single-script library function; wherein the signal input / output HDL line codes include at least one of the interface name, input / output type, and data bit width; When the multi-line script language is a test signal display instruction, test HDL line codes for all test signals are generated based on the multi-script library function, and the input / output HDL line codes and the test HDL line codes are used to display the waveform diagram of the hardware interface and the test signal on the oscilloscope.
5. The method according to claim 3, characterized in that When the multi-line script language contains reused module data, determining the reused module data, all circuit structure names and quantities therein; the reused module data is a common parameter template necessary for each circuit structure to perform hardware circuit functions; Based on the API script library, the common parameters of the reused module data are obtained, and the HDL line code of the corresponding circuit structure is generated according to the circuit structure name and quantity; different hardware circuit description languages respectively contain the complete name, content and parameters of their own circuit structure, and there are no reused common parameters between the circuit structures.
6. The method according to claim 3, characterized in that When a multi-line script language includes a hash array, the name, quantity, and function of the hardware interface or test signal are determined, and the hash array data is called to generate HDL function line codes based on the hardware interface or test signal; wherein the HDL function line codes include at least one of a chip select instruction, a signal name, an enable instruction, a function instruction, a read / write instruction, and a bit width instruction.
7. The method according to any one of claims 1 to 6, characterized in that: The detection mark starts with " / / ", and the subsequent connection symbols are composed of no more than 4 placeholders; The detection mark of the single-line script language includes at least one of " / / :", " / / ;", " / / |" and " / / !"; The detection flags of the multi-line script language include at least one of " / / :{" and " / / :Begin"; the corresponding detection end flags are " / / :}" and " / / :End"; the format of the generated hidden executable script file includes ".eperl.pl" or ".epython.py".
Citation Information
Patent Citations
Top HDL file generation method and device and computer readable storage medium
CN110209387A
Automatic generation method for Verilog HDL codes of hardware accelerator
CN110221839A