Bidirectional port direction determination module and device, electronic equipment and storage medium

By determining the bidirectional port direction of the underlying module in the target circuit diagram of the RTL design and determining the port direction of the upper module based on the port connection direction, the problem of unspecified inout port direction in the RTL design is solved, and fast and accurate port direction determination is achieved, reducing the time of comprehensive analysis.

CN120106006APending Publication Date: 2025-06-06S2C
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510311548.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

During the RTL design stage, the direction of each inout port is not specified, which leads to the need to analyze one by one in the comprehensive analysis stage, which takes a long time and increases the analysis time of the circuit.

Method used

By obtaining the target circuit diagram of the RTL design, the underlying module is determined, and when it is a basic circuit component, the direction of its first bidirectional port is determined as the output direction. Then, according to the direction of the port connection, determine the direction of the bidirectional ports of the upper layer module to ensure that the direction of each bidirectional port is input or output.

Benefits of technology

Quickly and accurately determine the direction of each bidirectional port in the RTL design, reduce the working time of subsequent comprehensive analysis, and facilitate RTL design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120106006A_ABST
    Figure CN120106006A_ABST
Patent Text Reader

Abstract

The invention discloses a bidirectional port direction determination module and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: acquiring a target circuit diagram designed by RTL, and determining a bottom layer module of the target circuit diagram; wherein the target circuit diagram comprises a plurality of modules, and each module comprises at least one bidirectional port; under the condition of determining that the bottom layer module is the basic circuit element, determining that the direction of a first bidirectional port of the bottom layer module is an output direction; determining each port connecting line associated with the second bidirectional port of the upper layer module connected with the bottom layer module, and determining the direction of each port connecting line; and determining the direction of the second bidirectional port based on the direction of the first bidirectional port and the direction of each port connecting line. According to the scheme, the direction of each bidirectional port in the RTL design can be quickly and accurately determined, convenience can be provided for the RTL design, and the working time of subsequent comprehensive analysis can be shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a direction determination module, device, electronic equipment and storage medium of a bidirectional port. Background Art

[0002] Register Transfer Language (RTL) is an abstract level used to describe the behavior of digital circuits. At this level, the design focuses on how data is transferred between registers and the operations performed on the data. RTL is a very critical stage in the hardware design process, which is located between system-level design and logic gate-level design. RTL design provides an effective way to describe and implement the complex functions of digital systems while retaining enough details to ensure that the resulting hardware meets performance and power requirements.

[0003] The inout type port is used to represent a bidirectional port that can be used to receive data or output data. For a module, the inout port can be used as both input and output.

[0004] At present, the direction of each inout port is not specified in the RTL design stage, and it is necessary to analyze the direction of each inout port one by one in the comprehensive analysis stage. This operation is time-consuming and increases the analysis time of the circuit. How to determine the direction of each inout port in the RTL design, provide convenience for the RTL design and reduce the subsequent comprehensive analysis work time is a key issue in the industry's research. Summary of the invention

[0005] The present invention provides a bidirectional port direction determination module, device, electronic device and storage medium to quickly and accurately determine the direction of each bidirectional port in an RTL design, which can facilitate the design of the RTL and reduce the working time of subsequent comprehensive analysis.

[0006] According to one aspect of the present invention, a method for determining the direction of a bidirectional port is provided, the method comprising:

[0007] Acquire a target circuit diagram designed by RTL, and determine a bottom-level module of the target circuit diagram; wherein the target circuit diagram includes a plurality of modules, and each of the modules includes at least one bidirectional port;

[0008] In the case where the bottom-level module is determined to be a basic circuit element, determining the direction of the first bidirectional port of the bottom-level module to be an output direction;

[0009] Determine each port connection line associated with the second bidirectional port of the upper layer module connected to the bottom layer module, and determine the direction of each port connection line;

[0010] Based on the direction of the first bidirectional port and the directions of the connection lines of each port, the direction of the second bidirectional port is determined; wherein the direction of each bidirectional port is: an input direction or an output direction.

