Automatic generation method for SoC (System on Chip) clock management module
By automatically generating the SoC clock management module on-chip, the automatic instantiation function of Perl scripts and Emacs is used to solve the problem of time-consuming and error-prone traditional design methods, and the efficient and configurable clock management module design is realized, which improves the design of the Design efficiency and reliability.
Patent Information
- Application Number
- CN202411169132.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-11-26
AI Technical Summary
Traditional clock management module design methods are time-consuming and error-prone. The existing automated design tools cannot fully meet specific application needs and cannot automatically adapt to different design needs and performance goals, resulting in low design efficiency and reduced reliability.
Through a system-on-chip SoC clock management module automatic generation method, including collecting source clock and IP core clock information, configuring Perl scripts, generating RTL codes, register tables and SDC timing constraint files, and using the automatic instantiation function of Perl scripts and Emacs, Generate efficient and configurable clock management modules according to design requirements.
It greatly reduces design time, improves system performance and reliability, ensures code consistency and reliability, simplifies the design process, and improves design efficiency.
Smart Images

Figure CN119024923A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to integrated circuit design automation, and in particular to a method for automatically generating a system-on-chip (SoC) clock management module. Background Art
[0002] As electronic devices become increasingly complex, the design scale and functionality of system-on-chip (SoC) continue to increase, integrating multiple processors, memories, peripherals and other modules. In the system-on-chip (SoC), the clock management module is mainly responsible for generating, distributing and managing the clock signals in the system to ensure the synchronous operation and stable operation of each module.
[0003] Traditional clock management module design methods usually rely on manual writing of Verilog code, which is not only time-consuming but also error-prone. At the same time, designers need to have a deep understanding of the characteristics of clock signals, the structure of clock trees, and clock requirements under different working modes. This complexity makes it easy for designers to make logical errors or timing problems during the development process, resulting in reduced system reliability.
[0004] Although there are some automated design tools on the market that can support the design of clock management modules to a certain extent, these tools often cannot fully meet specific application requirements. At the same time, these tools still have great limitations in generating efficient and configurable clock management modules, and cannot automatically adapt to different design requirements and performance goals. Manual adjustment and optimization of generated code is still a common problem, which further increases the development cycle and cost.
[0005] Therefore, there is an urgent need for a new method that can automatically generate efficient and configurable clock management modules to adapt to the design requirements of different system-on-chip (SoC). This method should not only reduce the design time but also improve the performance and reliability of the system, thereby promoting the further development of system-on-chip (SoC) design. Summary of the invention
[0006] 1. Technical issues to be resolved
[0007] In view of the above-mentioned shortcomings of the prior art, the present invention provides a method for automatically generating a system-on-chip (SoC) clock management module, which can effectively overcome the defect of low design efficiency of the system-on-chip (SoC) clock management module in the prior art.
[0008] (II) Technical solution
[0009] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0010] A method for automatically generating a system on chip (SoC) clock management module comprises the following steps:
[0011] S1, collecting source clock information of the system on chip SoC, and filling the collected source clock information into the first hardware configuration table;
[0012] S2, collecting clock information of each IP core of the system on chip SoC, and filling the collected clock information into the second hardware configuration table;
[0013] S3. Configure the input parameters of the Perl script;
[0014] S4, based on the command line mode input running code, the system executes the Perl script according to the input parameters;
[0015] S5. Check the RTL code, register table, and SDC timing constraint file generated after the Perl script is run. If there are any problems, the Perl script will give prompts.
[0016] Preferably, before collecting the source clock information of the system on chip SoC in S1 and filling the collected source clock information into the first hardware configuration table, the method includes:
[0017] Configure the system environment, install the software tools Perl and Emacs, and add corresponding environment variables and path variables in the system configuration file.
[0018] Preferably, collecting source clock information of the system on chip SoC in S1 and filling the collected source clock information into the first hardware configuration table includes:
[0019] The source clock information of the system on chip SoC is collected, including all source clocks used as clock sources and corresponding frequency information, and the collected source clock information is filled into the first hardware configuration table.
[0020] Preferably, the name of each source clock is filled in the CLOCK row of the first hardware configuration table, and the frequency value of each source clock is filled in the FREQ row of the first hardware configuration table;
[0021] Among them, the number of source clocks, source clock names and source clock frequencies can be increased, decreased or deleted according to design requirements.
[0022] Preferably, collecting clock information of each IP core of the system on chip SoC in S2 and filling the collected clock information into the second hardware configuration table includes:
[0023] Collect the clock information of each IP core of the system on chip SoC, including the required source clock, whether division is required, whether the division coefficient is fixed or configurable, whether clock gating is required and the default value of clock gating, and fill the collected clock information into the second hardware configuration table.
[0024] Preferably, the CLKNAME column of the second hardware configuration table is filled with the name of the clock that each IP core needs to generate, and the GRPNUM column of the second hardware configuration table represents the group number to which the generated clock is assigned in the SDC timing constraint file;
[0025] Fill in the source clocks required by each IP core in the CLKA, CLKB, CLKC, and USER columns of the second hardware configuration table:
[0026] 1) If a source clock is required, fill in Y in the corresponding column of CLKA, CLKB, CLKC; if a source clock is used as the default clock source, fill in Y / D in the corresponding column of CLKA, CLKB, CLKC;
[0027] Among them, each IP core can select multiple source clocks. In the process of generating RTL code, a multi-input selector will be generated for the IP core. The selected source clock is input into the input end of the selector, and the corresponding selection register will be generated in the generated register table. When generating the SDC timing constraint file, the output end of the selector outputs the new clock description;
[0028] 2) If you directly use the clock generated by another IP core as the clock source, do not fill in the CLKA, CLKB, and CLKC columns, and fill in the name of the IP core that needs to generate the clock in the USER column. During the RTL code generation process, the clock that needs to be generated by this IP core will be directly connected to the clock generated by the IP core that is the clock source, so as to reduce the use of selectors and dividers, and save chip area and power consumption;
[0029] Fill in the required frequency division multiple in the DIV column of the second hardware configuration table, or fill in C, which means that a software-configurable frequency division multiple is required. The corresponding frequency divider will be inserted in the process of generating RTL code, and the corresponding frequency division coefficient register will be generated in the generated register table. When generating the SDC timing constraint file, the output end of the frequency divider outputs a new clock description;
[0030] In the BUF / CG and CG DEF columns of the second hardware configuration table, fill in whether clock gating is required:
[0031] 1) If clock gating is required, fill in CG in the BUF / CG column. A clock gating unit will be inserted in the process of generating RTL code, and the corresponding gating register will be generated in the generated register table. When generating the SDC timing constraint file, the output end of the clock gating unit will output a new clock description;
[0032] If a clock gating unit is inserted, fill in 0 or 1 in the CG DEF column as the default value of the clock gating, which will be output to the generated register table;
[0033] 2) If clock gating is not required, fill in BUF in the BUF / CG column. A buffer unit will be inserted during the RTL code generation process, and a new clock description will be output at the output of the buffer unit when the SDC timing constraint file is generated.
[0034] Preferably, the input parameters of the Perl script configured in S3 include:
[0035] The input parameters of the configuration Perl script include the paths of the first hardware configuration table and the second hardware configuration table, and the names and locations of the generated RTL code, register table, and SDC timing constraint files.
[0036] Preferably, in S4, the code is input based on the command line mode, and the system executes the Perl script according to the input parameters, including:
[0037] Based on the command line mode input running code, the system executes the Perl script according to the input parameters, the Perl script captures the information in the first hardware configuration table and the second hardware configuration table, generates RTL code, and calls the clock processing unit in the IP library;
[0038] The clock processing unit includes a selector MUX, a frequency divider DIV, and a clock gating / buffer CG / BUF connected in sequence, the input end of the selector MUX inputs the source clocks CLKA, CLKB, CLKC, and the output end of the clock gating / buffer CG / BUF outputs the IP clock signal IP CLK;
[0039] In the process of generating the IP clock signal IP CLK, if only a single source clock is required, the selector MUX is not required; if clock division is not required, the divider DIV is not required; if clock gating CG is not required, the buffer BUF is used.
[0040] Preferably, in S4, the code is input based on the command line mode, and the system executes the Perl script according to the input parameters, including:
[0041] Based on the command line mode input running code, the system executes the Perl script according to the input parameters, the Perl script captures all the information in the first hardware configuration table and the second hardware configuration table as configuration information, and generates RTL code text, a register table with default values, and SDC timing constraint text according to the configuration information;
[0042] The register table includes selection registers, frequency division coefficient registers, gate registers, and default values of each control register. The developer generates a register control module based on the register table.
[0043] The SDC timing constraint file includes the creation description of each source clock, the generation description of each IP core generated clock and intermediate clock, and the group setting for each IP core generated clock.
[0044] Preferably, in S5, the RTL code, register table and SDC timing constraint file generated after the Perl script is run are checked. If there is a problem, the Perl script will give a prompt, including:
[0045] Use the automatic instantiation function of the Emacs plug-in to generate the synthesizable code of the required clock management module;
[0046] The RTL code complies with the Emacs Verilog-mode automatic instantiation format.
[0047] (III) Beneficial effects
[0048] Compared with the prior art, the method for automatically generating a system-on-chip (SoC) clock management module provided by the present invention combines the Perl script and the automatic instantiation function of Emacs to automatically generate the Verilog code of the system-on-chip (SoC) clock management module and its corresponding register table, as well as the SDC timing constraint file. By using the Perl script, efficient code can be flexibly generated according to design requirements to ensure the consistency and reliability of the code. At the same time, the automatic instantiation function of Emacs can simplify the templating and repetitive work of the code, greatly reducing the design time required for manual design, facilitating the iteration of design functions, and greatly improving the design efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0050] Figure 1 It is a schematic diagram of the process of the present invention;
[0051] Figure 2 It is a structural schematic diagram of the clock processing unit in the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] A method for automatically generating a clock management module of a system on chip (SoC), such as Figure 1 As shown, ① collecting source clock information of the system on chip SoC, and filling the collected source clock information into the first hardware configuration table, specifically including:
[0054] The source clock information of the system on chip SoC is collected, including all source clocks used as clock sources and corresponding frequency information, and the collected source clock information is filled into the first hardware configuration table.
[0055] In the technical solution of the present application, the name of each source clock is filled in the CLOCK row of the first hardware configuration table, and the frequency value of each source clock is filled in the FREQ row of the first hardware configuration table;
[0056] Among them, the number of source clocks, source clock names and source clock frequencies can be increased, decreased or deleted according to design requirements.
[0057] In order to better illustrate the technical solution of this application, the specific form of the first hardware configuration table is given below:
[0058] Table 1 The first hardware configuration table
[0059] CLOCK CLKA CLKB CLKC FREQ(MHz) 12 24 32
[0060] Specifically, before collecting source clock information of the system on chip SoC and filling the collected source clock information into the first hardware configuration table, the method includes:
[0061] Configure the system environment, install the software tools Perl and Emacs, and add corresponding environment variables and path variables in the system configuration file.
[0062] ② Collect the clock information of each IP core of the system on chip SoC, and fill the collected clock information into the second hardware configuration table, specifically including:
[0063] Collect the clock information of each IP core of the system on chip SoC, including the required source clock, whether division is required, whether the division coefficient is fixed or configurable, whether clock gating is required and the default value of clock gating, and fill the collected clock information into the second hardware configuration table.
[0064] In the technical solution of the present application, the name of the clock that each IP core needs to generate is filled in the CLKNAME column of the second hardware configuration table, and the group number to which the generated clock is assigned in the SDC timing constraint file is represented in the GRPNUM column of the second hardware configuration table;
[0065] In the CLKA, CLKB, CLKC, and USER columns of the second hardware configuration table, fill in the source clocks required by each IP core:
[0066] 1) If a source clock is required, fill in Y in the corresponding column of CLKA, CLKB, CLKC; if a source clock is used as the default clock source, fill in Y / D in the corresponding column of CLKA, CLKB, CLKC;
[0067] Among them, each IP core can select multiple source clocks. In the process of generating RTL code, a multi-input selector will be generated for the IP core. The selected source clock is input into the input end of the selector, and the corresponding selection register will be generated in the generated register table. When generating the SDC timing constraint file, the output end of the selector outputs the new clock description;
[0068] 2) If you directly use the clock generated by another IP core as the clock source, do not fill in the CLKA, CLKB, and CLKC columns, and fill in the name of the IP core that needs to generate the clock in the USER column. During the RTL code generation process, the clock that needs to be generated by this IP core will be directly connected to the clock generated by the IP core that is the clock source, so as to reduce the use of selectors and dividers, and save chip area and power consumption;
[0069] In the DIV column of the second hardware configuration table, fill in the required frequency division multiple, or fill in C, which means that a software-configurable frequency division multiple is required. The corresponding frequency divider will be inserted in the process of generating RTL code, and the corresponding frequency division coefficient register will be generated in the generated register table. When generating the SDC timing constraint file, the output end of the frequency divider outputs a new clock description;
[0070] In the BUF / CG and CG DEF columns of the second hardware configuration table, fill in whether clock gating is required:
[0071] 1) If clock gating is required, fill in CG in the BUF / CG column. A clock gating unit will be inserted in the process of generating RTL code, and the corresponding gating register will be generated in the generated register table. When generating the SDC timing constraint file, the output end of the clock gating unit will output a new clock description;
[0072] If a clock gating unit is inserted, fill in 0 or 1 in the CG DEF column as the default value of the clock gating, which will be output to the generated register table;
[0073] 2) If clock gating is not required, fill in BUF in the BUF / CG column. A buffer unit will be inserted during the RTL code generation process, and a new clock description will be output at the output of the buffer unit when the SDC timing constraint file is generated.
[0074] In order to better illustrate the technical solution of this application, the specific form of the second hardware configuration table is given below:
[0075] Table 2 Second hardware configuration table
[0076] CLKNAME GRPNUM CLKA CLKB CLKC USER DIV BUF / CG CGDEF ip_a_clk 0 Y Y / D BUF ip_b_clk 1 Y / D C CG 1 ip_c_clk 2 Y / D 2 CG 1 ip_d_clk 0 ip_a_clk CG 1
[0077] ③Configure the input parameters of the Perl script, including:
[0078] The input parameters of the configuration Perl script include the paths of the first hardware configuration table and the second hardware configuration table, and the names and locations of the generated RTL code, register table, and SDC timing constraint files.
[0079] ④ Based on the command line mode input running code, the system executes the Perl script according to the input parameters, including:
[0080] 1) Based on the command line mode input running code, the system executes the Perl script according to the input parameters, the Perl script captures the information in the first hardware configuration table and the second hardware configuration table, generates RTL code, and calls the clock processing unit in the IP library;
[0081] Among them, Figure 2 As shown, the clock processing unit includes a selector MUX, a frequency divider DIV, and a clock gating / buffer CG / BUF connected in sequence, the input end of the selector MUX inputs the source clocks CLKA, CLKB, CLKC, and the output end of the clock gating / buffer CG / BUF outputs the IP clock signal IP CLK;
[0082] In the process of generating the IP clock signal IP CLK, if only a single source clock is needed, the selector MUX is not needed; if clock division is not needed, the divider DIV is not needed; if clock gating CG is not needed, the buffer BUF is used;
[0083] 2) Based on the command line mode input running code, the system executes the Perl script according to the input parameters, the Perl script captures all the information in the first hardware configuration table and the second hardware configuration table as configuration information, and generates RTL code text, a register table with default values, and SDC timing constraint text according to the configuration information;
[0084] The register table includes selection registers, frequency division coefficient registers, gate registers, and default values of each control register. The developer generates a register control module based on the register table.
[0085] The SDC timing constraint file includes the creation description of each source clock, the generation description of each IP core generated clock and intermediate clock, and the group setting for each IP core generated clock.
[0086] ⑤ Check the RTL code, register table and SDC timing constraint file generated after the Perl script is run. If there are any problems, the Perl script will give prompts.
[0087] Specifically, check the RTL code, register table, and SDC timing constraint file generated after the Perl script is run. If there is a problem, the Perl script will give a prompt, including:
[0088] Use the automatic instantiation function of the Emacs plug-in to generate the synthesizable code of the required clock management module;
[0089] The RTL code complies with the Emacs Verilog-mode automatic instantiation format.
[0090] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for automatically generating a clock management module of a system on chip (SoC), characterized by: The following steps are involved: S1, collecting source clock information of the system on chip SoC, and filling the collected source clock information into the first hardware configuration table; S2, collecting clock information of each IP core of the system on chip SoC, and filling the collected clock information into the second hardware configuration table; S3. Configure the input parameters of the Perl script; S4, based on the command line mode input running code, the system executes the Perl script according to the input parameters; S5. Check the RTL code, register table, and SDC timing constraint file generated after the Perl script is run. If there are any problems, the Perl script will give prompts.
2. The method for automatically generating a system-on-chip (SoC) clock management module according to claim 1, characterized in that: Before collecting source clock information of the system on chip SoC and filling the collected source clock information into the first hardware configuration table in S1, the method includes: Configure the system environment, install the software tools Perl and Emacs, and add corresponding environment variables and path variables in the system configuration file.
3. The method for automatically generating a system-on-chip (SoC) clock management module according to claim 1, characterized in that: S1 collects source clock information of the system on chip SoC and fills the collected source clock information into the first hardware configuration table, including: The source clock information of the system on chip SoC is collected, including all source clocks used as clock sources and corresponding frequency information, and the collected source clock information is filled into the first hardware configuration table.
4. The method for automatically generating a system-on-chip (SoC) clock management module according to claim 3, characterized in that: Fill in the name of each source clock in the CLOCK row of the first hardware configuration table, and fill in the frequency value of each source clock in the FREQ row of the first hardware configuration table; Among them, the number of source clocks, source clock names and source clock frequencies can be increased, decreased or deleted according to design requirements.
5. The method for automatically generating a system-on-chip (SoC) clock management module according to claim 1, characterized in that: S2 collects the clock information of each IP core of the system on chip SoC, and fills the collected clock information into the second hardware configuration table, including: Collect the clock information of each IP core of the system on chip SoC, including the required source clock, whether division is required, whether the division coefficient is fixed or configurable, whether clock gating is required and the default value of clock gating, and fill the collected clock information into the second hardware configuration table.
6. The method for automatically generating a system-on-chip (SoC) clock management module according to claim 5, characterized in that: The CLKNAME column of the second hardware configuration table is filled with the name of the clock that each IP core needs to generate, and the GRPNUM column of the second hardware configuration table represents the group number to which the generated clock is assigned in the SDC timing constraint file; Fill in the source clocks required by each IP core in the CLKA, CLKB, CLKC, and USER columns of the second hardware configuration table: 1) If a source clock is required, fill in Y in the corresponding column of CLKA, CLKB, CLKC; if a source clock is used as the default clock source, fill in Y / D in the corresponding column of CLKA, CLKB, CLKC; Among them, each IP core can select multiple source clocks. In the process of generating RTL code, a multi-input selector will be generated for the IP core. The selected source clock is input into the input end of the selector, and the corresponding selection register will be generated in the generated register table. When generating the SDC timing constraint file, the output end of the selector outputs the new clock description; 2) If you directly use the clock generated by another IP core as the clock source, do not fill in the CLKA, CLKB, and CLKC columns, and fill in the name of the IP core that needs to generate the clock in the USER column. During the RTL code generation process, the clock that needs to be generated by this IP core will be directly connected to the clock generated by the IP core that is the clock source, so as to reduce the use of selectors and dividers, and save chip area and power consumption; Fill in the required frequency division multiple in the DIV column of the second hardware configuration table, or fill in C, which means that a software-configurable frequency division multiple is required. The corresponding frequency divider will be inserted in the process of generating RTL code, and the corresponding frequency division coefficient register will be generated in the generated register table. When generating the SDC timing constraint file, the output end of the frequency divider outputs a new clock description; In the BUF / CG and CG DEF columns of the second hardware configuration table, fill in whether clock gating is required: 1) If clock gating is required, fill in CG in the BUF / CG column. A clock gating unit will be inserted in the process of generating RTL code, and the corresponding gating register will be generated in the generated register table. When generating the SDC timing constraint file, the output end of the clock gating unit will output a new clock description; If a clock gating unit is inserted, fill in 0 or 1 in the CG DEF column as the default value of the clock gating, which will be output to the generated register table; 2) If clock gating is not required, fill in BUF in the BUF / CG column. A buffer unit will be inserted during the RTL code generation process, and a new clock description will be output at the output of the buffer unit when the SDC timing constraint file is generated.
7. The method for automatically generating a system-on-chip (SoC) clock management module according to claim 1, characterized in that: The input parameters for configuring the Perl script in S3 include: The input parameters of the configuration Perl script include the paths of the first hardware configuration table and the second hardware configuration table, and the names and locations of the generated RTL code, register table, and SDC timing constraint files.
8. The method for automatically generating a system-on-chip (SoC) clock management module according to claim 1, characterized in that: S4 runs code based on command line input. The system executes Perl scripts based on input parameters, including: Based on the command line mode input running code, the system executes the Perl script according to the input parameters, the Perl script captures the information in the first hardware configuration table and the second hardware configuration table, generates RTL code, and calls the clock processing unit in the IP library; The clock processing unit includes a selector MUX, a frequency divider DIV, and a clock gating / buffer CG / BUF connected in sequence, the input end of the selector MUX inputs the source clocks CLKA, CLKB, CLKC, and the output end of the clock gating / buffer CG / BUF outputs the IP clock signal IP CLK; In the process of generating the IP clock signal IP CLK, if only a single source clock is required, the selector MUX is not required; if clock division is not required, the divider DIV is not required; if clock gating CG is not required, the buffer BUF is used.
9. The method for automatically generating a system-on-chip (SoC) clock management module according to claim 8, characterized in that: S4 runs code based on command line input. The system executes Perl scripts based on input parameters, including: Based on the command line mode input running code, the system executes the Perl script according to the input parameters, the Perl script captures all the information in the first hardware configuration table and the second hardware configuration table as configuration information, and generates RTL code text, a register table with default values, and SDC timing constraint text according to the configuration information; The register table includes selection registers, frequency division coefficient registers, gate registers, and default values of each control register. The developer generates a register control module based on the register table. The SDC timing constraint file includes the creation description of each source clock, the generation description of each IP core generated clock and intermediate clock, and the group setting for each IP core generated clock.
10. The method for automatically generating a system-on-chip (SoC) clock management module according to claim 1, characterized in that: In S5, check the RTL code, register table, and SDC timing constraint file generated after the Perl script is run. If there is a problem, the Perl script will give a prompt, including: Use the automatic instantiation function of the Emacs plug-in to generate the synthesizable code of the required clock management module; The RTL code complies with the Emacs Verilog-mode automatic instantiation format.
Citation Information
Cited By
Method, device and equipment for automatically generating chip power consumption management controller
CN120163122A
Chip clock data handling apparatus, method and system
CN122864279A
