A FPGA Architecture Visualization Method

By constructing and optimizing the use of memory resources and generating visual files, it solves the problems of insufficient memory management and poor interactive experience in FPGA design with traditional tools, and improves work efficiency and data processing speed.

CN118153496BActive Publication Date: 2024-09-13ZHONGKEXIN MAGNETIC TECH (ZHUHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410568254.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-09
Publication Date
2024-09-13
Estimated Expiration
2044-05-09

AI Technical Summary

Technical Problem

When dealing with ultra-large-scale FPGA designs, traditional visualization tools face problems such as insufficient memory management, poor interactive experience, and slow data processing, resulting in low chip design efficiency.

Method used

By obtaining the target architecture file and resource mapping file, construct two-dimensional arrays and matrices, generate key-value mapping dictionaries, optimize the use of memory resources, and use this information to generate visualization files, reduce memory resource waste and improve work efficiency.

Benefits of technology

It effectively reduces memory resource pressure and waste, improves the visualization efficiency and work efficiency of FPGA design, and provides a convenient interactive experience and data processing method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118153496B
    Figure CN118153496B
Patent Text Reader

Abstract

The present invention provides an FPGA architecture visualization method, which relates to the field of FPGA design. The method comprises: obtaining a first loading instruction, loading a target architecture file for describing the FPGA architecture and a resource mapping file for mapping hardware resources, constructing a first two-dimensional array based on the target architecture file and the resource mapping file, instantiating each basic construction unit based on the first two-dimensional array, releasing resources of the first two-dimensional array after generating a first matrix, constructing a first key-value mapping dictionary based on the first matrix, releasing resources of the first matrix after generating the first key-value mapping dictionary, and generating a visualization file according to information in the first key-value mapping dictionary, so as to help users improve work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of FPGA design, and in particular to a FPGA architecture visualization method. Background Art

[0002] With the rapid development of technology, the scale and complexity of chip design are growing exponentially. Traditional visualization tools are difficult to meet the needs of modern chip design in terms of performance and efficiency. Especially when dealing with ultra-large-scale FPGA designs, designers and engineers face problems such as insufficient memory management, poor interactive experience, and slow data processing, which greatly limits the efficiency of chip design. In view of the lack of efficient visualization tools for large-scale chips, a solution that can handle the growing scale of chip design is urgently needed. Summary of the invention

[0003] In view of the above technical problems, the technical solution adopted by the present invention is:

[0004] A method for visualizing an FPGA architecture, the method comprising the following steps:

[0005] S1: Obtain a first loading instruction to load a target architecture file for describing an FPGA architecture and a resource mapping file for mapping hardware resources.

[0006] S2: Based on the target architecture file and the resource mapping file, construct a first two-dimensional array, wherein the first two-dimensional array is used to record the location information and type information of each basic construction unit in sequence.

[0007] S3: Based on the position information and type information of each basic construction unit recorded in the first two-dimensional array, each basic construction unit is instantiated, an instance corresponding to each basic construction unit is generated, and a first matrix is ​​generated, wherein the first matrix includes the position information, color information, site information and clock information of each basic construction unit.

[0008] S4: Release the resources of the first two-dimensional array.

[0009] S5: constructing a first key-value mapping dictionary based on the first matrix; wherein the key of the first key-value mapping dictionary is the location information of each basic construction unit, and the value of the first key-value mapping dictionary is the instance corresponding to each basic construction unit.

[0010] S6: Release the resources of the first matrix.

[0011] S7: Generate a visualization file according to the information in the first key-value mapping dictionary.

[0012] The present invention has at least the following beneficial effects:

[0013] When visualizing the target architecture file, first obtain the first loading instruction, load the target architecture file and the resource mapping file for mapping hardware resources according to the first loading instruction, and construct the first two-dimensional array according to the target architecture file and the resource mapping file, then generate the first matrix according to the first two-dimensional array, and release the resources of the first two-dimensional array to reduce the pressure of memory resources. Then generate the first key-value mapping dictionary according to the first matrix, and release the memory resources of the first matrix to reduce the pressure of memory resources, and finally construct the visualization file according to the information in the first key-value mapping dictionary, which reduces the waste of memory resources, and the visualization method is more convenient and improves work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0015] Figure 1 A flow chart of a FPGA architecture visualization method provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0017] Reference Figure 1 , an embodiment of the present invention provides a FPGA architecture visualization method, comprising the following steps:

[0018] S1: Obtain a first loading instruction to load a target architecture file for describing an FPGA architecture and a resource mapping file for mapping hardware resources.