[0011] According to another aspect of the present invention, there is provided a device for determining the direction of a bidirectional port, the device comprising:

[0012] A target circuit diagram acquisition module, used to acquire a target circuit diagram designed by RTL and determine a bottom-level module of the target circuit diagram; wherein the target circuit diagram includes a plurality of modules, each of which includes at least one bidirectional port;

[0013] A first bidirectional port direction determining module, configured to determine that the direction of the first bidirectional port of the bottom-level module is an output direction when the bottom-level module is determined to be a basic circuit element;

[0014] A port connection determination module, used to determine each port connection associated with the second bidirectional port of the upper layer module connected to the bottom layer module, and determine the direction of each port connection;

[0015] The second bidirectional port direction determination module is used to determine the direction of the second bidirectional port based on the direction of the first bidirectional port and the directions of the connection lines of each port; wherein the direction of each bidirectional port is: input direction or output direction.

[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for determining the direction of a bidirectional port described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for determining the direction of a bidirectional port described in any embodiment of the present invention when executed.

[0021] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method for determining the direction of a bidirectional port according to any embodiment of the present invention is implemented.

[0022] The technical solution of the embodiment of the present invention is to obtain a target circuit diagram designed by RTL and determine the underlying module of the target circuit diagram; wherein the target circuit diagram includes multiple modules, each of which includes at least one bidirectional port; when the underlying module is determined to be a basic circuit element, determine the direction of the first bidirectional port of the underlying module as the output direction; determine the port connections associated with the second bidirectional port of the upper module connected to the underlying module, and determine the direction of each port connection; based on the direction of the first bidirectional port and the direction of each port connection, determine the direction of the second bidirectional port; wherein the direction of each bidirectional port is: input direction or output direction, the direction of each bidirectional port in the RTL design can be determined quickly and accurately, which can facilitate the design of the RTL and reduce the working time of the subsequent comprehensive analysis.

[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] 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.

[0025] Figure 1 is a flow chart of a method for determining the direction of a bidirectional port provided according to Embodiment 1 of the present invention;

[0026] Figure 2 is a schematic diagram of the structure of a target circuit diagram of an RTL design provided according to Embodiment 1 of the present invention;

[0027] Figure 3 is a flow chart of a method for determining the direction of a bidirectional port provided according to Embodiment 2 of the present invention;

[0028] Figure 4 is a flow chart of another method for determining the direction of a bidirectional port provided according to Embodiment 2 of the present invention;

[0029] Figure 5 is a schematic diagram of the structure of a device for determining the direction of a bidirectional port provided according to Embodiment 3 of the present invention;

[0030] Figure 6 The invention is a schematic structural diagram of an electronic device for implementing the method for determining the direction of a bidirectional port according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] Embodiment 1

[0034] Figure 1 This is a flow chart of a method for determining the direction of a bidirectional port provided according to the first embodiment of the present invention. This embodiment is applicable to the case of determining the direction of a bidirectional port in each module in a circuit diagram of an RTL design. The method can be executed by a device for determining the direction of a bidirectional port. The device for determining the direction of a bidirectional port can be implemented in the form of hardware and / or software. The device for determining the direction of a bidirectional port can be configured in an electronic device such as a computer, a server or a tablet computer. Figure 1 As shown, the method includes:

[0035] Step 110: Obtain a target circuit diagram designed by RTL, and determine the bottom-level modules of the target circuit diagram.

[0036] The target circuit diagram includes a plurality of modules, and each of the modules includes at least one bidirectional port.

[0037] It should be noted that in this embodiment, the target circuit diagram is not a traditional hardware connection circuit diagram, but is designed by RTL, which is at a higher level of abstraction and mainly focuses on how data is transmitted between registers and how these operations are coordinated through control signals. At this level, designers usually use hardware description languages ​​(such as Verilog or VHDL) to describe the behavior of the system, rather than the specific design of logic gates.

