A navigation method based on multi-file jumping, an electronic device, and a storage medium

By assigning navigation status flags to file include statements, the memory consumption and navigation chaos problems of EDA tools when processing include statements are solved, achieving efficient multi-file jumps and correct navigation relationships.

CN121052178BActive Publication Date: 2026-02-10SHANGHAI UNIVISTA IND SOFTWARE GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511582223.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-02-10
Estimated Expiration
2045-10-31

AI Technical Summary

Technical Problem

During integrated circuit design verification and debugging, existing EDA tools cause excessive memory consumption and chaotic navigation paths when processing include statements, making it impossible to establish correct navigation relationships.

Method used

By assigning navigation status flags to file inclusion statements, normal jumps or backtracking are achieved, and only the corresponding files are dynamically loaded into memory, avoiding recursive embedding of the contents of the included files into the main file.

Benefits of technology

It reduced memory consumption, established correct navigation relationships, and avoided increasing the amount of displayed content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121052178B_ABST
    Figure CN121052178B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electronic design automation, in particular to a navigation method based on multi-file jump, an electronic device and a storage medium, which comprises the following steps: in response to a first navigation operation, a next target sentence in a current file is found and selected; in response to a second navigation operation, if the target sentence belongs to a file inclusion sentence, a current navigation state identifier is assigned to the target sentence, and a first preset navigation strategy is executed according to the state value; if the current navigation state identifier is a complete navigation, it is updated to an incomplete navigation, when the backtracking condition is not met, the next target sentence in the current file is found and selected; when the condition is met, the file containing the file inclusion sentence referring to the current file is jumped to, the file inclusion sentence is selected, and the navigation state identifier is updated to the complete navigation. It only needs to dynamically load the file into the memory, which reduces the memory consumption compared with the traditional way, and does not increase the display content of the main file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electronic design automation technology, and in particular to a navigation method, electronic device and storage medium based on multi-file navigation. Background Technology

[0002] In coverage-driven integrated circuit design verification and debugging workflows, designers often need to perform coverage backtracking analysis at the source code level to pinpoint the specific locations of covered or uncovered code segments. To improve debugging efficiency, modern EDA tools typically provide interactive visualization functions, allowing users to jump point-by-point between code lines marked with coverage status by clicking with the mouse. In such interactive scenarios, the tool needs to identify the specified status and locate the next code object based on information in the coverage database to achieve rapid navigation; the specified status can be covered, uncovered, or excluded. However, when include statements exist in the source code, this jump logic faces complexity challenges. Most current EDA tools use a static text expansion mechanism when handling include statements during the compilation phase: during the syntax parsing phase, the content of the included file is recursively embedded into the main file, forming a logically continuous code flow. Therefore, during coverage jumps, the tool may treat both the include statement itself and the expanded content of the included file as jumpable target nodes. For example, when file Av includes file Bv via an include directive on line n, and file Bv further includes file Cv, the EDA tool first expands the content of Cv into Bv, then embeds all the content of Bv into the corresponding position in Av, ultimately generating a single, flat code structure containing all referenced content. This results in Av files being excessively large when displayed in EDA software, consuming significant memory. Especially in multi-level nested scenarios, the tool needs to maintain and process a logical file structure in memory that far exceeds the size of the original physical file. Furthermore, traditional navigation methods may suffer from logical jumps during backtracking, making it impossible for users to establish correct navigation relationships. For instance, when a user finishes navigating in file B and needs to return to file A, which references B, the traditional method directly selects the next target statement. At this point, the user cannot know from which file include statement to return to the current file, leading to a chaotic navigation path. Therefore, a method is urgently needed that establishes correct navigation relationships, consumes minimal memory, and does not increase the amount of displayed content. Summary of the Invention

[0003] To address the aforementioned technical problems, the present invention adopts the following technical solution: a navigation method based on multi-file navigation, the method comprising the following steps:

[0004] S100, in response to the user's first navigation operation, locates and selects the next target statement in the current file.

[0005] S300, in response to the user's second navigation operation, if the target statement is a file inclusion statement, then a current navigation state identifier is assigned to the target statement, and a first preset navigation strategy is executed according to the state value of the current navigation state identifier. The first preset navigation strategy includes:

[0006] S310, if the current navigation status identifier indicates complete navigation, then update the current navigation status identifier to incomplete navigation, and determine whether the backtracking condition is met, including:

[0007] S311, if not satisfied, then find and select the next target statement in the current file, and continue execution of S300.

[0008] S313, if satisfied, then search for the file inclusion statement that references the current file. If found, jump to the file where the file inclusion statement is located, select the file inclusion statement, update the navigation status flag assigned to the file inclusion statement to complete navigation, and continue to execute S300.

