Port automatic instantiation connection method, device, computer equipment and storage medium

By using a hash table to store and classify port information in the system chip and automatically process port connections, the problems of complicated port connections and poor flexibility in the existing technology are solved, and efficient and reliable port connections are achieved.

CN118331635BActive Publication Date: 2024-09-03LINGSI MICROELECTRONICS (XIAMEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410769591.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-09-03
Estimated Expiration
2044-06-14

AI Technical Summary

Technical Problem

The port connection methods of existing system chips are complicated, rely on template support, and have poor flexibility, resulting in low port connection efficiency.

Method used

By obtaining the input file of the underlying module, detecting preset keywords, storing port information in a hash table, converting and classifying port names, building the top-level module, generating port connection relationships, and realizing automated connections.

Benefits of technology

It reduces dependence on templates, improves design flexibility and scalability, simplifies the connection process, ensures the correctness and reliability of connections, and improves port connection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118331635B
    Figure CN118331635B
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for automatic port instantiation connection, including obtaining an input file of a bottom module, storing the port information corresponding to the input file in a hash table of the bottom module when a preset keyword of the input file is detected; performing name conversion on the corresponding port name according to a port name processing rule to obtain a port standard name, and constructing a top module layer by layer according to the port standard name and its corresponding target top module; modifying the hash table of the corresponding target top module according to the hash table of different bottom modules and the port standard name, generating a top module file according to the hash table of the top module, classifying the ports according to the port group information in the top module file, and traversing the classified ports according to the port standard name to obtain a port connection relationship; and controlling the ports to connect according to the port connection relationship. The present application has the effect of improving the port connection efficiency of the system chip.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of chip integration, and in particular to a method, device, computer equipment and storage medium for automatically instantiating a port. Background Art

[0002] At present, with the development of semiconductor processes and design tools, the automation level of system chips is constantly improving. The implementation method of existing system chips is to first write the top layer, instantiate the required modules in it and write the corresponding code script. The code script will identify the module storage location and port, generate port definition and module instantiation through specific keywords, and for the connection of specific modules, templates are required to specify the connection rules. However, this method relies on templates to support the connection of specific modules, and each top layer needs to be coded separately. Changes in the top layer cause the parent node to need to be regenerated. The workflow is complicated and inflexible, which reduces the port connection efficiency of the system chip.

[0003] The above-mentioned prior art solutions have the following defects: the process of port connection is relatively complicated, which reduces the port connection efficiency of the system chip, so there is room for improvement. Summary of the invention

[0004] In order to improve the port connection efficiency of a system chip, the present application provides a port automatic instantiation connection method, device, computer equipment and storage medium.

[0005] The above-mentioned invention objective of the present application is achieved through the following technical solutions:

[0006] A port automatic instantiation connection method, the port automatic instantiation connection method comprising:

[0007] Obtain input files of multiple bottom-level modules, and when preset keywords of the input files are detected, store port information corresponding to all the input files into a hash table corresponding to the bottom-level modules, wherein the port information includes port name, port group information, port name processing rule and target top-level module;

[0008] Perform name conversion on the corresponding port names according to all the port name processing rules to obtain the port standard names of all ports, and construct the top-level modules layer by layer according to the port standard names of all ports and their corresponding target top-level modules;

[0009] Modifying the hash table corresponding to the target top-level module according to the hash tables of the different bottom-level modules and the standard names of the ports, generating a top-level module file according to the hash table of the top-level module, classifying all the ports according to the port group information in the top-level module file, and traversing the classified ports according to the standard names of the ports to obtain a port connection relationship;

[0010] All the ports are controlled to be connected according to the port connection relationship.

[0011] By adopting the above technical solution, by scanning specific keywords in the input file, the port information area that needs to be processed can be effectively identified, reducing the dependence on templates, so that when the module hierarchy needs to be modified, only the keywords need to be adjusted, which enhances flexibility. By storing the extracted port information in a hash table, it can be quickly accessed and retrieved, which is suitable for code management and adaptation of large projects and increases the adaptability of script processing. By building the top-level modules layer by layer, it can ensure that the structure of the modular design is clear and controllable, reducing the workload of manually writing multiple top-level modules. At the same time, it can adapt to design changes, improve the flexibility and scalability of the design, avoid the need to regenerate the entire top-level module for each modification, and improve development efficiency. By standardizing the port names, it can ensure that the port names between different modules are consistent or partially consistent, which is convenient for subsequent automated connection, simplifies the connection process, improves the connection efficiency, and ensures the correctness and reliability of the connection. By classifying and traversing the ports, it can quickly complete the traversal of all ports according to the port standard names, further improving the efficiency of port connection.

[0012] In a preferred example, the present application may be further configured as follows: before obtaining the input file of the bottom module, it also includes:

[0013] The preset keywords are added to the underlying module by inserting comment codes.

[0014] By adopting the above technical solution, preset keywords are added by inserting comment codes, which reduces the risk of errors caused by manual operations and improves the accuracy of subsequent use of keywords to extract port information. At the same time, it can also improve the fluency and efficiency of the entire design process and simplify the subsequent updates and modifications to the module design.

[0015] In a preferred example, the present application can be further configured as follows: storing the port information corresponding to all the input files into a hash table corresponding to the underlying module specifically includes:

[0016] Generate independent hash tables for all the underlying modules;

[0017] The port information of the input file detected by the underlying module is stored in the hash table corresponding to the underlying module.

[0018] By adopting the above technical solution and generating independent hash tables for all underlying modules, the information of each module can be independently managed and quickly accessed, thereby improving the efficiency and reliability of data processing and preventing data confusion, thereby systematically managing port information, facilitating subsequent processing and connection, and improving the flexibility and efficiency of modular design.

[0019] In a preferred example, the present application can be further configured as follows: modifying the hash table corresponding to the target top-level module according to the hash table of the different bottom-level modules and the port standard name, and generating a top-level module file according to the hash table of the top-level module, specifically including:

[0020] In the case that the target top-level module has a generated top-level module file with the same name, merging the currently generated top-level module file with the original top-level module file with the same name;

[0021] When the target top-level module does not have the top-level module file, the top-level module file is configured into the current top-level module.

[0022] By adopting the above technical solution, when an existing top-level module file is detected, a file merge operation is performed to ensure seamless integration of new and old information, avoiding duplication of work and data redundancy; by dynamically configuring the newly generated top-level module file to add it to the system, the scalability and modular management of the system are improved, thereby further improving the flexibility and efficiency of the design.

[0023] In a preferred example, the present application may be further configured as follows: the classifying of all the ports according to the port group information in the top-level module file specifically includes:

[0024] Acquire the port group information from the top-level module file;

[0025] According to the port group information, the ports with the same port group information are placed in the same group to obtain a first connection group and a second connection group.

[0026] By adopting the above technical solution, by classifying ports according to group information, ports in the same group can be managed and processed in a unified manner, reducing the complexity and error rate of operations, simplifying the port connection process, and at the same time, ensuring the standardization and consistency of port connections.

[0027] In a preferred example, the present application may be further configured as follows: traversing the classified ports according to the port standard names to obtain the port connection relationship specifically includes:

[0028] The first connection group and the second connection group are traversed, and when the standard port names of two ports are the same or similar according to a preset name similarity rule, a connection relationship between the two ports is obtained, until the port connection relationship of all the ports is obtained.

[0029] By adopting the above technical solution, the method of traversing the connection group is used to ensure that each port can find its matching connection port, avoiding the risk of omission and incorrect connection; through the application of standard names and similarity rules, the connection process is made more flexible and intelligent, and can adapt to a variety of naming specifications and design requirements, thereby improving the intelligence and efficiency of automatic port connection, simplifying the operation steps of port connection, and significantly improving the accuracy and reliability of connection, providing an effective solution for the automatic connection of complex systems.

[0030] The second object of the invention is achieved by the following technical solutions:

[0031] A port automatic instantiation connection device, the port automatic instantiation connection device comprising:

[0032] An information extraction module is used to obtain input files of multiple bottom-level modules, and when a preset keyword of the input file is detected, store the port information corresponding to the multiple input files into a hash table corresponding to the bottom-level module, wherein the port information includes a port name, port group information, a port name processing rule and a target top-level module;

[0033] A top-level construction module, used for performing name conversion on the corresponding port names according to all the port name processing rules to obtain the port standard names of all ports, and constructing the top-level modules layer by layer according to the port standard names of all ports and their corresponding target top-level modules;

[0034] A top-level update module, used to modify the hash table corresponding to the target top-level module according to the hash tables of the different bottom-level modules and the port standard names, generate a top-level module file according to the hash table of the top-level module, classify all the ports according to the port group information in the top-level module file, and traverse the classified ports according to the port standard names to obtain port connection relationships;

[0035] The port connection module is used to control all the ports to connect according to the port connection relationship.

[0036] By adopting the above technical solution, by scanning specific keywords in the input file, the port information area that needs to be processed can be effectively identified, reducing the dependence on templates, so that when the module hierarchy needs to be modified, only the keywords need to be adjusted, which enhances flexibility. By storing the extracted port information in a hash table, it can be quickly accessed and retrieved, which is suitable for code management and adaptation of large projects and increases the adaptability of script processing. By building the top-level modules layer by layer, it can ensure that the structure of the modular design is clear and controllable, reducing the workload of manually writing multiple top-level modules. At the same time, it can adapt to design changes, improve the flexibility and scalability of the design, avoid the need to regenerate the entire top-level module for each modification, and improve development efficiency. By standardizing the port names, it can ensure that the port names between different modules are consistent or partially consistent, which is convenient for subsequent automated connection, simplifies the connection process, improves the connection efficiency, and ensures the correctness and reliability of the connection. By classifying and traversing the ports, it can quickly complete the traversal of all ports according to the port standard names, further improving the efficiency of port connection.

[0037] The third objective of the present application is achieved through the following technical solutions:

[0038] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned port automatic instantiation connection method are implemented.

[0039] The fourth objective of the present application is achieved through the following technical solutions:

[0040] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned port automatic instantiation connection method are implemented.

[0041] In summary, the present application includes at least one of the following beneficial technical effects:

[0042] 1. By scanning specific keywords in the input file, the port information area that needs to be processed can be effectively identified, reducing the dependence on templates. When the module hierarchy needs to be modified, only the keywords need to be adjusted, which enhances flexibility. By storing the extracted port information in a hash table, it can be quickly accessed and retrieved, which is suitable for code management and adaptation of large projects and increases the adaptability of script processing. By building the top-level modules layer by layer, the structure of the modular design can be ensured to be clear and controllable, reducing the workload of manually writing multiple top-level modules. At the same time, it can adapt to design changes, improve the flexibility and scalability of the design, avoid the need to regenerate the entire top-level module for each modification, and improve development efficiency. By standardizing the port names, it can ensure that the port names between different modules are consistent or partially consistent, which is convenient for subsequent automated connection, simplifies the connection process, improves connection efficiency, and ensures the correctness and reliability of the connection. By classifying and traversing the ports, all ports can be quickly traversed according to the port standard names, further improving the efficiency of port connection.

[0043] 2. By performing file merging when an existing top-level module file is detected, the seamless integration of new and old information is ensured, and duplication of work and data redundancy are avoided; by dynamically configuring newly generated top-level module files and adding them to the system, the scalability and modular management of the system are improved, thereby further improving the flexibility and efficiency of the design;

[0044] 3. By traversing the connection group, it is ensured that each port can find its matching connection port, avoiding the risk of omission and wrong connection; through the application of standard names and similarity rules, the connection process is made more flexible and intelligent, and can adapt to a variety of naming specifications and design requirements, improving the intelligence and efficiency of automatic port connection, simplifying the operation steps of port connection, and significantly improving the accuracy and reliability of connection, providing an effective solution for the automatic connection of complex systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 is a flow chart of a method for automatically instantiating a port connection in an embodiment of the present application;

[0046] Figure 2 This is a flowchart for implementing the preset keyword setting in the port automatic instantiation connection method in one embodiment of the present application;

[0047] Figure 3 is a flowchart for implementing step S10 in the method for automatically instantiating and connecting ports in one embodiment of the present application;

[0048] Figure 4 , Figure 5 and Figure 6is a flowchart for implementing step S30 in the method for automatically instantiating a port for connection in one embodiment of the present application;

[0049] Figure 7 This is a principle block diagram of a port automatic instantiation connection device in an embodiment of the present application;

[0050] Figure 8 It is a schematic diagram of a device in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The present application is further described in detail below in conjunction with the accompanying drawings.

[0052] In one embodiment, if Figure 1 As shown, the present application discloses a method for automatically instantiating a port, which specifically includes the following steps:

[0053] S10: Obtain input files of multiple underlying modules, and when preset keywords of the input files are detected, store the port information corresponding to all input files into the hash table of the corresponding underlying module, wherein the port information includes port name, port group information, port name processing rules and target top-level module.

[0054] In this embodiment, the bottom layer module refers to a functional module for receiving and processing input files. The input file refers to a file describing the module structure and port information. The preset keyword refers to a keyword that identifies a specific port or connection rule in the module input file. The port information refers to detailed information describing the port name and its corresponding modification logic, direction, bit width, and destination module.

[0055] Specifically, a file reading function is used to read the Verilog input files of the underlying modules one by one, and preset keywords in the files are searched using regular expressions or string matching algorithms. When keywords are detected, port information is parsed and extracted, including port names, port group information, port name processing rules, and target top-level modules, and this information is stored in an independent hash table corresponding to the underlying module.

[0056] S20: Perform name conversion on the corresponding port names according to all port name processing rules to obtain the port standard names of all ports, and build the top-level modules layer by layer according to the port standard names of all ports and their corresponding target top-level modules.

[0057] In this embodiment, the port name processing rule refers to the rule followed when converting the port name. The port standard name refers to the standard name of the port after conversion. The top-level module refers to the functional module used to instantiate the bottom-level module and connect the port.

[0058] Specifically, the port names and name processing rules stored in the hash table are read, and the port names are converted according to the name processing rules by adding prefixes or suffixes, deleting specific characters, etc., to generate port standard names, traverse the hash tables of all underlying modules, and build top-level modules layer by layer according to the converted standard names and information of the target top-level modules to generate a new Verilog file.

[0059] S30: Modify the hash table of the corresponding target top-level module according to the hash table and port standard names of different bottom-level modules, generate a top-level module file according to the hash table of the top-level module, classify all ports according to the port group information in the top-level module file, and traverse the classified ports according to the port standard names to obtain the port connection relationship.

[0060] In this embodiment, the top-level module file refers to the configuration file of the top-level module. The port group information refers to the information followed for grouping ports. The port connection relationship refers to the relationship between the ports.

[0061] Specifically, the hash tables of all bottom-level modules are traversed, and the hash tables of the corresponding top-level modules are modified according to the standard names of the ports and the information of the target top-level modules. For each top-level module, it is checked whether there is a corresponding hash table entry. If so, the existing entry is updated; if not, a new entry is added. Based on the modified top-level module hash table, a top-level module file is generated using a file writing function. Subsequently, the port group information in the top-level module file is parsed, and the classified ports are traversed according to the standard names of the ports to check whether the standard names of each pair of ports are the same or meet the preset similarity rules. When the names of two ports are the same or similar, it indicates that the two ports are interconnected ports, and the connection relationship between the two ports is obtained. All ports are traversed continuously until all ports are traversed and the connection relationship of all ports is obtained.

[0062] S40: Control all ports to connect according to the port connection relationship.

[0063] Specifically, according to the stored port connection relationship, a connection command or code is generated and written into the final top-level module file to realize automatic connection of the ports.

[0064] In one embodiment, if Figure 2 As shown, before step S10, that is, before obtaining the input file of the bottom module, it also includes:

[0065] S101: Add preset keywords to the underlying module by inserting comment codes.

[0066] Specifically, in the source file of the bottom module, a comment code in a specific format is added. The comment code contains preset keywords for identifying the port information to be extracted. Therefore, only the key information of the port needs to be extracted according to the comments, which reduces the workload.

[0067] In one embodiment, if Figure 3 As shown, in step S10, the port information corresponding to all input files is stored in the hash table of the corresponding underlying module, which specifically includes:

[0068] S11: Generate independent hash tables for all underlying modules.

[0069] Specifically, an independent hash table is created for each underlying module to store its detected port information. Each hash table is dedicated to storing the port information of its corresponding module to ensure the independence and security of the data.

[0070] S12: Store the port information of the input file detected by the underlying module into a hash table corresponding to the underlying module.

[0071] Specifically, when reading and parsing the input files of the bottom-level modules, the port information in each file is detected and stored in the corresponding hash table. Each entry in the hash table contains information such as the port name, port group information, name processing rules, and target top-level module.

[0072] In one embodiment, if Figure 4 As shown, in step S30, the hash table of the corresponding target top-level module is modified according to the hash table of different bottom-level modules and the standard port name, and the top-level module file is generated according to the hash table of the top-level module, which specifically includes:

[0073] S31: When the target top-level module has a generated top-level module file with the same name, the currently generated top-level module file is merged with the original top-level module file with the same name.

[0074] Specifically, if the top-level module file corresponding to the top-level module already exists, the newly generated top-level module file will be merged with the existing file. During the merging process, the connection information of each port needs to be verified to ensure that there are no omissions or errors, and to ensure the integrity and correctness of the top-level module file.

[0075] S32: When the target top-level module does not have a top-level module file, the top-level module file is configured into the current top-level module.

[0076] Specifically, if the top-level module file corresponding to the top-level module does not exist yet, the new top-level module file is configured into the current top-level module.

[0077] In one embodiment, if Figure 5As shown, in step S30, all ports are classified according to the port group information in the top-level module file, specifically including:

[0078] S33: Obtain port group information from the top-level module file.

[0079] S34: According to the port group information, ports with the same port group information are placed in the same group to obtain a first connection group and a second connection group.

[0080] Specifically, the port group information in the top-level module file is parsed, and according to the extracted port group information, the ports with the same group information are classified into the same group to form a first connection group and a second connection group.

[0081] In one embodiment, if Figure 6 As shown, in step S30, the classified ports are traversed according to the port standard names to obtain the port connection relationship, which specifically includes:

[0082] S35: traverse the first connection group and the second connection group, and when the standard port names of two ports are the same or similar according to a preset name similarity rule, obtain the connection relationship between the two ports, until the port connection relationship of all ports is obtained.

[0083] Specifically, each port entry in the first connection group and the second connection group is traversed to check whether the standard name of each pair of ports is the same or similar according to a preset name similarity rule. When two ports are found to meet the same or similar standard names, their connection relationship is recorded, and the ports are traversed continuously until all port entries are traversed.

[0084] In one embodiment, a port automatic instantiation connection device is provided, and the port automatic instantiation connection device corresponds one-to-one with the port automatic instantiation connection method in the above embodiment. Figure 7 As shown, the port automatic instantiation connection device includes an information extraction module, a top-level construction module, a top-level update module, and a port connection module. The detailed description of each functional module is as follows:

[0085] An information extraction module is used to obtain input files of multiple bottom-level modules, and when a preset keyword of the input file is detected, store the port information corresponding to the multiple input files into a hash table of the corresponding bottom-level module, wherein the port information includes a port name, port group information, a port name processing rule and a target top-level module;

[0086] The top-level construction module is used to convert the corresponding port names according to all port name processing rules to obtain the port standard names of all ports, and to construct the top-level modules layer by layer according to the port standard names of all ports and their corresponding target top-level modules;

[0087] A top-level update module is used to modify the hash table of the corresponding target top-level module according to the hash tables and port standard names of different bottom-level modules, generate a top-level module file according to the hash table of the top-level module, classify all ports according to the port group information in the top-level module file, and traverse the classified ports according to the port standard name to obtain the port connection relationship;

[0088] The port connection module is used to control all ports to connect according to the port connection relationship.

[0089] Optionally, before the information extraction module, it also includes:

[0090] The keyword insertion module is used to add preset keywords to the underlying module by inserting comment codes.

[0091] Optionally, the information extraction module specifically includes:

[0092] The hash table generation submodule is used to generate independent hash tables for all underlying modules;

[0093] The port information recording submodule is used to store the port information of the input file detected by the underlying module into the hash table corresponding to the underlying module.

[0094] Optionally, the top-level update module includes:

[0095] The file merging submodule is used to merge the currently generated top-level module file with the original top-level module file with the same name when the target top-level module has a generated top-level module file with the same name;

[0096] The file configuration submodule is used to configure the top-level module file into the current top-level module when the target top-level module does not have a top-level module file.

[0097] Optionally, the top-level update module includes:

[0098] The group information acquisition submodule is used to obtain the port group information from the top-level module file;

[0099] The port classification submodule is used to place ports with the same port group information into the same group according to the port group information to obtain a first connection group and a second connection group.

[0100] Optionally, the top-level update module includes:

[0101] The connection definition submodule is used to traverse the first connection group and the second connection group, and when the port standard names of the two ports are the same or similar according to the preset name similarity rule, the connection relationship of the two ports is obtained, until the port connection relationship of all ports is obtained. For the specific definition of the port automatic instantiation connection device, please refer to the definition of the port automatic instantiation connection method above, which will not be repeated here. The various modules in the above-mentioned port automatic instantiation connection device can be fully or partially implemented by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.

[0102] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a port automatic instantiation connection method is implemented.

[0103] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0104] Obtain input files of multiple bottom-level modules, and when preset keywords of the input files are detected, store port information corresponding to the multiple input files into a hash table of the corresponding bottom-level module, wherein the port information includes port name, port group information, port name processing rule and target top-level module;