[0038] The bidirectional port involved in this embodiment can be an inout type port, which can be used to receive data and output data; it can be understood that for a module, the inout port can be used as both input and output, and the other module connected to the inout port should also be an inout port. The inout port cannot exist independently.

[0039] That is to say, when the inout port of one module is used as output, the inout port of another module must be used as input; conversely, when the inout port of one module is used as input, the inout port of another module must be used as output. Therefore, the control signals of these two inout ports are actually controlled by a pair of signals. Therefore, in the RTL module with multiple inout ports, the existence of inout will make the design analysis very complicated.

[0040] Optionally, in this embodiment, after obtaining the target circuit diagram designed by RTL, the target circuit diagram can be further analyzed to obtain each module of the target circuit diagram. Furthermore, the underlying modules of the target circuit diagram can be determined based on the positional relationship or connection relationship of each module.

[0041] It should be noted that, in this embodiment, the lowest module in the target circuit diagram is referred to as a bottom module, which may also be referred to as other modules, such as a first module or a second module, etc., which is not limited in this embodiment.

[0042] For example, Figure 2 is a schematic diagram of the structure of a target circuit diagram of an RTL design provided according to the first embodiment of the present invention, such as Figure 2 As shown, the target circuit diagram includes two modules (add and Top; add is the bottom module); and four bidirectional ports, namely add_a, add_b, top_a and top_b.

[0043] Step 120: When it is determined that the bottom-level module is a basic circuit element, determine that the direction of the first bidirectional port of the bottom-level module is an output direction.

[0044] Optionally, in this embodiment, after determining the underlying module of the target circuit diagram, it is necessary to further determine whether the underlying module is a basic circuit element; wherein the basic circuit element may include: a basic logic gate, a storage element, a buffer or a tri-state gate.

[0045] In an optional implementation of the present embodiment, after determining the underlying module of the target circuit diagram, it is possible to further determine whether the underlying module is a basic circuit element such as a basic logic gate, a storage element, a buffer or a tri-state gate; if so, the underlying module is determined to be a basic circuit element; otherwise, the underlying module is determined to be a non-basic circuit element.

[0046] Optionally, in this embodiment, when the underlying module is determined to be a basic circuit element, that is, the underlying module is composed of basic circuit elements such as basic logic gates, storage elements, buffers or tri-state gates, the direction of the first bidirectional port of the module can be further determined as the output direction.

[0047] In this embodiment, the first bidirectional port may be any inout port of the bottom layer module, which is not limited in this embodiment.

[0048] In another optional implementation of this embodiment, when it is determined that the bottom-level module is a non-basic circuit element, the direction of the first bidirectional port of the bottom-level module is determined to be an input direction.

[0049] It can be understood that in this embodiment, if the underlying module is determined to be a basic circuit element, then the direction of the bidirectional port of the underlying module can be determined to be the output direction; if the underlying module is determined to be a non-basic circuit element, then the direction of the bidirectional port of the underlying module can be determined to be the input direction.

[0050] Step 130: Determine each port connection line associated with the second bidirectional port of the upper layer module connected to the bottom layer module, and determine the direction of each port connection line.

[0051] In this embodiment, the upper layer module connected to the bottom layer module is the upper layer module directly connected to the bottom layer module, for example, Figure 2 The upper module of the bottom module add shown is the Top module; if the target circuit diagram contains three modules, then the upper module of the bottom module is the middle module of the target circuit diagram; that is, in this embodiment, the upper module does not refer to a single module in the target circuit diagram, but refers to the module in the target circuit diagram that is directly connected to the bottom module.

[0052] Optionally, in this embodiment, after determining the upper module connected to the bottom module, each second bidirectional port in the upper module and the connection between the second bidirectional port and the first bidirectional port can be further determined, which is referred to as a port connection in this embodiment. Further, the direction of the port connection can be determined; illustratively, Figure 2 The port connections involved can be light blue top_a and top_b.