[0009] Furthermore, the present invention also provides a non-transitory computer-readable storage medium storing at least one instruction or at least one program segment, wherein the at least one instruction or the at least one program segment is loaded and executed by a processor to implement the above-described method.

[0010] In addition, the present invention provides an electronic device including a processor and the aforementioned non-transitory computer-readable storage medium.

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

[0012] The method provided in this embodiment of the invention performs normal jumps or backtracking by allocating the current navigation state identifier, thereby establishing the correct navigation relationship while ensuring jumps between multiple files. It only requires dynamically loading the corresponding files into memory, which reduces memory consumption compared to the traditional method of recursively embedding the contents of the included files into the main file and loading them all at once. Furthermore, the navigation method provided in this embodiment of the invention does not require recursively embedding the contents of the included files into the main file, thus not increasing the display content of the main file. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 A flowchart of a navigation method based on multi-file navigation provided in an embodiment of the present invention;

[0015] Figure 2 A flowchart illustrating the steps of a first navigation strategy provided in an embodiment of the present invention;

[0016] Figure 3 A flowchart illustrating the steps of the second navigation strategy provided in this embodiment of the invention;

[0017] Figure 4 This is a schematic diagram illustrating multi-file navigation provided in an embodiment of the present invention; Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Unless otherwise defined, all technical and scientific terms used in the embodiments of this invention have the same meaning as commonly understood by those skilled in the art.

[0020] Please see Figure 1 It illustrates a navigation method based on multi-file navigation, the method comprising the following steps:

[0021] S100, in response to the user's first navigation operation, locates and selects the next target statement in the current file.

[0022] It should be noted that this invention is applied to code coverage analysis scenarios. The system already possesses coverage status information for each code statement under different coverage metric types, such as covered, uncovered, or filtered. Users can trigger corresponding navigation operations through a visual interface.

[0023] In one implementation, the navigation operation is either a forward navigation operation or a reverse navigation operation. The terms "first navigation operation" and "second navigation operation" are used only to distinguish the order of the navigation operations. The first navigation operation and the second navigation operation can be the same two forward navigation operations or the same two reverse navigation operations, or they can be one forward navigation operation and one reverse navigation operation, or one reverse navigation operation and one forward navigation operation, respectively.

[0024] The current file is the context source code file currently displayed by the system during navigation operations and serves as the search context for target statements that meet preset coverage criteria. When a navigation operation switches to a new file via a file include statement, the newly entered file becomes the current file. For example, when the user performs a forward navigation operation in file Ac, Ac is the current file. If a subsequent navigation operation causes the system to jump to Bc, then Bc becomes the new current file.

[0025] In one implementation, the target statement is a statement in the current file that satisfies a preset coverage condition.

[0026] In one implementation, the preset coverage conditions are the coverage metric type and coverage status type specified by the user in the current file, used to locate and select target statements that meet the conditions, and display them in the visualization view. Other preset types of conditions for finding target statements all fall within the protection scope of this invention.

[0027] It should be noted that the system has already saved a coverage database. The coverage metric type and its corresponding coverage status for the current file are all stored in the coverage database. When the user is navigating, they can use preset coverage conditions to view information such as which parts of the current file's source code are covered and which are not.

[0028] In one implementation, the starting point of the user's first navigation operation is the first target statement in the current file that meets the preset coverage conditions, or a location specified by the user.

[0029] S300, in response to the user's second navigation operation, if the target statement is a file inclusion statement, then a current navigation state identifier is assigned to the target statement, and a first preset navigation strategy is executed according to the state value of the current navigation state identifier.

[0030] In this context, a file inclusion statement is a syntax statement in source code used to import or include other source code files, causing the content of the referenced file to be loaded into the current file during compilation, interpretation, or execution. In this embodiment of the invention, file inclusion statements are used to identify file inclusion statements during navigation operations, enabling cross-file jumps and dependency tracking. For example, when navigating forward based on the file inclusion statement `#include "Bv"` in file Av, a visualization window for Bv can be opened and switched, at which point file Bv is the current file.

[0031] The navigation status flag indicates the progress of cross-file navigation associated with file inclusion statements in the current file, including two status values: complete navigation and incomplete navigation. When the navigation status flag is incomplete, it means that a complete navigation operation has not yet been performed on the target file referenced by the file inclusion statement. When the navigation status flag is complete, it means that a complete navigation operation has been performed on the target file referenced by the file inclusion statement. A complete navigation operation refers to jumping from the current file to its referenced target file, completing navigation to all specified target statements in that target file, and returning to the current file. All specified target statements refer to all target statements within the target file that meet preset coverage conditions, starting from the current navigation starting point and extending to the end of the target file. The current navigation starting point can be the first target statement in the target file that meets the preset coverage conditions, or a user-specified location.