[0105] According to all port name processing rules, the corresponding port names are converted to obtain the port standard names of all ports, and the top-level modules are constructed layer by layer according to the port standard names of all ports and their corresponding target top-level modules;

[0106] Modify the hash table of the corresponding target top-level module according to the hash table and port standard names of different bottom-level modules, generate a top-level module file according to the hash table of the top-level module, classify all ports according to the port group information in the top-level module file, and traverse the classified ports according to the port standard names to obtain the port connection relationship;

[0107] Control all ports to connect according to the port connection relationship.

[0108] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0109] Obtain input files of multiple bottom-level modules, and when preset keywords of the input files are detected, store port information corresponding to the multiple input files into a hash table of the corresponding bottom-level module, wherein the port information includes port name, port group information, port name processing rule and target top-level module;

[0110] According to all port name processing rules, the corresponding port names are converted to obtain the port standard names of all ports, and the top-level modules are constructed layer by layer according to the port standard names of all ports and their corresponding target top-level modules;

[0111] Modify the hash table of the corresponding target top-level module according to the hash table and port standard names of different bottom-level modules, generate a top-level module file according to the hash table of the top-level module, classify all ports according to the port group information in the top-level module file, and traverse the classified ports according to the port standard names to obtain the port connection relationship;

[0112] Control all ports to connect according to the port connection relationship.