[0053] In an optional implementation of the present embodiment, the direction of the port line connected to the first bidirectional port can be determined based on the port direction of the first bidirectional port; illustratively, when it is determined that the port line does not contain other driving sources, if the direction of the first bidirectional port is the output direction, then the direction of the port line connected to it is also the output direction; if the direction of the first bidirectional port is the input direction, then the direction of the port line connected to it is also the input direction.

[0054] In another optional implementation of the present embodiment, when it is determined that the port connection includes other driving sources, the direction of the port connection is not only related to the direction of the first bidirectional port, but also related to the specific driving mode of the driving source. In the present embodiment, the situation where the port connection includes other driving sources is not specifically described, and it is not a limitation of the present embodiment.

[0055] Step 140: Determine the direction of the second bidirectional port based on the direction of the first bidirectional port and the directions of the connection lines of each port.

[0056] The direction of each bidirectional port is either input or output.

[0057] Optionally, in this embodiment, after determining the direction of the first bidirectional port and the directions of the port lines connected to the first bidirectional port, the direction of the second bidirectional port may be further determined based on the directions of the first bidirectional ports and the port lines.

[0058] For example, in Figure 2 In the example, if the direction of add_a is output and the direction of port connection top_a is output, then the direction of top_a is also output; if the direction of add_b is input and the direction of port connection top_b is input, then the direction of top_b is also input.

[0059] The technical solution of this embodiment is to obtain a target circuit diagram designed by RTL and determine the underlying module of the target circuit diagram; wherein the target circuit diagram includes multiple modules, each of which includes at least one bidirectional port; when the underlying module is determined to be a basic circuit element, determine the direction of the first bidirectional port of the underlying module as the output direction; determine each port connection associated with the second bidirectional port of the upper module connected to the underlying module, and determine the direction of each port connection; based on the direction of the first bidirectional port and the direction of each port connection, determine the direction of the second bidirectional port; wherein the direction of each bidirectional port is: input direction or output direction, so as to quickly and accurately determine the direction of each bidirectional port in the RTL design, which can facilitate the design of the RTL and reduce the working time of the subsequent comprehensive analysis.

[0060] Embodiment 2

[0061] Figure 3 1 is a flow chart of a method for determining the direction of a bidirectional port provided according to Embodiment 2 of the present invention. This embodiment is a further refinement of the above technical solution. The technical solution in this embodiment can be combined with each optional solution in one or more of the above embodiments. Figure 3 As shown, the method includes:

[0062] Step 310: Obtain a target circuit diagram designed by register transfer language RTL, and determine the bottom layer module of the target circuit diagram.

[0063] Optionally, in this embodiment, obtaining a target circuit diagram designed by a register transfer language RTL and determining the underlying modules of the target circuit diagram may include: obtaining the target circuit diagram from a target database before performing a comprehensive analysis on the target circuit diagram; parsing the target circuit diagram to obtain the modules of the target circuit diagram and the connection relationships between the modules; and determining the underlying modules of the target circuit diagram based on the connection relationships between the modules.

[0064] Among them, the target database can be a database system that uses a parser or tool to create and manage design data, which can store information extracted from design files of hardware description languages ​​​​(such as SystemVerilog or VHDL) and used in further processing, analysis or verification processes; in this embodiment, the target circuit diagram designed by RTL can be stored in the target database, which can facilitate subsequent direct processing of the target circuit diagram and save the time required to convert the target circuit diagram by storing it in other databases.

[0065] In an optional implementation of this embodiment, after the target circuit diagram is obtained through RTL design, that is, before the target circuit diagram is comprehensively analyzed through a comprehensive analysis tool, the designed target circuit diagram can be obtained from the target database.

[0066] Furthermore, the acquired target circuit diagram may be parsed to obtain the modules of the target circuit diagram and the connection relationship between the modules; it should be noted that in this embodiment, the module may also be referred to as a netlist.