[0019] Specifically, the first loading instruction is an instruction to select the "load architecture information" button in the software. After the selection, the technicians in this field determine the target architecture file according to actual needs. The first loading instruction can be input through a human-computer interaction device such as a mouse, keyboard, touch screen, etc., which will not be repeated here.

[0020] Specifically, the resource mapping file is used to describe the color, size and other information of each subsequent module.

[0021] S1 includes the following steps:

[0022] S11: After acquiring the first loading instruction, locate to a first preset folder, wherein the first preset folder contains the architecture file to be loaded.

[0023] Specifically, the first preset folder is a folder set by technical personnel in the field for storing architecture files. Technical personnel in the field can change the path of the first preset folder according to their own needs. In this embodiment, the default path of the first preset folder is the resource folder under the root directory of the software. Technical personnel in the field can also choose other folders.

[0024] S12: Obtain a first selection instruction input by the user, and use the architecture file selected by the first selection instruction as the target architecture file.

[0025] S12 includes the following steps:

[0026] S121: Triggering a file selection dialog box.

[0027] S122: Filter out files in the first preset folder that are in a format different from that of the architecture file to be loaded through a filter, so that the file selection dialog box only displays files in the same format as that of the architecture file to be loaded.

[0028] S123: Obtain the architecture file selected by the user.

[0029] S124: Determine whether the architecture file selected by the user is a correct architecture file. If so, use the architecture file selected by the user as the target architecture file.

[0030] S125: When it is determined that the architecture file selected by the user is an incorrect architecture file, an error prompt message is generated and S123 is re-executed.

[0031] Specifically, the function of filtering files having a format different from that of the architecture file to be loaded is implemented through Qt's file dialogue component QFileDialog and a filter.

[0032] As described above, only preset fixed-type files are displayed, which reduces the probability of users selecting the wrong file type and improves robustness.

[0033] Specifically, in this embodiment, the architecture file format is in json format.

[0034] As mentioned above, the json format is clear and easy to read. It can be opened and viewed or edited directly in the code editor, which is convenient for developers and users to view and understand the data content. Almost all programming languages ​​provide json parsing libraries, which means that no matter which language other users are good at, they can easily read and process json data. And json has a fast parsing speed and can load and process data efficiently. Data in json format is easy to modify and expand, and new attributes can be added without changing the existing data structure. To support new chips or new resource types, just add or update the relevant entries in the json file. json is one of the standard formats for front-end and back-end communication. Even if the service needs to be deployed in the cloud, the server and client can easily exchange data through json, which facilitates data synchronization between the server and the client. json files are text files, which makes them very convenient to port between different systems and networks, share data between different software and tools, and promote the interoperability and portability of the tool chain. The data structure and attributes of the architecture resources are standardized, and other developers can focus on other key functions of the software instead of dealing with compatibility issues of data formats. In multi-person collaborative projects, standardized data structures help reduce communication costs and improve development efficiency. JSON files are easy to incorporate into version control systems, such as Git, to facilitate tracking of historical changes and collaborative work. Modifications to files can be clearly displayed through differences, which facilitates code review and change management. JSON objects are usually self-describing, containing key-value pairs, where the key describes the purpose of the value, which makes the purpose and usage of the data structure more obvious. Without the need for additional metadata or schema definition, developers can understand the structure and intent of the data directly from the JSON data.

[0035] Specifically, the first selection instruction may be inputted by a mouse, a touch screen or other devices capable of performing information interaction with a computer, which will not be described in detail herein.

[0036] As described above, when a technician in this field selects an architecture file that is not in json format, an error prompt message is generated to remind the technician in this field, thereby reducing the probability of loading an erroneous architecture file and improving work efficiency.

[0037] S2: Based on the target architecture file and the resource mapping file, a first two-dimensional array is constructed, where the first two-dimensional array is used to sequentially record the location information and type information of each basic construction unit.

[0038] S3: Based on the position information and type information of each basic construction unit recorded in the first two-dimensional array, each basic construction unit is instantiated, an instance corresponding to each basic construction unit is generated, and a first matrix is ​​generated, wherein the first matrix includes the position information, color information, site information and clock information of each basic construction unit.

[0039] S4: Release the resources of the first two-dimensional array.

[0040] As described above, after the first matrix is ​​constructed, the memory resources occupied by the first two-dimensional array are released, thereby reducing the occupation of memory resources and optimizing the memory usage efficiency.