[0113] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0114] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0115] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person 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 do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for automatically instantiating a port, characterized in that: The port automatic instantiation connection method comprises: Obtain input files of multiple bottom-level modules, and when preset keywords of the input files are detected, store port information corresponding to all the input files into a hash table corresponding to the bottom-level modules, wherein the port information includes port name, port group information, port name processing rule and target top-level module; Perform name conversion on the corresponding port names according to all the port name processing rules to obtain the port standard names of all ports, and construct the top-level modules layer by layer according to the port standard names of all ports and their corresponding target top-level modules; Modify the hash table of the target top-level module according to the hash table of different bottom-level modules and the port standard name, generate a top-level module file according to the hash table of the top-level module, classify all the ports according to the port group information in the top-level module file, and traverse the classified ports according to the port standard name to obtain the port connection relationship; the classifying all the ports according to the port group information in the top-level module file, traversing the classified ports according to the port standard name to obtain the port connection relationship, specifically includes: obtaining the port group information from the top-level module file; according to the port group information, placing the ports with the same port group information in the same group to obtain a first connection group and a second connection group; traversing the first connection group and the second connection group, when the port standard names of the two ports are the same or similar according to a preset name similarity rule, obtaining the connection relationship between the two ports, until the port connection relationship of all the ports is obtained; All the ports are controlled to be connected according to the port connection relationship.