[0067] Furthermore, the underlying module of the target circuit diagram can also be determined based on the connection relationship between the modules, that is, the connection relationship between the netlists; illustratively, if the target module in the target circuit diagram only contains the upper-level modules but not the lower-level modules, then the target module can be determined as the underlying module.

[0068] Step 320: Determine whether the bottom-level module is a basic circuit element.

[0069] The basic circuit element may be a basic logic gate, a storage element, a buffer or a tri-state gate.

[0070] Optionally, in this embodiment, after determining that the underlying module is obtained, the circuit elements constituting the underlying module can be further determined, and it can be further determined whether these circuit elements are basic circuit elements; if it is determined that the circuit elements of the underlying module include basic circuit elements such as basic logic gates, storage elements, buffers or tri-state gates, then the underlying module is determined to be a basic circuit element, otherwise, it is a non-basic circuit element.

[0071] Step 330: When it is determined that the bottom-level module is a basic circuit element, determine that the direction of the first bidirectional port of the bottom-level module is an output direction.

[0072] Step 340: Determine a first port connection line connecting the second bidirectional port to the first bidirectional port of the bottom module; and determine a direction of the first port connection line based on a direction of the first bidirectional port.

[0073] Optionally, in this embodiment, after determining the direction of the first bidirectional port of the underlying module, the port connections associated with the second bidirectional port of the upper module connected to the underlying module can be determined, that is, the connections between each first bidirectional port and each second bidirectional port, and further, the direction of each port connection can be determined.

[0074] Optionally, in this embodiment, the second bidirectional port of the upper module and the first port connection of the bottom module may be preferentially determined. Further, the direction of the first port connection may be determined based on the direction of the first bidirectional port. Exemplarily, the first port connection may be Figure 2The light blue top_a or top_b in FIG. 1 is not limited in this embodiment.

[0075] Optionally, in this embodiment, determining the direction of the first port connection based on the direction of the first bidirectional port may include: determining whether the first port connection includes other driving sources; if it is determined that the first port connection does not include other driving sources, then when the direction of the first bidirectional port is determined to be an output direction, the direction of the first port connection is the output direction; or, when the direction of the first bidirectional port is determined to be an input direction, the direction of the first port connection is the input direction.

[0076] In an optional implementation of this embodiment, after determining that the first port connection is obtained, it can be further determined whether the first port connection contains other driving sources, wherein the other driving sources can be one or more of a driver program, a clock signal source, an analog signal source or a digital signal source, which is not limited in this embodiment.

[0077] In an optional implementation of this embodiment, if it is determined that the first port connection does not contain other driving sources, then when the direction of the first bidirectional port is determined to be the output direction, the direction of the first port connection is also the output direction; when the direction of the first bidirectional port is determined to be the input direction, the direction of the first port connection is also the input direction.

[0078] In another optional implementation of this embodiment, if it is determined that the first port connection includes other driving sources, the first port connection direction needs to be determined based on the driving conditions of the other driving sources and the direction of any bidirectional port.

[0079] Step 350: Determine the direction of the second bidirectional port based on the direction of the first bidirectional port and the directions of the connection lines of each port.

[0080] In this embodiment, determining the direction of the second bidirectional port based on the direction of the first bidirectional port and the directions of the connection lines of each port may include: if it is determined that the directions of the connection lines of the first bidirectional port and the second port are consistent, then determining that the direction of the second bidirectional port connected to the second port is consistent with the direction of the first bidirectional port.

[0081] In an optional implementation of the present embodiment, if it is determined that the directions of the connection between the first bidirectional port and the second port are consistent, then the direction of the second bidirectional port connected to the second port is determined to be consistent with the direction of the first bidirectional port, that is, if it is determined that the directions of the connection between the first bidirectional port and the first port are both output directions, then the direction of the second bidirectional port is also the output direction; if it is determined that the directions of the connection between the first bidirectional port and the first port are both input directions, then the direction of the second bidirectional port is also the input direction.