[0032] The preset navigation strategy is a pre-configured strategy. During navigation, if the currently selected target statement is a file inclusion statement, the first preset navigation strategy is executed; otherwise, the second preset navigation strategy is executed. The navigation strategy determines the cross-file jump rules and status update rules.

[0033] For further information, please refer to [link / reference]. Figure 2 The first preset navigation strategy includes S310 and S330. Specifically, in S310, if the current navigation status indicator is "complete navigation," then the current navigation status indicator is updated to "incomplete navigation," and the second preset navigation strategy is executed. Please refer to [link to relevant documentation]. Figure 3 The second preset navigation strategy is to determine whether the backtracking condition is met, and execute S311 or S313 according to the determination result.

[0034] In step S311, if the condition is not met, the next target statement in the current file is searched and selected, and execution continues in step S300.

[0035] It should be noted that if the current navigation status is marked as "complete navigation," it means that the selected file inclusion statement in the current file has been navigated to and returned from its previous state. There is no need to jump to the corresponding target file again; simply proceed to the next step. Updating the current navigation status to "incomplete navigation" is to prepare for the next navigation operation.

[0036] The backtracking condition is used to determine whether the currently selected target statement, under the action of the second navigation operation, belongs to the category of needing to jump to other files.

[0037] In one implementation, the backtracking condition in S310 is: the target statement is the last target statement in the current file and the second navigation operation is a forward navigation operation, or the target statement is the first target statement in the current file and the second navigation operation is a reverse navigation operation; wherein, the forward navigation is used to find the next target statement that meets the preset coverage condition, and the reverse navigation is used to find the previous target statement that meets the preset coverage condition.

[0038] In step S313, if the condition is met, a file inclusion statement referencing the current file is searched. If found, the process jumps to the file containing the file inclusion statement, selects the file inclusion statement, updates the navigation status flag assigned to the file inclusion statement to "complete navigation", and continues to execute step S300.

[0039] It should be noted that when the backtracking condition is met, and the navigation jumps from the current file back to the file containing the file inclusion statement that references the current file, it means that the navigation of the current file has been completed, and therefore the navigation status flag is updated to "complete navigation".

[0040] In one implementation, S300 further includes: S301, if the target statement does not belong to a file inclusion statement, then execute a second preset navigation strategy, the second preset navigation strategy being: determine whether the backtracking condition is met, and execute S311 or S313 according to the determination result.

[0041] In one implementation, please refer again. Figure 2 S300 further includes: S330, if the current navigation state is identified as incomplete navigation, then according to the target file referenced by the target statement, jump to and select the first target statement in the target file that meets the preset coverage condition. It should be noted that the target statements referred to in this embodiment of the invention are all statements that meet the preset coverage condition. Specifically, S310 is used to execute the navigation strategy when the navigation state is identified as complete navigation, and S330 is used to execute the navigation strategy when the navigation state is identified as incomplete navigation.

[0042] In summary, the navigation method provided by this invention assigns a current navigation status identifier to each file inclusion statement. For incomplete navigation, it jumps normally to the corresponding file; for complete navigation and meeting the backtracking conditions, it backtracks, thereby ensuring the establishment of correct navigation relationships while navigating multiple files. During the user's navigation process, only the corresponding files need to be dynamically loaded into memory, which reduces memory consumption compared to the one-time loading in the traditional method. Furthermore, the navigation method provided by this invention does not require recursively embedding the content of the included file into the main file, thus not increasing the displayed content.

[0043] In one implementation, S330 further includes, before jumping, obtaining the preset coverage conditions of the current file; and after jumping, updating the preset coverage conditions of the target file to the preset coverage conditions of the current file.

[0044] In one implementation, S330 further includes: after jumping from the current file to the target file and the preset overwrite condition of the target file is updated to the preset overwrite condition of the current file, if a third-party file also jumps to the target file, the preset overwrite condition of the target file is updated to the preset overwrite condition of the third-party file.

[0045] It's important to note that a jump can be from the current file to the target file referenced by a file inclusion statement, or it can be from the current file to the target file containing the file inclusion statement that references the current file. The jump is based on the latest preset coverage condition of the current file; the new preset coverage condition overrides the old one. Users only need to configure the preset coverage condition for one file, and it will automatically synchronize to the referenced files during the jump. This eliminates the need for repeated configuration by the user and prevents inconsistencies in the preset coverage conditions before and after the jump, which could lead to inconsistencies in the displayed content.