[0041] S5: Based on the first matrix, construct a first key-value mapping dictionary, where the key of the first key-value mapping dictionary is the location information of each basic construction unit, and the value of the first key-value mapping dictionary is the instance corresponding to each basic construction unit.

[0042] As described above, constructing the first key-value mapping dictionary according to the first matrix can optimize the access speed and facilitate subsequent rapid retrieval and updating of the status of the basic construction unit.

[0043] S6: Release the resources of the first matrix.

[0044] As described above, after the first key-value mapping dictionary is constructed, the memory resources occupied by the first matrix are released, which further reduces the occupation of memory resources and optimizes the usage efficiency.

[0045] S7: Generate a visualization file according to the information in the first key-value mapping dictionary.

[0046] Specifically, this embodiment uses the Qt5 graphical interface for visualization. The Qt5 graphical interface will draw the physical layout of the FPGA based on the basic construction units and corresponding instances stored in the first key-value mapping dictionary, and generate visual features such as size and color of the target architecture file in combination with the resource mapping file, so that the graphical interface is more intuitive, which is convenient for technical personnel in this field to efficiently process complex FPGA structures and improve work efficiency.

[0047] S8: Visually displaying the chip architecture according to the visualization file, including:

[0048] The visualization file is analyzed to obtain architecture information of the chip, wherein the architecture information includes dimension and size data of the chip.

[0049] According to the architecture information of the chip, the view layout on the display interface is automatically adjusted so that the entire chip architecture is properly displayed on the display interface.

[0050] As described above, the view layout on the display interface is appropriately displayed according to the architecture information of the chip, which is helpful for the user to control the architecture of the chip during the design process.

[0051] S9: Manually adjust the view of the chip architecture on the display interface according to the adjustment instruction.

[0052] S9 includes the following steps:

[0053] S91: Acquire adjustment instructions, which include interactive zoom instructions, view rotation instructions, module highlighting and information prompting instructions, and dynamic rendering instructions.

[0054] S92: When the adjustment instruction is an interactive zoom instruction, switching the macro overview and micro details on the display interface according to the interactive zoom instruction, wherein the interactive zoom instruction includes the user sliding a mouse wheel to zoom in or out the view.

[0055] S93: When the adjustment instruction is a view rotation instruction, the chip view on the display interface is rotated according to the view rotation instruction to display the architecture layout from different angles.

[0056] S94: When the adjustment instruction is a module highlighting and information prompting instruction, a specific module and the name of the specific module are highlighted on the display interface according to the module highlighting and information prompting instruction, wherein the module highlighting and information prompting instruction includes the user hovering the mouse over the specific module.

[0057] S95: When the adjustment instruction is a dynamic rendering instruction, dynamically render the chip view on the display interface.

[0058] As mentioned above, when rendering is performed in a dynamic rendering manner, the view on the display area will be dynamically rendered as the user operates. This means that every action of the user - whether it is zooming, rotating or module querying - will be reflected instantly on the interface, without waiting for a long time to load, further improving work efficiency.

[0059] Specifically, it also includes:

[0060] When it is detected that the user focuses on a certain position of the chip with the mouse, the user zoom level is dynamically calculated:

[0061] When zoomed in to a first preset multiple, the module names within the current display interface are displayed.

[0062] Specifically, the steps of displaying the module names within the current display interface include:

[0063] When the module name hiding instruction is obtained, the module name in the display area is hidden.

[0064] When the module name display instruction is obtained, the module name hidden in the display area is displayed.

[0065] As described above, the module names in the display area are displayed or hidden according to actual needs, which is convenient for designers to design chip layout.

[0066] Additionally, the following steps are included:

[0067] When the internal module display instruction is obtained and the image is enlarged to a second preset multiple, the internal site information of the logical resource is displayed, wherein the site information is pre-defined in the architecture file and the resource mapping file.

[0068] When the internal module hiding instruction is obtained, the site information of the internal module displayed in the display area is hidden.

[0069] Among them, the first preset multiple and the second preset multiple are set by technicians in this field according to actual needs, and will not be repeated here.

[0070] The present embodiment provides a method for visualizing an FPGA architecture. When visualizing a target architecture file, first obtain a first loading instruction, load the target architecture file and a resource mapping file for mapping hardware resources according to the first loading instruction, and construct a first two-dimensional array according to the target architecture file and the resource mapping file. Then, generate a first matrix according to the first two-dimensional array, and release the resources of the first two-dimensional array to reduce the pressure of memory resources. Then, generate a first key-value mapping dictionary according to the first matrix, and release the memory resources of the first matrix to reduce the pressure of memory resources. Finally, construct a visualization file according to the information in the first key-value mapping dictionary, which reduces the waste of memory resources, and the visualization method is more convenient and improves work efficiency.