[0082] In an optional implementation of the present embodiment, after determining the port direction of the second bidirectional port, the direction of the bidirectional port of the upper-level module connected to the second bidirectional port can be further determined. According to this method, the directions of all bidirectional ports in the target circuit diagram can be determined from bottom to top.

[0083] The solution of this embodiment, when it is determined that the first port connection between the first bidirectional port and the second bidirectional port of the upper module does not contain other driving sources, if the direction of the first bidirectional port is determined to be the output direction, then the direction of the first port connection is the output direction; if the direction of the first bidirectional port is determined to be the input direction, then the direction of the first port connection is the input direction. The direction of the bidirectional port of the upper module of the bottom module can be quickly determined, providing a basis for obtaining the directions of all bidirectional ports of the target circuit.

[0084] In order to better understand the method for determining the direction of a bidirectional port involved in this embodiment, Figure 4 FIG. 1 is a flow chart of another method for determining the direction of a bidirectional port provided according to Embodiment 2 of the present invention. Figure 4 As shown, sub, add and Top are modules; sub_a, add_a, add_b, top_a and top_b are bidirectional ports matching the modules respectively; in this embodiment, module sub can be used as a black box. If sub is a basic circuit element (primitive), it can be inferred that the direction of sub_a is the output direction. When traversing to add_a, it is necessary to traverse all bidirectional ports and port references of the port connection. If the directions are all output directions, add_a is inferred to be the output direction. If there are bidirectional ports or port references with the direction as the input direction, the design has multiple driving sources. Similarly, for point c1, when add_a is inferred to be the output direction, top_a is the output direction. If there are no multiple driving sources in the design, top_b is also the output output direction.

[0085] Based on the same method, if it is determined that sub_a is not pritimive and sub_a is already the bottom layer, then sub_a should be inferred as an input port, and add_a and top_a are both input ports. If there are multiple driving sources, the port inferred as the output port will be traversed and find that there is also input in the input direction, and it needs to be processed by multi-driving technology, which is not specifically limited in this embodiment.

[0086] The solution of the embodiment of the present invention infers the direction of the bidirectional port through RTL design, and determines the bidirectional direction before the synthesis of the synthesizer, thereby reducing the complex program of the synthesizer synthesis. Some synthesizers are unable to synthesize the bidirectional port. From the technical effect aspect, the bidirectional port direction is inferred through RTL design, which technically reduces the difficulty of analyzing the bidirectional code, reduces the synthesis time of the synthesizer, and reduces the resources occupied by the synthesis.

[0087] Embodiment 3

[0088] Figure 5 1 is a schematic diagram of a device for determining the direction of a bidirectional port according to Embodiment 3 of the present invention. Figure 5 As shown, the device includes: a target circuit diagram acquisition module 510, a first bidirectional port direction determination module 520, a port connection determination module 530 and a second bidirectional port direction determination module 540.

[0089] The target circuit diagram acquisition module 510 is used to acquire the target circuit diagram designed by RTL and determine the bottom layer module of the target circuit diagram; wherein the target circuit diagram includes a plurality of modules, each of which includes at least one bidirectional port;

[0090] A first bidirectional port direction determining module 520, configured to determine the direction of the first bidirectional port of the bottom-level module as an output direction when the bottom-level module is determined to be a basic circuit element;

[0091] A port connection determination module 530, used to determine each port connection associated with the second bidirectional port of the upper layer module connected to the bottom layer module, and determine the direction of each port connection;

[0092] The second bidirectional port direction determination module 540 is used to determine the direction of the second bidirectional port based on the direction of the first bidirectional port and the directions of the port connections; wherein the direction of each bidirectional port is: input direction or output direction.