[0046] As an example, please see Figure 4 ,exist Figure 2For file Av, it includes two file include statements: one referencing file Bv (`include "Bv"`) and the other referencing file Cv (`include "Cv"`). File Bv includes a file include statement referencing file Dv (`include "Dv"`). File Cv includes two file include statements: one referencing file Dv (`include "Dv"`) and the other referencing file Ev (`include "Ev"`). File Dv includes a file include statement referencing file Fv (`include "Fv"`). For file Av, based on the file include statements, it can jump to file Dv via two forward paths: the first path and the second path. The first path is: jump from file Av to file Bv, then from file Bv to file Dv. During the jump, if the user does not modify the default overriding conditions, the default overriding conditions of file Av will be sent to files Bv and Dv sequentially. The second path is: jump from file Av to file Cv, then from file Cv to file Dv. During this jump, if the user does not modify the default overwrite conditions, the default overwrite conditions for file Av will be sent to files Cv and Dv sequentially. If the first path is executed first, followed by the second, the default overwrite conditions for file Dv will be updated to match the default overwrite conditions for file Cv. Similarly, during the backtracking process, the principle of proximity is applied, updating the default overwrite conditions for file Dv to the latest default overwrite conditions.

[0047] Embodiments of the present invention also provide a non-transitory computer-readable storage medium that can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiments, wherein the at least one instruction or the at least one program is loaded and executed by the processor to implement the method provided in the above embodiments.

[0048] Embodiments of the present invention also provide an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0049] Embodiments of the present invention also provide a computer program product including program code, which, when the program product is run on an electronic device, causes the electronic device to perform the steps of the methods described above in various exemplary embodiments of the present invention.

[0050] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to 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.

[0051] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of this invention is defined by the appended claims.

Claims

1. A navigation method based on multi-file navigation, characterized in that, The method includes the following steps: S100, in response to the user's first navigation operation, finds and selects the next target statement in the current file; S300, in response to the user's second navigation operation, if the target statement is a file inclusion statement, then a current navigation state identifier is assigned to the target statement, and a first preset navigation strategy is executed according to the state value of the current navigation state identifier. The first preset navigation strategy includes: S310, if the current navigation status identifier indicates complete navigation, then update the current navigation status identifier to incomplete navigation, and determine whether the backtracking condition is met, including: S311, if not satisfied, then find and select the next target statement in the current file, and continue to execute S300; S313, if satisfied, then search for the file inclusion statement that references the current file. If found, jump to the file where the file inclusion statement is located, select the file inclusion statement, update the navigation status flag assigned to the file inclusion statement to complete navigation, and continue to execute S300. The backtracking condition in S310 is: the target statement is the last target statement in the current file and the second navigation operation is a forward navigation operation, or the target statement is the first target statement in the current file and the second navigation operation is a reverse navigation operation. The forward navigation is used to find the next target statement, and the reverse navigation is used to find the previous target statement.

2. The method according to claim 1, characterized in that, The target statement is a statement in the current file that meets the preset coverage conditions; wherein, the preset coverage conditions are the coverage metric type and coverage status type that the user specifies to view in the current file.

3. The method according to claim 1, characterized in that, The S300 also includes: S301, if the target statement does not belong to a file inclusion statement, then execute the second preset navigation strategy. The second preset navigation strategy is: determine whether the backtracking condition is met, and execute S311 or S313 according to the determination result.

4. The method according to claim 1, characterized in that, The S300 also includes: S330, if the current navigation status is marked as incomplete navigation, then based on the target file referenced by the target statement, jump to and select the first target statement in the target file that meets the preset coverage conditions.

5. The method according to claim 1, characterized in that, The starting point of the first navigation operation is the first target statement in the current file, or a position specified by the user.

6. The method according to claim 4, characterized in that, S330 further includes, before jumping: obtaining the preset overwrite conditions of the current file; After the jump, the preset overwrite conditions of the target file are updated to the preset overwrite conditions of the current file.

7. The method according to claim 4, characterized in that, S330 also includes: After jumping from the current file to the target file, and the preset overwrite condition of the target file is updated to the preset overwrite condition of the current file, if a third-party file also jumps to the target file, the preset overwrite condition of the target file is updated to the preset overwrite condition of the third-party file.

8. A non-transitory computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the method as described in any one of claims 1-7.

9. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 8.

Citation Information

Patent Citations

  • Log query and forwarding method and device, equipment and storage medium

    CN117271467A

  • Statement analysis method and device, equipment, storage medium and product

    CN119336784A