[0071] Although some specific embodiments of the present invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be appreciated by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A method for visualizing an FPGA architecture, characterized in that: The method comprises the following steps: S1: Obtain a first loading instruction to load a target architecture file for describing an FPGA architecture and a resource mapping file for mapping hardware resources; S2: constructing a first two-dimensional array based on the target architecture file and the resource mapping file, wherein the first two-dimensional array is used to sequentially record the location information and type information of each basic construction unit; S3: based on the position information and type information of each basic construction unit recorded in the first two-dimensional array, instantiate each basic construction unit, generate an instance corresponding to each basic construction unit, and generate a first matrix, wherein the first matrix includes the position information, color information, site information, and clock information of each basic construction unit; S4: releasing the resources of the first two-dimensional array; S5: constructing a first key-value mapping dictionary based on the first matrix; wherein the key of the first key-value mapping dictionary is the location information of each basic construction unit, and the value of the first key-value mapping dictionary is the instance corresponding to each basic construction unit; S6: releasing resources of the first matrix; S7: Generate a visualization file according to the information in the first key-value mapping dictionary.

2. The method according to claim 1, characterized in that The S1 comprises the following steps: S11: After acquiring the first loading instruction, locate a first preset folder, wherein the first preset folder contains the architecture file to be loaded; S12: Obtain a first selection instruction input by the user, and use the architecture file selected by the first selection instruction as the target architecture file.

3. The method according to claim 2, characterized in that in, The step S12 comprises: S121: triggering the file selection dialog box; S122: filtering out files in the first preset folder that have a different format from the architecture file to be loaded through a filter, so that the file selection dialog box only displays files that have the same format as the architecture file to be loaded; S123: Obtaining the architecture file selected by the user; S124: Determine whether the architecture file selected by the user is a correct architecture file. If so, use the architecture file selected by the user as the target architecture file.

4. The method according to claim 3, characterized in that: The method further comprises: S125: When it is determined that the architecture file selected by the user is an incorrect architecture file, an error prompt message is generated and S123 is re-executed.

5. The method according to claim 1, characterized in that: The method further comprises: S8: Visually displaying the chip architecture according to the visualization file, including: Analyze the visualization file to obtain chip architecture information, wherein the architecture information includes dimension and size data of the chip; According to the architecture information of the chip, the view layout on the display interface is automatically adjusted so that the entire chip architecture is properly displayed on the display interface.

6. The method according to claim 5, characterized in that The method further comprises: S9: Manually adjust the view of the chip architecture on the display interface according to the adjustment instruction.

7. The method according to claim 6, characterized in that Also includes: S9: Manually adjust the visualization file according to the adjustment instruction, including: Obtain adjustment instructions, including interactive zoom instructions, view rotation instructions, module highlighting and information prompt instructions, and dynamic rendering instructions; When the adjustment instruction is an interactive zoom instruction, switching the macro overview and micro details on the display interface according to the interactive zoom instruction, wherein the interactive zoom instruction includes the user sliding a mouse wheel to zoom in or out the view; When the adjustment instruction is a view rotation instruction, the chip view on the display interface is rotated according to the view rotation instruction to display the architecture layout from different angles; When the adjustment instruction is a module highlighting and information prompting instruction, highlighting a specific module and the name of the specific module on the display interface according to the module highlighting and information prompting instruction, wherein the module highlighting and information prompting instruction includes the user hovering the mouse over the specific module; When the adjustment instruction is a dynamic rendering instruction, the chip view on the display interface is dynamically rendered.

8. The method according to claim 7, characterized in that The method further comprises: When it is detected that the user focuses on a certain position of the chip with the mouse, the user zoom level is dynamically calculated: When zoomed in to a first preset multiple, the module names within the current display interface are displayed.

9. The method according to claim 7 or 8, characterized in that: The method further comprises: When the module name hiding instruction is obtained, the module name in the display area is hidden; When the module name display instruction is obtained, the module name hidden in the display area is displayed.

10. The method according to claim 6, characterized in that The method further comprises: The adjustment instructions also include internal module site information display instructions and internal module site information hiding instructions. When the internal module site information display instruction is obtained and the image is magnified to a second preset multiple, the internal site information of the logical resource is displayed, wherein the site information is pre-defined in the architecture file and the resource mapping file; When the internal module site information hiding instruction is obtained, the site information of the internal module displayed in the display area is hidden.