2. The method for automatically instantiating a port according to claim 1, characterized in that: Before obtaining the input file of the bottom module, the method further includes: The preset keywords are added to the underlying module by inserting comment codes.

3. The method for automatically instantiating a port according to claim 1, characterized in that: The storing of the port information corresponding to all the input files into the hash table corresponding to the underlying module specifically includes: Generate independent hash tables for all the underlying modules; The port information of the input file detected by the underlying module is stored in the hash table corresponding to the underlying module.

4. The method for automatically instantiating a port according to claim 1, characterized in that: The step of modifying the hash table of the target top-level module according to the hash table of the different bottom-level modules and the port standard name, and generating a top-level module file according to the hash table of the top-level module, specifically includes: In the case that the target top-level module has a generated top-level module file with the same name, merging the currently generated top-level module file with the original top-level module file with the same name; When the target top-level module does not have the top-level module file, the top-level module file is configured into the current top-level module.

5. A port automatic instantiation connection device, characterized in that: The port automatic instantiation connection device comprises: An information extraction module is used to obtain input files of multiple bottom-level modules, and when a preset keyword of the input file is detected, store the port information corresponding to the multiple input files into a hash table corresponding to the bottom-level module, wherein the port information includes a port name, port group information, a port name processing rule and a target top-level module; A top-level construction module, used for performing name conversion on the corresponding port names according to all the port name processing rules to obtain the port standard names of all ports, and constructing the top-level modules layer by layer according to the port standard names of all ports and their corresponding target top-level modules; A top-level update module, used to modify the hash table corresponding to the target top-level module according to the hash tables of the different bottom-level modules and the port standard names, generate a top-level module file according to the hash table of the top-level module, classify all the ports according to the port group information in the top-level module file, and traverse the classified ports according to the port standard names to obtain port connection relationships; A port connection module, used for controlling all the ports to connect according to the port connection relationship; The top-level update module specifically includes: The group information acquisition submodule is used to obtain the port group information from the top-level module file; A port classification submodule, used for placing ports with the same port group information in the same group according to the port group information, to obtain a first connection group and a second connection group; The connection definition submodule is used to traverse the first connection group and the second connection group, and obtain the connection relationship between the two ports when the port standard names of the two ports are the same or similar according to the preset name similarity rule, until the port connection relationship of all ports is obtained.

6. The port automatic instantiation connection device according to claim 5, characterized in that: Before the information extraction module, it also includes: The keyword insertion module is used to add the preset keywords to the underlying module by inserting comment codes.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the port automatic instantiation connection method according to any one of claims 1 to 4 are implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the port automatic instantiation connection method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Top HDL file generation method and device and computer readable storage medium

    CN110209387A

  • Automatic design method and device for register codes and documents, equipment and medium

    CN116151162A

  • Connection analysis method for multi-port nesting model and storage medium

    WO2022105461A1