A method for automatically generating IP core GUI based on XML
The IP core GUI is automatically generated through an XML-based method, which solves the problems of complex GUI development and difficult maintenance in the existing technology, achieves the effect of simplifying development and improving efficiency, and is suitable for designers who are not familiar with GUI.
Patent Information
- Application Number
- CN202111528719.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-12-14
AI Technical Summary
In the existing technology, GUI development of IP cores requires a large amount of code and programmers to be familiar with multiple languages, resulting in complex development and unfavorable maintenance. Especially when new IP cores need to be modified or added, designers are overburdened.
Using an XML-based method, the GUI control of the IP core is generated by reading and analyzing XML files, and the layout and display interface are automatically calculated. It is suitable for zero-based designers and simplifies the GUI development process.
It realizes that the graphical user interface of IP core can be automatically generated without programmers being familiar with GUI language, which reduces the development workload, improves efficiency, and allows only one development to adapt to the needs of different IP cores.
Smart Images

Figure CN114327452B
Abstract
Description
Technical Field
[0001] The invention relates to a method for automatically generating an IP core GUI based on XML, and belongs to the technical field of electronic design automation. Background Art
[0002] An IP core (Intellectual Property Core, abbreviated as IP core) is a logic function block or data block used to build an application-specific integrated circuit (ASIC) or field-programmable logic device (FPGA). It is a repeatedly verified macromodule with specific functions, independent of the chip manufacturing process, and can be ported to different semiconductor processes. IP cores are functionally categorized into basic modules, communication network modules, digital signal processing modules, digital budget capability modules, memory modules, controller and peripheral modules, protocol processing modules, and standard bus modules.
[0003] With the advancement of FPGA technology, chip performance is increasing, chip scale is increasing, and development cycles are lengthening. This has led to a series of new challenges for chip design: difficult to control design quality and rising design costs. Common but complex functional modules in digital circuits (such as FIR filters, SDRAM controllers, and PCI interfaces) are being designed as IP cores with modifiable parameters. Chip designers can directly call these pre-designed and verified IP cores. Calling IP cores avoids duplication of work, significantly reduces the burden on designers, and improves work efficiency. Therefore, the use of IP cores is a growing trend, and the reuse of IP cores significantly shortens product time to market.
[0004] A graphical user interface (GUI) is a computer user interface that uses graphics. The various elements that make up a GUI are called controls. Friendly, easy-to-use GUIs play a crucial role in enabling chip designers to view and configure IP core parameters.
[0005] Due to the wide variety of IP cores, each with its own unique properties and parameters, the corresponding interface for each IP core is also unique. Currently, some EDA vendors use a completely coded approach to develop and design the GUI for each IP core. Each interface requires a significant amount of code to implement, which undoubtedly increases the burden on programmers. Furthermore, if the interface needs to be modified, the code must be re-modified, compiled, and then released, which is inconvenient for maintenance. Some vendors also use the Tool Command Language (TCL) to implement interaction with the GUI, dynamically configuring the interface by modifying TCL control files. This approach is somewhat effective for existing IP cores and when the control layout on the GUI remains unchanged. However, if a new IP core becomes available, or if the GUI display needs to be changed based on user needs, programmers must redevelop the interface and be familiar with both TCL and the language used to develop the GUI. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to provide a method for automatically generating a graphical user interface corresponding to an IP core, which is suitable for any designer who has no basic knowledge of GUI.
[0007] In order to solve the above technical problems, the technical solution proposed by the present invention is: a method for automatically generating an IP core GUI based on XML, performing the following steps:
[0008] 1) Read XML file; read the XML file describing the IP core information selected by the user into the system;
[0009] 2) Check the format of the read XML file to confirm whether it conforms to the XML file format and whether the IP core information is marked with attributes or parameters;
[0010] 3) Analyze the information in the XML file after the inspection and generate the controls required for GUI drawing;
[0011] 4) Calculate and obtain the layout of each control on the GUI, including the display reference value h, the GUI display area, the length of each control length, the height ch and width cw of each control, and the total control area size;
[0012] 5) Create corresponding controls and display the data calculated in step 4);
[0013] 6) All controls are displayed, that is, the IP core GUI display is completed.
[0014] A further improvement to the above solution is that the rules for generating each control in step 3) are as follows:
[0015] ① A Label control is generated for the name of each node except the value node;
[0016] ② When node type=property, if the node has modify="true" description, a Textbox control is generated, otherwise a Label control is generated;
[0017] ③ When node type=param, if there are child nodes and multi="true" description, the child nodes will generate corresponding Checkbox controls;
[0018] ④ When node type=param, if there is a child node without multi="true" description,
[0019] When the number of child nodes is greater than or equal to 3, a Combo box control is generated;
[0020] When the number of child nodes is less than 3, the child nodes generate corresponding Radio button controls;
[0021] ⑤ When node type=param, if the node has min and max values, a Spin box control is generated;
[0022] ⑥Except for the value node, when the node level is greater than 3, generate the corresponding Group box control. The number of generated Group box controls is equal to the number of node levels minus 2. At the same time, delete the corresponding Label control generated in ①.
[0023] ⑦If the node has description information, a Label control is generated accordingly;
[0024] ⑧Record the order of the corresponding generated controls according to the node order.
[0025] A further improvement of the above solution is: if the total area of the controls is larger than the GUI display area, a Tab control is added.
[0026] The beneficial effects of the present invention are as follows: the method uses an XML file to describe the properties of an IP core, automatically analyzes the control properties and quantity required to depict a GUI by reading the XML file, calculates the layout of the controls on the interface based on the control properties and quantity, and finally generates a visual user graphical interface. This solves the problem of requiring separate development of a GUI for each IP core, reduces the development workload for GUI developers, and even requires only a single development step. XML only needs to describe information about the IP core, not the GUI. Chip designers who are unfamiliar with GUIs can also customize the GUI of their own IP cores, for example, by displaying only a specific attribute or parameter of interest on the GUI, which facilitates development work. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 The present invention is a flowchart of a method for automatically generating an IP core GUI based on XML according to an embodiment of the present invention.
[0028] Figure 2 This is an example diagram of the XML format of an embodiment of the present invention.
[0029] Figure 3 The present invention is an embodiment of an XML file analysis method for automatically generating an IP core GUI based on XML.
[0030] Figure 4 The present invention is a flow chart of the calculation space layout of a method for automatically generating an IP core GUI based on XML according to an embodiment of the present invention.
[0031] Figure 5 The present invention is an embodiment of a method for automatically generating an IP core GUI based on XML. Figure 2 The GUI effect diagram is generated as an example of the XML format sample diagram. DETAILED DESCRIPTION
[0032] Example 1
[0033] This embodiment provides a method for automatically generating an IP core GUI based on XML, such as Figure 1 As shown, perform the following steps:
[0034] 1) Read XML file; read the XML file describing the IP core information selected by the user into the system;
[0035] 2) Check the format of the read XML file to confirm whether it conforms to the XML file format and whether the IP core information is marked with attributes or parameters;
[0036] 3) Analyze the information in the XML file after the inspection and generate the controls required for GUI drawing;
[0037] The generation process is as follows Figure 3 As shown, the rules for generating each control are as follows:
[0038] ① A Label control is generated for the name of each node except the value node;
[0039] ② When node type=property, if the node has modify="true" description, a Textbox control is generated, otherwise a Label control is generated;
[0040] ③ When node type=param, if there are child nodes and multi="true" description, the child nodes will generate corresponding Checkbox controls;
[0041] ④ When node type=param, if there is a child node without multi="true" description,
[0042] When the number of child nodes is greater than or equal to 3, a Combo box control is generated;
[0043] When the number of child nodes is less than 3, the child nodes generate corresponding Radio button controls;
[0044] ⑤ When node type=param, if the node has min and max values, a Spin box control is generated;
[0045] ⑥Except for the value node, when the node level is greater than 3, generate the corresponding Group box control. The number of generated Group box controls is equal to the number of node levels minus 2. At the same time, delete the corresponding Label control generated in ①.
[0046] ⑦If the node has description information, a Label control is generated accordingly;
[0047] ⑧Record the order of the corresponding generated controls according to the node order;
[0048] 4) Calculate and obtain the layout of each control on the GUI, including the display reference value h, GUI display area, the length of each control length, the height ch and width cw of each control, and the total area size of the control; the process is as follows Figure 4 As shown,
[0049] ① Set a display reference value h and GUI display area Size (GH, GW).
[0050] ②Calculate the length of the content displayed by each control;
[0051] ③ Set the control height to ch=h and the control width to cw=h*length. If the control width cw is larger than the GUI area width GW, reset the control height to ch=h(cw / GW +1) and the control width to w=h*length / ch.
[0052] ④Calculate the total area size required to depict the control = add the area of each control;
[0053] ⑤ If the total control area size is larger than the GUI display area size, add a Tab control. The number of Tab controls to be increased is size / size + 1.
[0054] ⑥ Set the coordinates of the controls from top to bottom according to the order of the controls;
[0055] ⑦The vertical coordinates of the controls generated by each node in the XML are the same, that is, multiple controls generated by the same node will be arranged horizontally side by side;
[0056] 5) Create corresponding controls and display the data calculated in step 4);
[0057] 6) All controls are displayed, that is, the IP core GUI display is completed.
[0058] by Figure 2 The XML format example of the input is the XML describing the IP core information. First, the XML is checked to see if it conforms to the format required in process flow 2.
[0059] Analyzing this XML will generate nine Label controls, one Textbox control, one Combo box control, three Spin box controls, and three Group box controls. Delete the corresponding three Label controls. For example, if a Group box control named Base is generated, there will no longer be a Label control named Base. Calculate the corresponding control positions based on the calculation process.
[0060] The final implementation is as follows Figure 5 The GUI effect diagram is shown in the figure. The dotted part is the screen automatically generated based on XML. Because the framework used to develop the GUI in this example is QT, QT has layout controls that will adjust the position of controls, making the space layout more beautiful and neat.
[0061] XML (Extensible Markup Language) is a well-known set of rules and guidelines for describing structured data in plain text. XML is a simple, efficient, platform-independent, and widely adopted standard. It uses a set of tags to describe data elements. Each element encapsulates data that can be very simple or very complex, and an unlimited set of XML tags can be defined.
[0062] Since the relationship between elements and attributes in XML files is very similar to the hierarchical and nested relationship between various elements (controls) that constitute a graphical interface, using XML to describe the user graphical interface (GUI) is also a very effective method. However, this still requires users or developers to be familiar with the controls on the GUI.
[0063] The method of this embodiment is applicable to any designer who is not familiar with GUI, and the designer can easily customize the GUI of the IP core that meets his or her needs, such as displaying only a certain attribute or parameter of interest on the GUI.
[0064] The present invention is not limited to the specific technical solutions described in the above embodiments. In addition to the above embodiments, the present invention may also have other implementation methods. For those skilled in the art, any technical solutions formed by modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for automatically generating an IP core GUI based on XML, characterized in that: Follow these steps: 1) Read XML file; read the XML file describing IP core information selected by the user into the system; 2) Check the format of the XML file read to confirm whether it conforms to the XML file format and whether the IP core information is marked with attributes or parameters; 3) Analyze the information in the XML file after the inspection and generate the controls required for GUI drawing; 4) Calculate and obtain the layout of each control on the GUI, including the display reference value h, the GUI display area, the length of each control, the height ch and width cw of each control, and the total area size of the control; 5) Create corresponding controls and display them according to the information calculated in step 4); 6) All controls are displayed, that is, the GUI display of the IP core is completed; The rules for generating each control in step 3) are as follows: ① A Label control is generated for the name of each node except the value node; ② When node type=property, if the node has modify="true" description, a Textbox control is generated, otherwise a Label control is generated; ③When node type=param, if there are child nodes and multi="true" description, the child nodes will generate corresponding Checkbox controls; ④ When node type=param, if there are child nodes without multi="true" description, When the number of child nodes is greater than or equal to 3, a Combo box control is generated; When the number of child nodes is less than 3, the child nodes generate corresponding Radio button controls; ⑤When node type=param, if the node has min and max values, a Spin box control is generated; ⑥Except for the value node, when the node level is greater than 3, the corresponding Group box control is generated. The number of generated Group box controls is equal to the number of node levels minus 2. At the same time, the corresponding Label control generated in ① is deleted; ⑦If the node has description information, a Label control is generated accordingly; ⑧Record the order of the corresponding generated controls according to the node order.
2. The method for automatically generating an IP core GUI based on XML according to claim 1, characterized in that: If the total area of the controls is larger than the GUI display area, a Tab control is added.