[0093] The scheme of this embodiment is to obtain a target circuit diagram designed by RTL through a target circuit diagram acquisition module, and determine the underlying module of the target circuit diagram; wherein the target circuit diagram includes multiple modules, each of which includes at least one bidirectional port; when the underlying module is determined to be a basic circuit element, the first bidirectional port of the underlying module is determined to be an output direction through a first bidirectional port direction determination module; each port connection associated with the second bidirectional port of the upper module connected to the underlying module is determined through a port connection determination module, and the direction of each port connection is determined; the direction of the second bidirectional port is determined based on the direction of the first bidirectional port and the direction of each port connection through a second bidirectional port direction determination module; wherein the direction of each bidirectional port is: input direction or output direction, which can quickly and accurately determine the direction of each bidirectional port in the RTL design, can provide convenience for the design of the RTL, and can reduce the working time of the subsequent comprehensive analysis.

[0094] In an optional implementation of this embodiment, the target circuit diagram acquisition module 510 is specifically configured to acquire the target circuit diagram from a target database before performing a comprehensive analysis on the target circuit diagram;

[0095] Parsing the target circuit diagram to obtain the modules of the target circuit diagram and the connection relationship between the modules;

[0096] The bottom layer module of the target circuit diagram is determined based on the connection relationship between the modules.

[0097] In an optional implementation of this embodiment, the direction determination device of the bidirectional port further includes: a basic circuit element determination module, used to determine whether the bottom layer module is a basic circuit element;

[0098] The basic circuit elements include: basic logic gates, storage elements, buffers or tri-state gates.

[0099] In an optional implementation of this embodiment, the port connection determination module 530 is specifically configured to determine a first port connection connecting the second bidirectional port to the first bidirectional port of the bottom module;

[0100] The direction of the first port connection is determined based on the direction of the first bidirectional port.

[0101] In an optional implementation of this embodiment, the port connection determination module 530 is further specifically used to determine whether the first port connection includes other driving sources;

[0102] If it is determined that the first port connection does not include other driving sources, then when it is determined that the direction of the first bidirectional port is the output direction, the direction of the first port connection is the output direction;

[0103] or,

[0104] When it is determined that the direction of the first bidirectional port is the input direction, the direction of the first port connection line is the input direction.

[0105] In an optional implementation of this embodiment, the second bidirectional port direction determining module 540 is specifically configured to determine that the direction of the second bidirectional port connected to the second port is consistent with the direction of the first bidirectional port if it is determined that the directions of the connection between the first bidirectional port and the second port are consistent.

[0106] In an optional implementation of this embodiment, the direction determination device of the bidirectional port also includes: a direction determination submodule of the first bidirectional port, which is used to determine the direction of the first bidirectional port of the underlying module as an input direction when the underlying module is determined to be a non-basic circuit element.

[0107] The device for determining the direction of a bidirectional port provided in the embodiment of the present invention can execute the method for determining the direction of a bidirectional port provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0108] In the technical solution of the embodiment of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of the target circuit diagram involved all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0109] Embodiment 4

[0110] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0111] like Figure 6As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0112] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0113] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a method for determining the direction of a bidirectional port, the method comprising: obtaining a target circuit diagram designed by a register transfer language RTL, and determining a bottom module of the target circuit diagram; wherein the target circuit diagram includes a plurality of modules, each of which includes at least one bidirectional port; in the case where the bottom module is determined to be a basic circuit element, determining the direction of the first bidirectional port of the bottom module as an output direction; determining each port connection associated with the second bidirectional port of the upper module connected to the bottom module, and determining the direction of each port connection; determining the direction of the second bidirectional port based on the direction of the first bidirectional port and the direction of each port connection; wherein the direction of each bidirectional port is: input direction or output direction.

[0114] In some embodiments, the method for determining the direction of a bidirectional port may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for determining the direction of the bidirectional port described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method for determining the direction of a bidirectional port by any other appropriate means (e.g., by means of firmware).

[0115] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0116] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0117] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0118] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0119] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0120] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0121] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0122] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

