A fast word segmentation system for cross-module references
By using a quick word-cutting system in chip design, using the database to store the first and tail column information of preset words for prefix word analysis, the problem of large and low efficiency of cross-module reference storage space, and memory savings and functional improvements are achieved.
Patent Information
- Application Number
- CN202411138489.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2044-08-19
AI Technical Summary
In the chip design, the storage space of cross-module reference (XMR) consumes a lot, and the code interface function execution efficiency is low, especially when deep references are high.
A fast word cutting system is adopted to store the first and last column information of preset words and their subwords through a database, and perform prefix word analysis using a processor to form reference words to reduce storage space and improve search efficiency.
It effectively reduces the memory space occupied by XMR word storage, improves the function execution efficiency of the code interface, and reduces the cost of search and highlighting functions.
Smart Images

Figure CN119089900B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chip design verification, and in particular to a fast word segmentation system for cross-module references. Background Art
[0002] Cross Module Referencing (XMR), also known as hierarchical referencing, is a built-in mechanism in Verilog, HDL, and SystemVerilog languages that is used to globally reference a network in a hierarchy in any module. Any network in a specific module in a different module can be directly referenced through XMR without going through a port.
[0003] In chip design code, XMR is widely used to facilitate referencing signals from one module within another. As design code grows, the reference hierarchy deepens, potentially leading to a single XMR object having a deep reference hierarchy. In this situation, developers and verifiers must not only monitor the complete signal but also the preceding index-level signals at any level within that signal. Existing techniques typically record XMR words in separate fragments.
[0004] However, directly splitting and recording XMR words requires recording multiple pre-index level signals corresponding to an XMR word containing multiple sub-words. This method consumes more storage space to record the newly added words, increases the implementation cost of functions such as word search and keyword highlighting, and also reduces the functional execution efficiency of the code interface.
[0005] Therefore, how to reduce the memory space occupied by word segmentation and improve the functional execution efficiency of the code interface has become an urgent problem to be solved. Summary of the Invention
[0006] In view of the above technical problems, the technical solution adopted by the present invention is:
[0007] A fast word segmentation system for cross-module references, the system comprising: a database, a processor and a memory storing a computer program, wherein the database comprises M preset words [a1, a2, ..., a m ,…,a M ], a m is the mth preset word, where m is an integer in the range [1, M], and a m Including K(m) subwords [b m 1, b m 2,…,b m k(m) ,…,b m k(m) ], b mk(m) is the k(m)th subword in the mth preset word, k(m) is an integer in the range [1, K(m)], b m k(m) Corresponding to the first column information c m k(m)1 and tail column information c m k(m)2 , when the computer program is executed by a processor, the following steps are implemented:
[0008] S101, obtaining a target range selected by the user, and determining a preset word a corresponding to the target range from the M preset words n As the target word, determine a n The corresponding first column information c 1 11 , n is an integer in the range [1, M].
[0009] S102, based on the target range and a n The tail column information corresponding to the k(n) subwords in the is used to determine the current word.
[0010] S103: If the current word has a corresponding prefix word, a reference word is formed by the current word and the prefix word.
[0011] S104: Determine reference position information corresponding to the reference word.
[0012] S105, if the reference location information does not include c 1 11 , then take the reference word as the current word and return to step S103 until the reference position information contains c 1 11 , taking the reference word as the word segmentation result.
[0013] Compared with the prior art, the present invention has significant advantages. By means of the above technical solution, the fast word segmentation system for cross-module references provided by the present invention can achieve considerable technological advancement and practicality, and has wide industrial application value. It has at least the following advantages:
[0014] The present invention provides a fast word segmentation system for cross-module reference, the system comprising: a database, a processor and a memory storing a computer program, wherein the database comprises M preset words [a1, a2, ..., a m ,…,a M ], a m is the mth preset word, where m is an integer in the range [1, M], and a m Includes K(m) subwords [bm 1, b m 2,…,b m k(m) ,…,b m k(m) ], b m k(m) is the k(m)th subword in the mth preset word, k(m) is an integer in the range [1, K(m)], b m k(m) Corresponding to the first column information c m k(m)1 and tail column information c m k(m)2 When the computer program is executed by the processor, the following steps are implemented: S101, obtaining the target range selected by the user, and determining the preset word a corresponding to the target range from the M preset words n As the target word, determine a n The corresponding first column information c 1 11 , n is an integer in the range of [1, M], S102, according to the target range and a n The tail column information corresponding to the k(n) subwords in the word is used to determine the current word. S103: if the current word has a corresponding prefix word, the current word and the prefix word form a reference word. S104: determine the reference position information corresponding to the reference word. S105: if the reference position information does not contain c 1 11 , then take the reference word as the current word and return to step S103 until the reference position information contains c 1 11 , taking the reference word as the word segmentation result.
[0015] It can be seen that multiple preset words each containing several sub-words are directly stored in the database. When used, the pre-order index words are determined by prefix word analysis without the need for split storage, which effectively reduces the memory space occupied by XMR word storage. The reduction in the number of stored words also effectively improves the efficiency of word segmentation and search, thereby improving the functional execution efficiency of the code interface. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] 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.
[0017] Figure 1A flowchart of a computer program executed by a processor in a fast word segmentation system for cross-module references provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0019] This embodiment provides a fast word segmentation system for cross-module references, the system comprising: a database, a processor, and a memory storing a computer program, wherein the database comprises M preset words [a1, a2, ..., a m ,…,a M ], a m is the mth preset word, where m is an integer in the range [1, M], and a m Including K(m) subwords [b m 1, b m 2,…,b m k(m) ,…,b m k(m) ], b m k(m) is the k(m)th subword in the mth preset word, k(m) is an integer in the range [1, K(m)], b m k(m) Corresponding to the first column information c m k(m)1 and tail column information c m k(m)2 , see Figure 1 , which is a flow chart of a computer program executed by a processor in a fast word segmentation system for cross-module references provided by an embodiment of the present invention. When the computer program is executed by the processor, the following steps are implemented:
[0020] S101, obtaining a target range selected by the user, and determining a preset word a corresponding to the target range from the M preset words n As the target word, determine a n The corresponding first column information c 1 11 , n is an integer in the range [1, M];
[0021] S102, based on the target range and a n The tail column information corresponding to the k(n) subwords in the word is used to determine the current word;
[0022] S103, if the current word has a corresponding prefix word, forming a reference word by the current word and the prefix word;
[0023] S104, determining reference position information corresponding to the reference word;
[0024] S105, if the reference location information does not include c 1 11 , then take the reference word as the current word and return to step S103 until the reference position information contains c 1 11 , taking the reference word as the word segmentation result.
[0025] The preset word may refer to an XMR word. The preset word may include several subwords. The subwords may be separated by preset characters. The preset characters may be punctuation characters, etc. The first column of information c m k(m)1 It can refer to the column information corresponding to the first character of the k(m)th subword. Correspondingly, the tail column information c m k(m)2 It may refer to the column information corresponding to the last character of the k(m)th sub-word. It should be noted that, in this embodiment, the row information of the target word is consistent with the row information of each sub-word it contains, so it will not be elaborated on.
[0026] Specifically, the database can use a lightweight database based on DmNode. DmNode is a lightweight data structure that records object IDs and types to construct target objects. This allows for rapid response to the loading and searching of a large number of objects of different types, conserving memory and improving operational efficiency.
[0027] In a specific implementation, obtaining the target range selected by the user includes:
[0028] When the user performs a first operation, the range corresponding to the first operation is used as the target range.
[0029] The first operation may refer to a user performing a drag-select operation on the selected XMR word, and accordingly, the target range is a range corresponding to the drag-select operation.
[0030] In one embodiment, based on the user performing the second operation, when the user performs the first operation, the range corresponding to the first operation is used as the target range. The second operation may refer to the user selecting the XMR word, and the selection operation may be implemented by a single click or other operation method.
[0031] In a specific embodiment, the target range corresponds to the tail column information d2, and step S102 includes the following steps:
[0032] S1021, if there is a sub-word among the k(n) sub-words whose corresponding tail column information is the same as d2, then the sub-word is used as the current word;
[0033] S1022: Otherwise, the subword corresponding to the tail column information that is smaller than d2 and has the smallest difference with d2 is used as the current word.
[0034] Among them, this embodiment allows the target range corresponding to the user operation not strictly corresponding to the preceding index word. When the last column information of the target range is not the last column information of a sub-word, it means that the user has not selected a complete sub-word at this time, and the most recent sub-word before the last column information of the target range is used as the current word.
[0035] It should be noted that, since the pre-order index words in this embodiment are determined by prefix word analysis, the first column information of the target range can be before the first column information of the target word, but the user is required to not select other subwords before the first column information of the target word.
[0036] In a specific implementation, step S103 includes:
[0037] If in a n If there is a subword adjacent to the current word and before the current word, the subword is determined to be a prefix word corresponding to the current word, and a reference word is formed by the current word and the prefix word.
[0038] In a specific implementation, determining the reference position information corresponding to the reference word includes:
[0039] The reference position information corresponding to the reference word is formed using the first column information of the prefix word and the last column information of the current word.
[0040] In a specific embodiment, after step S101 and before step S102, the following steps are further included:
[0041] S201, determining the type information corresponding to the target word;
[0042] S202: If the type information meets the preset condition, execute step S102.
[0043] The type information can be determined by searching the database for the corresponding ID and type. The ID can be regarded as the key, and the type can be regarded as the value. The value corresponding to the target word is first determined by the ID, and then the type information is determined by the value.
[0044] Specifically, the preset condition may be that the type information is among a plurality of preset limited types, and the type information may include module type, instance type, signal type, function type, and the like.
[0045] Through this embodiment, after determining that the type of the target word does not meet the preset conditions, subsequent prefix word analysis is not performed, thereby avoiding invalid iterative operations and further ensuring the efficiency of code interface operations.
[0046] In a specific embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0047] The display mode of the word segmentation result is determined according to the type information.
[0048] The display mode may refer to the color corresponding to the highlighted word segmentation result.
[0049] In a specific embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0050] According to the type information, the functions supported by the word segmentation result are determined.
[0051] Among them, when the type information is a signal type, the functions supported by the segmentation result may include search, trace / load, drag and select, etc. When the type information is a module type, instance type, or function type, the functions supported by the segmentation result may include search, drag and select, etc.
[0052] Specifically, the implementer can set the user to perform a third operation on the word segmentation result and select a corresponding function to execute. The third operation may refer to right-clicking.
[0053] In this embodiment, multiple preset words each containing several sub-words are directly stored in the database. When used, the pre-order index word is determined by prefix word analysis without the need for split storage, which effectively reduces the memory space occupied by XMR word storage. The reduction in the number of stored words also effectively improves the efficiency of word segmentation and search, thereby improving the functional execution efficiency of the code interface.
[0054] Although some specific embodiments of the present invention have been described in detail by way of example, it will be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present invention. It will also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A fast word segmentation system for cross-module references, characterized in that: The system includes: a database, a processor and a memory storing a computer program, wherein the database includes M preset words [a1, a2, ..., a m ,…,a M ], a m is the mth preset word, where m is an integer in the range [1, M], and a m Includes K(m) subwords [b m 1, b m 2,…,b m k(m) ,…,b m K(m) ], b m k(m) is the k(m)th subword in the mth preset word, k(m) is an integer in the range [1, K(m)], b m k(m) Corresponding to the first column information c m k(m)1 and tail column information c m k(m)2 , when the computer program is executed by a processor, the following steps are implemented: S101, obtaining a target range selected by the user, and determining a preset word a corresponding to the target range from the M preset words n As the target word, determine a n The corresponding first column information c 1 11 , n is an integer in the range [1, M]; S102, based on the target range and a n The tail column information corresponding to the k(n) subwords in the target range is respectively determined to determine the current word, wherein the target range corresponds to the tail column information d2, and step S102 includes the following steps: S1021, if there is a sub-word among the k(n) sub-words whose corresponding tail column information is the same as d2, then the sub-word is used as the current word; S1022, otherwise, the subword corresponding to the tail column information that is smaller than d2 and has the smallest difference with d2 is used as the current word; S103, if the current word has a corresponding prefix word, forming a reference word by the current word and the prefix word; S104, determining reference position information corresponding to the reference word; S105, if the reference location information does not include c 1 11 , then take the reference word as the current word and return to step S103 until the reference position information contains c 1 11 , taking the reference word as the word segmentation result.
2. The fast word segmentation system for cross-module reference according to claim 1 is characterized in that: The step of obtaining the target range selected by the user includes: When the user performs a first operation, the range corresponding to the first operation is used as the target range.
3. The rapid word segmentation system for cross-module reference according to claim 1 is characterized in that: Step S103 includes: If in a n If there is a subword adjacent to the current word and before the current word, the subword is determined to be a prefix word corresponding to the current word, and a reference word is formed by the current word and the prefix word.
4. The rapid word segmentation system for cross-module reference according to claim 1 is characterized in that: The determining of the reference position information corresponding to the reference word includes: The reference position information corresponding to the reference word is formed using the first column information of the prefix word and the last column information of the current word.
5. The rapid word segmentation system for cross-module reference according to claim 1 is characterized in that: After step S101 and before step S102, the following steps are further included: S201, determining the type information corresponding to the target word; S202: If the type information meets the preset condition, execute step S102.
6. The rapid word segmentation system for cross-module reference according to claim 5, characterized in that: When the computer program is executed by a processor, the following steps are also implemented: The display mode of the word segmentation result is determined according to the type information.
7. The rapid word segmentation system for cross-module reference according to claim 5, characterized in that: When the computer program is executed by a processor, the following steps are also implemented: According to the type information, the functions supported by the word segmentation result are determined.
Citation Information
Patent Citations
Character string data retrieval method and device, computer equipment and storage medium
CN111339382A