[0123] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the database detection method provided in any embodiment of the present application.

[0124] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0125] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0126] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for determining the direction of a bidirectional port, characterized in that: include: Acquire a target circuit diagram designed by a register transfer language (RTL), and determine a bottom-level module of the target circuit diagram; wherein the target circuit diagram includes a plurality of modules, and each of the modules includes at least one bidirectional port; In the case where the bottom-level module is determined to be a basic circuit element, determining the direction of the first bidirectional port of the bottom-level module to be an output direction; Determine each port connection line associated with the second bidirectional port of the upper layer module connected to the bottom layer module, and determine the direction of each port connection line; Based on the direction of the first bidirectional port and the directions of the connection lines of each port, the direction of the second bidirectional port is determined; wherein the direction of each bidirectional port is: an input direction or an output direction.

2. The method for determining the direction of a bidirectional port according to claim 1, characterized in that: Obtain a target circuit diagram designed by RTL, and determine the underlying modules of the target circuit diagram, including: Before comprehensively analyzing the target circuit diagram, obtaining the target circuit diagram from a target database; Parsing the target circuit diagram to obtain the modules of the target circuit diagram and the connection relationship between the modules; The bottom layer module of the target circuit diagram is determined based on the connection relationship between the modules.

3. The method for determining the direction of a bidirectional port according to claim 1, characterized in that: After determining the bottom layer module of the target circuit diagram, the method further includes: Determining whether the bottom-level module is a basic circuit element; The basic circuit elements include: basic logic gates, storage elements, buffers or tri-state gates.

4. The method for determining the direction of a bidirectional port according to claim 1, characterized in that: The step of determining each port connection line associated with the second bidirectional port of the upper layer module connected to the lower layer module and determining the direction of each port connection line includes: Determine a first port connection connecting the second bidirectional port to the first bidirectional port of the bottom module; The direction of the first port connection is determined based on the direction of the first bidirectional port.

5. The method for determining the direction of a bidirectional port according to claim 4, characterized in that: The determining the direction of the first port connection line based on the direction of the first bidirectional port includes: Determining whether the first port connection includes other driving sources; If it is determined that the first port connection does not include other driving sources, then when it is determined that the direction of the first bidirectional port is the output direction, the direction of the first port connection is the output direction; or, When it is determined that the direction of the first bidirectional port is the input direction, the direction of the first port connection line is the input direction.

6. The method for determining the direction of a bidirectional port according to claim 1, characterized in that: The determining the direction of the second bidirectional port based on the direction of the first bidirectional port and the directions of the connection lines of each port includes: If it is determined that the first bidirectional port is connected to the second port in the same direction, then it is determined that the direction of the second bidirectional port connected to the second port is consistent with the direction of the first bidirectional port.

7. The method for determining the direction of a bidirectional port according to claim 1, characterized in that: The method further comprises: In the case where the bottom-level module is determined to be a non-basic circuit element, the direction of the first bidirectional port of the bottom-level module is determined to be an input direction.

8. A device for determining the direction of a bidirectional port, characterized in that: include: A target circuit diagram acquisition module, used to acquire a target circuit diagram designed by RTL and determine a bottom-level module of the target circuit diagram; wherein the target circuit diagram includes a plurality of modules, each of which includes at least one bidirectional port; A first bidirectional port direction determining module, configured to determine that the direction of the first bidirectional port of the bottom-level module is an output direction when the bottom-level module is determined to be a basic circuit element; A port connection determination module, used to determine each port connection associated with the second bidirectional port of the upper layer module connected to the bottom layer module, and determine the direction of each port connection; The second bidirectional port direction determination module is used to determine the direction of the second bidirectional port based on the direction of the first bidirectional port and the directions of the connection lines of each port; wherein the direction of each bidirectional port is: input direction or output direction.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method for determining the direction of a bidirectional port according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for determining the direction of a bidirectional port according to any one of claims 1 to 7 when the instructions are executed.