Multi-port comparator circuit and its construction method

By designing a multi-port comparator circuit based on standard cells, integrating multi-bit comparison and logical AND operations, the problems of high complexity and delay growth in CAM design are solved, achieving short design cycle, controllable area, and improved performance.

CN123119982APending Publication Date: 2026-11-17LOONGSON TECH CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611289992.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-24
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In the prior art, content addressable memory (CAM) has problems such as high design complexity, long verification process and poor mobility across process nodes in multi-port comparator circuit design. In addition, it has large area overhead and excessively fast delay growth in multi-port cases.

Method used

A multi-port comparator circuit design based on standard cells is adopted. By selecting appropriate circuit cells, multi-bit comparison and logic AND operations are integrated in a single comparison cell, reducing the number of gate levels and the number of traces within the cell. Combined with a custom layout, the area is compressed and the latency is reduced.

Benefits of technology

This invention enables multi-port comparator circuits to have short design cycles, simple verification, convenient cross-manufacturing process node portability, reduced latency and area, and improved circuit speed and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123119982A_ABST
    Figure CN123119982A_ABST
Patent Text Reader

Abstract

This application provides a multi-port comparison circuit and a method for constructing it, comprising: n comparison units and n logic units; each comparison unit includes m multi-bit comparison sub-units, and the n comparison units and n logic units correspond one-to-one; the n comparison units correspond one-to-one with n stored data; the comparison units are used to implement multi-bit comparisons and logical AND operations to compare the keyword data input from each input port with the stored data; the logic units are used to perform logical operations on the comparison results of each input port; wherein, the number of input ports of the multi-port comparison circuit is m, and the number of stored data is n. Compared with related technologies, this application significantly reduces the physical area of ​​the circuit and improves the circuit speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, specifically relating to a multi-port comparator circuit and a method for constructing a multi-port comparator circuit. Background Technology

[0002] Content-Addressable Memory (CAM) is a special storage structure that can perform parallel comparisons of an input keyword with all entries in its internal storage within a single clock cycle and ultimately return the matching result.

[0003] In related technologies, one implementation scheme allows both the storage unit and the comparison circuit of the CAM unit to adopt a transistor-based full-custom design. Another implementation scheme uses a latch instead of a flip-flop as the basic storage unit in the CAM unit. The output of the latch is compared with the query data bit using an XOR operation, and each matching result is connected to an AND gate to finally output the matching result.

[0004] However, the first approach faces challenges in terms of design complexity and limited applicability. The second approach, which combines a standard unit of an XOR comparator and a multi-input AND gate, suffers from significant overall latency and also faces limitations in applicability. Summary of the Invention

[0005] This application aims to provide a multi-port comparator circuit and a method for constructing a multi-port comparator circuit, thereby at least addressing the problems in the prior art.

[0006] To solve the above-mentioned technical problems, this application is implemented as follows: In a first aspect, embodiments of this application provide a multi-port comparison circuit, including: n comparison units and n logic units; Each comparison unit includes m multi-bit comparison sub-units, and the n comparison units correspond one-to-one with the n logic units; the n comparison units correspond one-to-one with the n stored data. The comparison unit is used to perform multi-bit comparison and logical AND operation to compare the keyword data input from each input port with the stored data respectively; the logic unit is used to perform logical operations on the comparison results of each input port. The multi-port comparator circuit has m input ports and n stored data.

[0007] Secondly, embodiments of this application also provide a method for constructing a multi-port comparison circuit, the method comprising: Based on the parameters of the stored data and the preset number of input ports, the circuit units used to construct the circuit are determined. The circuit units include a comparison unit and a logic unit. The comparison unit is used to perform multi-bit comparison and logical AND operation to compare the keyword data input from each input port with the stored data respectively. The logic unit is used to perform logical operations on the comparison results of each input port. The layout of each circuit unit in the circuit is set, and the top-level module of the circuit is constructed to obtain the initial circuit; The initial circuit is verified, and a multi-port comparison circuit is obtained when the verification is successful.

[0008] In this application embodiment, compared to the fully custom design schemes and latch replacement schemes in related technologies, this application embodiment can build CAM based on standard cells, which makes the design cycle of multi-port comparator circuits shorter, the design and verification process simpler and more convenient, and has strong portability across manufacturing process nodes, as well as strong matching and migration capabilities for different circuit structures. Specifically, this application integrates the related circuit structure of multi-bit comparison combined with logical AND into a single comparator cell, replacing the cascaded scheme in related technologies. This directly reduces the delay of the comparison path by reducing the number of gate levels and shortening the wiring within the cell, while simultaneously compressing the total cell area. Furthermore, the comparator circuit based on standard cells avoids the problems of large area overhead and rapid delay growth in multi-port cases of fully custom schemes. Specific requirements can be met by selecting appropriate combinations of standard cells, such as improving performance and reducing overall area. The customized layout of the cells further compresses the circuit area and improves the circuit speed. Attached Figure Description

[0009] Figure 1 This is a flowchart illustrating the steps of constructing a multi-port comparator circuit according to an embodiment of this application. Figure 2 This is a multi-port comparison circuit diagram provided in an embodiment of this application; Figure 3 This is a flowchart illustrating a method for constructing a multi-port comparison circuit according to an embodiment of this application. Detailed Implementation

[0010] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0011] Reference Figure 1 and Figure 2 , Figure 1 This is a flowchart illustrating the steps of constructing a multi-port comparator circuit according to an embodiment of this application. Figure 2 This is a structural diagram of a multi-port comparator circuit provided in an embodiment of this application, such as... Figure 1 As shown, the method may include: Step 101: Determine the circuit units used to construct the circuit based on the parameters of the stored data and the preset number of input ports.

[0012] The circuit unit includes a comparison unit and a logic unit; the comparison unit is used to perform multi-bit comparison and logical AND operation to compare the keyword data input from each input port with the stored data respectively; the logic unit is used to perform logical operations on the comparison results of each input port.

[0013] Step 102: Set the layout of each circuit unit in the circuit and construct the top-level module of the circuit to obtain the initial circuit.

[0014] Step 103: Verify the initial circuit. When the verification is successful, a multi-port comparison circuit is obtained.

[0015] Further reference Figure 2 The multi-port comparison circuit includes: n comparison units and n logic units; each comparison unit includes m multi-bit comparison subunits, and the n comparison units and n logic units correspond one-to-one; the n comparison units correspond one-to-one with n stored data; the comparison units are used to implement multi-bit comparison and logical AND operation to compare the keyword data input from each input port with the stored data respectively; the logic units are used to perform logical operations on the comparison results of each input port; wherein, the number of input ports of the multi-port comparison circuit is m, and the number of stored data is n.

[0016] CAM can perform parallel comparisons of the input keyword with all entries in internal storage within a single clock cycle, ultimately returning a matching result (such as the matching address, data, and flags). This content-based high-speed parallel search capability makes CAM widely used in core modules of modern processors, such as cache tag alignment, issue queue wake-up, branch predictors, and translation lookaside buffers (TLBs) in memory management units. Its performance directly determines the processor's data throughput and overall efficiency. The core of CAM's high-speed parallel search function lies in its peripheral comparison circuit. This circuit is responsible for performing bit-level comparisons between the search keyword and stored data, performing a logical AND operation on each bit's comparison result, and generating a local matching result.

[0017] As modern processors evolve towards multi-issue, multi-core architectures, their instruction parallel execution capabilities have significantly improved, placing higher demands on the parallel search capabilities of CAM (Computer-Aided Processing). Specifically, single-port schemes only support one set of keyword comparisons, while multi-port schemes require simultaneous comparisons of multiple sets of keyword data, i.e., multi-port comparisons. In multi-port comparisons, the comparison results from each port need to be logically ORed to obtain the final matching result. Therefore, the timing of the comparison circuit (i.e., the delay from keyword input to a stable matching result) is often a critical part of determining the CAM access timing, and its performance directly restricts the CAM's operating frequency, thus affecting the overall processor performance.

[0018] In related technologies, the design of fully custom circuits suffers from complex design and verification processes, long cycles, and poor portability across process nodes. When expanded to multi-port, it adds a large number of transistors and wiring, resulting in a dramatic increase in circuit area, parasitic parameters, and signal delay, directly slowing down the operating frequency of the CAM and even the entire processor. On the other hand, the design of standard unit circuits simply splices together basic units such as XOR gates and AND gates, resulting in large overall delay.

[0019] To address the aforementioned issues, this application provides a solution for multi-port scenarios that balances low latency, controllable area, reasonable power consumption, short design cycle, and strong portability. Specifically, the purpose of this application is to construct a multi-port comparison circuit. In the construction method of the multi-port comparison circuit, the first step is to select appropriate circuit units. Since the multi-port comparison circuit pre-stores data, and the circuit's function is to compare the keyword data input from each of the multiple ports with the stored data, in the unit selection step, appropriate circuit units can be selected based on the parameters of the stored data and the number of ports used for inputting keyword data to achieve complete comparison functionality.

[0020] The entire comparison logic is mainly divided into two parts. The first part involves performing a logical AND operation after comparing the stored data and the input keyword data bit by bit (for bit-level matching of a single stored data entry). The second part involves performing a logical OR operation between the matching results of each input port to obtain the final multi-port matching result (summarizing the matching signals of multiple ports). Therefore, the circuit unit selected in this embodiment may include a comparison unit and a logic unit. The comparison unit is used to implement multi-bit comparison and logical AND operation to compare the keyword data with the stored data respectively; the logic unit is used to perform logical operations (such as logical OR operation) on the comparison results of each input port.

[0021] In cell selection, circuit cells can be chosen based on a mature standard cell library. This approach offers convenient verification and cross-process transferability, fundamentally avoiding the high design and migration costs of fully custom solutions. Furthermore, the circuit cells selected in this application integrate the first-level logic combining multi-bit comparisons and AND operations into a single comparison cell, replacing the cascaded schemes of multiple XOR gates combined with multi-input AND gates in related technologies. This allows this application to directly reduce the latency of single-port comparison paths by reducing the number of gate stages and shortening the wiring within the cell, while simultaneously compressing the total cell area and specifically improving the performance of the core comparison logic.

[0022] It should be noted that the timing performance of the comparison circuit can be improved by customizing standard units with specific functions in this application. Specifically, it can be designed directly at the transistor level, completing all functions of bit-by-bit comparison and logical AND with a single comparison unit. For example, this application customizes multi-bit comparison units to complete the comparison of multiple bits of data using a single unit. The customized comparison unit can be constructed in various ways, such as static complementary metal-oxide-semiconductor (CMOS) circuits, transmission gate circuits, dynamic circuits, or a hybrid mode of these circuits. This makes the delay of the comparison unit less than the delay of the combination unit that performs the logical AND after the bit-by-bit comparison, thus optimizing the circuit performance.

[0023] Optionally, the logic unit is a logical OR operation unit; In this embodiment, the logic OR unit essentially implements an OR gate with m inputs. However, standard cell libraries typically lack OR gates with a large number of inputs. This embodiment can implement this using cascaded small cells. Taking m=12 (12 input ports) as an example, in multi-port scenarios, the logic OR unit can utilize multi-level gate circuits, such as combinations of 3-input NOR gates (NOR3) and 4-input NAND gates (NAND4), or combinations of 4-input NOR gates (NOR4) and 3-input NAND gates (NAND3), etc., with the combination scheme differentiated according to port timing priority. The principle of this scheme is to group the 12 inputs, for example, using NOR4 (4-input NOR) to divide them into 3 groups, and then using NAND3 (3-input NAND) to summarize them, ultimately achieving the function of 12-input OR. This scheme can be implemented using two levels of gates, resulting in low latency, a small number of cells, and suitability for scenarios where all ports have consistent timing requirements and overall balance is sought.

[0024] However, for timing-critical input ports, a two-stage implementation using a combination of NOR3 and NAND3 can be considered, while other non-timing-critical input ports can be implemented using a three-stage implementation such as 2-input OR gates (OR2, 2-input OR Gate), NOR3, and NAND3. The principle is to use two-stage gates for timing-critical ports (such as those related to the processor's critical path) to achieve low latency; and to use three-stage gates (such as OR2+NOR3+NAND3) for non-timing-critical ports to save area. This scheme can reduce the latency of critical paths while controlling the overall area by distinguishing between critical and non-critical paths. This scheme is suitable for scenarios where the circuit has a clearly defined critical timing path.

[0025] To obtain optimal performance and area parameters, different unit combinations can be compared and screened. This allows for the selection of the solution with the best performance, power, and area (PPA).

[0026] Furthermore, after selecting the units, the layout of each circuit unit in the circuit can be set, and the top-level module of the circuit can be constructed to obtain the initial circuit. The significance of setting the layout of each circuit unit is to arrange them closely together horizontally in their corresponding columns, and to complete the interconnection between the comparison and logic units included in the circuit unit. Then, the entire row of units is stacked to complete the overall layout. The purpose of this layout process is to compress the spacing between units, shorten the length of the interconnections between units, optimize the allocation of wiring resources, and prioritize the efficiency of core signal transmission. By optimizing the layout, the overall circuit area can be significantly reduced, parasitic resistance and capacitance of interconnections can be lowered, and signal delay can be further reduced.

[0027] In addition, after placement, the top-level module of the circuit can be built. The top-level module is the functional module at the very top of the current design level in the layered design of digital integrated circuits; specifically, it is an upper-level module responsible for integrating and scheduling all lower-level sub-modules. The construction of the top-level module is used to complete the integration of the comparator circuit and the processor's top-level system, realizing the physical assembly and timing coordination of the overall circuit. It should be noted that after placement, the PPA (Power, Performance, and Achievement) indicators of the circuit placement can be checked. If they do not meet the standards, the process returns to re-optimize cell selection or placement; if they meet the standards, the process proceeds to the next stage.

[0028] After obtaining the initial circuit, it can be audited. If the audit is successful, a multi-port comparator circuit is obtained. The purpose of the audit is to disassemble the initial circuit, which is a black box, back into its original standard cells and internal connections, without further encapsulation or isolation. Then, a final inspection of the entire process is carried out, including equivalence verification, power consumption analysis, and power and ground integrity testing. This completes the chip design audit. When all these tests pass, the circuit design can meet the actual requirements and is finally constructed into a multi-port comparator circuit.

[0029] In summary, compared to the fully custom design schemes and latch alternatives in related technologies, the embodiments of this application can build CAM based on standard cells, resulting in shorter design cycles, simpler and more convenient design and verification processes for multi-port comparator circuits, strong portability across manufacturing process nodes, and strong matching and migration capabilities for different circuit structures. Specifically, this application integrates the related circuit structure of multi-bit comparison combined with logical AND into a single comparator cell, replacing the cascaded schemes in related technologies. This directly reduces the delay of the comparison path by reducing the number of gate levels and shortening the wiring within the cell, while simultaneously compressing the total cell area. Furthermore, the comparator circuit based on standard cells avoids the problems of large area overhead and rapid delay growth in multi-port cases associated with fully custom schemes. Specific requirements can be met by selecting appropriate combinations of standard cells, such as improving performance and reducing overall area. The customized layout of the cells further compresses the circuit area and improves the circuit speed.

[0030] Optionally, the number of input ports is m, and the parameter for storing data includes the amount of data to be stored, n; step 101 may specifically include: Sub-step 1011: Construct n comparison units and n logic units. Each comparison unit includes m multi-bit comparison sub-units. The n comparison units and n logic units correspond one-to-one, and the n comparison units correspond one-to-one with n stored data.

[0031] In the embodiments of this application, reference is made to Figure 2 In a multi-port scenario, with m input ports (m≥2) and n pre-stored data in the CAM, based on these parameters, n comparison units and n logic units can be constructed during unit selection. The n comparison units and n logic units correspond one-to-one, and the n comparison units correspond one-to-one with the n stored data, thus forming n unit groups. Each unit group includes one corresponding comparison unit and one logic unit. Each unit group is used to compare the corresponding stored data with m key data. Since each unit group needs to perform m comparisons, each comparison unit can include m multi-bit comparison sub-units, each of which performs one comparison operation. The logic units in the unit group are used to perform a logical OR operation on the results of the m comparisons.

[0032] Based on the above design, the embodiments of this application realize the circuit layout of independent parallel comparison and result output links (logical OR) for a single set of stored data. This is the core architecture design of the comparison circuit in CAM, that is, to complete the parallel comparison of all stored items in a single clock cycle. This one-to-one correspondence architecture is the physical basis of this feature.

[0033] In this embodiment, each of the n groups of stored data has an independent comparison unit, which does not occupy resources. All stored items can be compared with the keyword data of m input ports simultaneously, and all matching results can be output in a single cycle, ensuring the high-speed characteristics of the CAM. In addition, the structure of the comparison path of each group of stored data is completely consistent, which makes the path length, gate level, and parasitic parameters of all rows in the circuit basically consistent, and the timing delay is highly balanced. During the design, as long as the timing of a single row (unit group) is optimized, the timing of all rows can be guaranteed to meet the standards, which significantly reduces the timing convergence difficulty of large-scale arrays and ensures the stability of the circuit operating frequency. This parallel design can also achieve uniform distribution of signal load and optimize power consumption and delay performance. Moreover, this parallel design has strong scalability and high design reusability. When it is necessary to increase the number of stored items, the single row structure of the unit group can be directly copied; when it is necessary to increase the number of ports, it is only necessary to add more comparison sub-units in each comparison unit. The overall architecture does not need to be changed during expansion, and the design results of placement and routing and timing optimization can be highly reused, which can quickly adapt to the CAM requirements of different capacities and different numbers of ports, and significantly shorten the design iteration cycle.

[0034] Optionally, the n×m multi-bit comparison sub-units are arranged in a matrix; each comparison unit corresponds to a row in the matrix.

[0035] In each row of comparison units, the spacing between two adjacent multi-bit comparison sub-units is less than or equal to 25% of the width of the multi-bit comparison sub-unit.

[0036] In each column of n multi-bit comparison sub-units, the spacing between two adjacent multi-bit comparison sub-units is less than or equal to 10% of the height of the multi-bit comparison sub-unit.

[0037] In the process of constructing the multi-port comparator circuit in this application embodiment, following the above-mentioned unit selection operation, n×m multi-bit comparator sub-units can be constructed. These n×m multi-bit comparator sub-units can then be arranged in a matrix layout. This design can standardize the circuit structure, that is, the comparator units customized in this application embodiment have uniform physical dimensions. When arranged in a matrix, the units in the same row are closely aligned laterally, and the unit spacing can be compressed to the minimum value allowed by the process rules; the rows are vertically aligned and stacked, and the row spacing can also be minimized. Compared with the messy placement of automatic layout, this orderly arrangement completely eliminates scattered blank redundant areas, the circuit outline is regular, and the area utilization rate is significantly improved. For CAMs that are expanded by array, the area gain is extremely obvious. In addition, under the matrix arrangement, the pin heights of the same signal can be aligned. Pin alignment eliminates the need for routing, greatly reduces the wiring channel occupation, and further compresses the overall area.

[0038] Optionally, step 102 may specifically include sub-steps 1021-1023: Sub-step 1021: Connect the input terminals of each of the m multi-bit comparison sub-units included in each comparison unit to the port for storing data corresponding to the comparison unit.

[0039] Sub-step 1022: Connect the input terminals of each of the m multi-bit comparison sub-units included in each comparison unit to the m input ports one by one.

[0040] Sub-step 1023: Connect the output terminals of the m multi-bit comparison sub-units included in each comparison unit to the logic unit corresponding to the comparison unit.

[0041] Each comparison unit comprises m multi-bit comparison sub-units, each with its own input terminal connected to the corresponding storage data port. This ensures that each of the m multi-bit comparison sub-units can receive one piece of stored data. Furthermore, each of the m multi-bit comparison sub-units is connected to one of the m input ports, allowing each of the m multi-bit comparison sub-units to receive m key data points. Based on this, each multi-bit comparison sub-unit can perform one comparison; that is, it compares the received key data with the corresponding stored data for that row. A single row (one unit group) in the circuit can perform m comparisons, resulting in m comparison results for each row.

[0042] The output terminals of the m multi-bit comparison sub-units included in each comparison unit are connected to the logic unit corresponding to the comparison unit, so that the m comparison results of each row can be summarized into the logic unit of that row for logical OR operation, thereby obtaining the final matching result of that row.

[0043] Optionally, the parameters of the stored data may also include the number of bits w of the stored data; the data processing length used by the multi-bit comparison subunit is w.

[0044] Optionally, the parameters for storing data also include the number of bits w of the stored data; the comparison subunit includes w comparators, which include any one of an XNOR gate comparator, a multiplexer, a first AND-last OR inverter, and a first OR-last AND inverter; the comparison subunit also includes a logic AND operation unit, and the output terminals of the w comparators in each comparison subunit are respectively connected to the logic AND operation unit included in the comparison subunit.

[0045] In this embodiment, the core logic of CAM is to determine whether a whole set of stored data and keyword data are completely equal. Only when all bits match is a valid match signal output. The storage data bit width w corresponds to the processing length of the multi-bit comparison subunit, meaning that a single comparison subunit can independently complete the complete process of w-bit bit-by-bit equality comparison and full-bit result logical AND. Thus, a single comparison subunit can directly output the matching result of that port. However, related technologies require a scheme of w 1-bit XOR gates + multi-level AND gate cascaded to implement w-bit comparison. This causes the signal to pass through the transmission delay of multi-bit comparison gates and multi-level AND gates in sequence, and then the parasitic delay of the interconnection lines between units is added, resulting in a very high overall path delay. Compared with related technologies, this embodiment does not require additional cascaded summarization logic. Instead, it integrates the full-bit width comparison and logical reduction logic into a single unit, forming a complete closed loop in terms of function. That is, this embodiment can complete the function of the original multi-level unit with a single-level unit, which not only greatly reduces the number of gate levels, but also completely eliminates the interconnection line delay between units.

[0046] In some embodiments, the comparison subunit includes: w comparators, which include any one of the following: an XNOR gate comparator, a multiplexer, a first AND-after OR inverter, and a first OR-after AND inverter; the comparators can be selected based on a standard unit library, and the comparators can be combinations of XNOR and AND units, multiplexers (MUX, Multiplexer), AND-OR-Invert gates (AOI, AND-OR-Invert), OR-AND-Invert gates (OAI, OR-AND-Invert), etc.; among them, the XNOR and AND combination scheme is logically straightforward and easy to understand; the MUX scheme uses a 2-to-1 MUX to implement equality comparison, with the key bit as the selection end and the stored data bit / inverted as the input, outputting 1 when equal, and this scheme has low latency; the AOI / OAI composite unit scheme converts the XNOR and AND combination logic into AND-OR-NOT / OR-AND-NOT form, and implements multi-level logic with a single composite unit, and this scheme has high integration, lower latency than cascaded basic gates, and smaller area.

[0047] Furthermore, each of the w comparators corresponds to one bit of the data, performing a single-bit equality check. When the corresponding bit of the stored data matches the corresponding bit of the keyword data, the comparator outputs a high level (logic 1); otherwise, it outputs a low level (logic 0). Then, a logic AND unit performs a full AND operation on the outputs of the w comparators. Only when all bits are equal (i.e., all w bits are equal) will the logic AND unit output a high level, indicating a perfect match between the stored data and the keyword at that port. If any single bit is unequal, the output of the logic AND unit will be low, indicating a mismatch. This design clearly separates bit-level judgment and logic operations, defining functional boundaries and ensuring the accuracy of the comparison results from the logical root, forming the functional foundation of the entire CAM comparator circuit.

[0048] Furthermore, if w comparators and AND gates are distributed as independent standard units, external wiring is required between the units, introducing additional parasitic resistance and capacitance, resulting in significant line delay. However, by integrating all logic into a single comparator sub-unit, the shortest path routing can be planned at the transistor level, completely eliminating interconnect delay between units and significantly reducing the total delay of a single-port comparator path.

[0049] For example, if w=4, the four comparators correspond to bits 0 to 3 respectively. Only when the four conditions of bit 0 being equal, bit 1 being equal, bit 2 being equal, and bit 3 being equal are met simultaneously will the AND gate output a valid match signal, thus fully complying with the logic rule that a match is only achieved when the data is completely equal.

[0050] It's important to note that during circuit layout and routing, the power and ground networks for multi-port comparator circuits should be planned to provide as much routing resource as possible for signal lines while ensuring sufficient power supply. For critical signal lines, such as fan-out traces for stored data and keyword data, and logic reduction traces, manual routing can be used to customize the routing and minimize the impact of line delay. Alternatively, special routing rules can be set, such as multiple trace widths or high-layer routing. For example, given a 7-layer routing resource: high-layer routing can refer to using layers 5-7 for routing to reduce line delay. Multiple trace widths are metal lines wider than the standard trace width. For example, assuming the standard trace width of layer 7 is 1µm, the multiple trace width can be 2µm or more, usually twice the standard width.

[0051] In some implementations, routing tools can be guided to perform semi-custom routing, thereby reducing manual intervention, facilitating rapid iteration, and achieving good line delay performance. After prioritizing the routing of critical signal lines, tools are used to automatically route other non-critical signal lines to accelerate the design process. This customized routing process optimizes the use of routing resources, minimizing line delay and improving circuit performance. After completing the customized placement and routing, the PPA results can be used to determine whether further optimization iterations are needed. If the PPA meets expectations, the next stage can proceed.

[0052] Optionally, step 102 may specifically include: Sub-step 1024: Extract library data for each circuit unit; the library data includes timing library, physical library, and library model; the timing library is used to characterize the timing information of the circuit unit; the physical library is used to characterize the physical geometry information of the circuit unit; the library model is used to characterize the boundary interface logic information of the circuit unit.

[0053] Sub-step 1025: Construct the top-level module based on the library data.

[0054] Optionally, sub-step 1025 may specifically include: encapsulating each circuit unit into a corresponding macro unit according to the timing library and physical library of each circuit unit in the library data, and deploying the macro unit in the top-level module; and optimizing the boundary timing between macro units in the top-level module using the library model.

[0055] In this embodiment, the customized multi-port comparator circuit can be packaged into a standardized module recognizable by Electronic Design Automation (EDA) tools, and then integrated into the processor's top-level functional module to complete the overall physical design. Therefore, the comparator circuit at the placement and routing stage is still an independent, fragmented physical design and cannot be directly called by a larger top-level module. The purpose of this stage is to generate a corresponding library file for this circuit, making it a functional module (i.e., macrocell) recognizable and callable by EDA tools, supporting subsequent top-level integration design.

[0056] This application embodiment can extract library data from each circuit unit and construct a top-level module based on the library data. The top-level module can realize sub-module integration and signal interconnection, that is, instantiate all functional sub-modules, complete the signal connection between sub-modules according to functional logic, and piece together the scattered sub-modules into a whole that can realize complete functions. In addition, the top-level module can also define external interfaces, that is, specify the input and output pins of the entire module to the outside world, as a standard interface for interfacing with higher-level systems. Furthermore, the overall circuit layout planning, global power and ground network, and overall layout and routing are all completed in the top-level module; the placement of the comparator circuit as a macrocell and the optimization of boundary timing in this application embodiment are also performed in the physical design of the top-level module.

[0057] The database includes: Timing library (.lib file): This is a parameter file describing the timing and power consumption characteristics of a circuit. It records information such as the delay of all input and output pins of the comparison circuit, input load, output drive capability, and power consumption values ​​at different operating voltages / temperatures. When performing timing analysis and power consumption estimation at the top level, it is necessary to obtain the electrical characteristics of the module through the .lib file to determine whether it will slow down the overall circuit's operating frequency.

[0058] The Physical Library Exchange Format (LEF) is a file that describes the physical geometry of a circuit. It records the circuit's dimensions, the coordinates of its input and output pins and their corresponding metal layers, any unrouted internal areas, and the corresponding routing rules. During top-level placement and routing, the LEF file is used to determine the module's location and pin connections to avoid physical conflicts.

[0059] Boundary library models (taking the Interface Logic Model (ILM) as an example) are precision-enhanced versions of traditional lib timing libraries. Ordinary lib files only record the overall input / output delays of the circuit, lacking sufficient precision in describing the detailed timing details at module boundaries. ILM, however, specifically extracts detailed logic and timing information at circuit boundaries while simultaneously reducing the weight of internal logic. In top-level design, ILM allows for more precise optimization of the timing at the junctions between comparison circuits and surrounding logic, preventing module interfaces from becoming timing bottlenecks, resulting in optimization effects far superior to traditional timing libraries.

[0060] Therefore, in the physical implementation process of the top-level module design, the circuit no longer exists as scattered standard units, but is directly instantiated and called as an independent macro unit through lib and LEF files. The EDA tool will treat it as a standard unit, identify its timing and physical constraints, and complete the placement and signal connection. The advantage of using macro units is that it retains the performance and area advantages brought by custom layout and routing, while avoiding the complexity of the top-level design caused by a large number of scattered units, thus improving design efficiency. In addition, by utilizing the generated ILM boundary library model, the EDA tool can accurately calculate the timing margin at the circuit interface, optimize the interface routing, and insert appropriate buffer units to ensure that the timing connection between the circuit and the surrounding logic meets the design requirements.

[0061] It should be noted that after completing the design of the top-level module, a PPA (performance, power consumption, area) evaluation of the entire top-level module is required. If the results do not meet the design requirements, optimization can be performed; if the results meet the design requirements, proceed to the next stage.

[0062] Optionally, step 103 may specifically include sub-steps 1031-1032: Sub-step 1031: Flatten the initial circuit design to obtain the circuit design to be approved.

[0063] Sub-step 1032: Perform multiple signature analyses on the circuit design, and when all the signature analyses pass, obtain the multi-port comparison circuit based on the circuit design.

[0064] The signature analysis includes one or more of the following: equivalence verification, power consumption analysis, and power ground integrity analysis.

[0065] In this embodiment, the macrocells in the circuit can be flattened into standard cells and related connections, and a final approval process can be performed. During the top-level module design phase, the circuit exists as a black-box macrocell; EDA tools can only see its external interface and cannot access its internal details. The flattening operation removes the encapsulation isolation of the macrocell, unfolding all its internal standard cells, traces, and other circuits of the top-level module into a flat structure at the same level. The entire design no longer contains black-box modules, thus facilitating equivalence verification, power consumption analysis, power and ground integrity analysis, and other verification and analysis processes, improving the accuracy of the results.

[0066] Specifically, after the PPA of the top-level module design meets the standards, the approval process can begin. The core of this process is to flatten out the circuit design, that is, to remove the macro-unit package of the circuit and restore it to the basic standard unit and interconnection. Then, a full-dimensional approval verification is carried out to ensure that the final design delivered for manufacturing does not have functional, physical, or electrical errors.

[0067] Among them, equivalence verification involves comparing the flattened complete physical netlist with the original functional code across the entire chain of logic to confirm that the function of the entire circuit, from the circuit to the top-level logic, has not deviated, thus avoiding the problem that internal logic errors cannot be detected in the black-box mode.

[0068] Power consumption analysis can accurately calculate the dynamic power consumption and static leakage current of the entire circuit, and analyze the power consumption distribution and peak power consumption. If the macrocell remains in a black box state, the power consumption of the comparison circuit can only be estimated through the lib file, and the accuracy is far lower than that of the flattened full-cell level analysis.

[0069] Power ground integrity analysis can check power voltage drop and electromigration risks across the entire circuit, accurately assessing the power quality within the circuit. Black-box analysis, on the other hand, cannot delve into the internal characteristics of the power network within a module, easily overlooking potential power supply problems.

[0070] Reference Figure 3 The construction process of the entire multi-port comparator circuit includes two aspects: comparator circuit design and top-level module design.

[0071] The comparison circuit design includes: cell selection 10, custom placement and routing 11, PPA analysis, and library data extraction 12. The top-level module design includes: automatic placement and routing 20, PPA analysis, and design flattening approval 21.

[0072] In summary, compared to the fully custom design schemes and latch alternatives in related technologies, the embodiments of this application can build CAM based on standard cells, resulting in shorter design cycles, simpler and more convenient design and verification processes for multi-port comparator circuits, strong portability across manufacturing process nodes, and strong matching and migration capabilities for different circuit structures. Specifically, this application integrates the related circuit structure of multi-bit comparison combined with logical AND into a single comparator cell, replacing the cascaded schemes in related technologies. This directly reduces the delay of the comparison path by reducing the number of gate levels and shortening the wiring within the cell, while simultaneously compressing the total cell area. Furthermore, the comparator circuit based on standard cells avoids the problems of large area overhead and rapid delay growth in multi-port cases associated with fully custom schemes. Specific requirements can be met by selecting appropriate combinations of standard cells, such as improving performance and reducing overall area. The customized layout of the cells further compresses the circuit area and improves the circuit speed.

[0073] Reference Figure 2 Multi-port comparator circuit: Optionally, the input terminals of each of the m multi-bit comparison subunits included in each comparison unit are respectively connected to the port for storing data corresponding to the comparison unit; Each of the m multi-bit comparison subunits in the comparison unit has its input terminal connected to one of the m input ports respectively; The output terminals of each of the m multi-bit comparison subunits in each comparison unit are respectively connected to the logic unit corresponding to the comparison unit.

[0074] Optionally, the logic unit is a logic OR operation unit; The number of bits for storing data is w; the data processing length used by the multi-bit comparison subunit is w. The comparison subunit includes: w comparators, which include any one of the following: an NAND gate comparator, a multiplexer, a first AND-last OR inverter, and a first OR-last AND inverter; The comparison subunit further includes a logic AND operation unit, and the output terminals of each of the w comparators included in each comparison subunit are respectively connected to the logic AND operation unit included in the comparison subunit.

[0075] Optionally, the n×m multi-bit comparison sub-units are arranged in a matrix; each comparison unit corresponds to a row in the matrix; In each row of comparison units, the spacing between two adjacent multi-bit comparison sub-units is less than or equal to 25% of the width of the multi-bit comparison sub-unit. In each column of n multi-bit comparison sub-units, the spacing between two adjacent multi-bit comparison sub-units is less than or equal to 10% of the height of the multi-bit comparison sub-unit.

[0076] In the embodiments of this application, the description of the multi-port comparator circuit embodiment can be referred to the description of the embodiment of the construction method of the multi-port comparator circuit described above, and will not be repeated here.

[0077] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A multi-port comparator circuit, characterized in that, include: n comparison units and n logic units; Each comparison unit includes m multi-bit comparison sub-units, and the n comparison units correspond one-to-one with the n logic units; Each of the n comparison units corresponds one-to-one with one of the n stored data; The comparison unit is used to perform multi-bit comparison and logical AND operation to compare the keyword data input from each input port with the stored data respectively; the logic unit is used to perform logical operations on the comparison results of each input port. The multi-port comparator circuit has m input ports and n stored data.

2. The circuit according to claim 1, characterized in that, Each of the m multi-bit comparison subunits included in the comparison unit has its input terminal connected to the port for storing data corresponding to the comparison unit. Each of the m multi-bit comparison subunits in the comparison unit has its input terminal connected to one of the m input ports respectively; The output terminals of each of the m multi-bit comparison subunits in each comparison unit are respectively connected to the logic unit corresponding to the comparison unit.

3. The circuit according to claim 1 or 2, characterized in that, The logic unit is a logic OR operation unit; The number of bits for storing data is w; the data processing length used by the multi-bit comparison subunit is w. The comparison subunit includes: w comparators, which include any one of the following: an NAND gate comparator, a multiplexer, a first AND-last OR inverter, and a first OR-last AND inverter; The comparison subunit further includes a logic AND operation unit, and the output terminals of each of the w comparators included in each comparison subunit are respectively connected to the logic AND operation unit included in the comparison subunit.

4. The circuit according to claim 1 or 2, characterized in that, The n×m multi-bit comparison sub-units are arranged in a matrix; each comparison unit corresponds to a row in the matrix. In each row of comparison units, the spacing between two adjacent multi-bit comparison sub-units is less than or equal to 25% of the width of the multi-bit comparison sub-unit. In each column of n multi-bit comparison sub-units, the spacing between two adjacent multi-bit comparison sub-units is less than or equal to 10% of the height of the multi-bit comparison sub-unit.

5. A method for constructing a multi-port comparator circuit, characterized in that, include: Based on the parameters of the stored data and the preset number of input ports, the circuit units used to construct the circuit are determined. The circuit units include a comparison unit and a logic unit. The comparison unit is used to perform multi-bit comparison and logical AND operation to compare the keyword data input from each input port with the stored data respectively. The logic unit is used to perform logical operations on the comparison results of each input port. The layout of each circuit unit in the circuit is set, and the top-level module of the circuit is constructed to obtain the initial circuit; The initial circuit is verified, and a multi-port comparison circuit is obtained when the verification is successful.

6. The method according to claim 5, characterized in that, The number of input ports is m, and the parameter for storing data includes the quantity n of the stored data; The step of determining the circuit units used to construct the circuit based on the parameters of the stored data and the preset number of input ports includes: Construct n comparison units and n logic units, each comparison unit including m multi-bit comparison sub-units, the n comparison units and n logic units correspond one-to-one, and the n comparison units correspond one-to-one with n stored data.

7. The method according to claim 6, characterized in that, The setting of the layout of each of the circuit units in the circuit includes: The input terminals of each of the m multi-bit comparison subunits included in each comparison unit are respectively connected to the port for storing data corresponding to the comparison unit; Each of the m multi-bit comparison subunits included in each comparison unit is connected to one of the m input ports respectively. The output terminals of the m multi-bit comparison subunits included in each comparison unit are respectively connected to the logic unit corresponding to the comparison unit.

8. The method according to claim 6 or 7, characterized in that, The logic unit is a logic OR operation unit; The parameters of the stored data also include the number of bits w of the stored data; the data processing length used by the multi-bit comparison subunit is w.

9. The method according to claim 6 or 7, characterized in that, The parameters of the stored data also include the number of bits w of the stored data; The comparison subunit includes: w comparators, which include any one of the following: an NAND gate comparator, a multiplexer, a first AND-last OR inverter, and a first OR-last AND inverter; The comparison subunit further includes a logic AND operation unit, and the output terminals of each of the w comparators included in each comparison subunit are respectively connected to the logic AND operation unit included in the comparison subunit.

10. The method according to claim 6 or 7, characterized in that, The n×m multi-bit comparison sub-units are arranged in a matrix; each comparison unit corresponds to a row in the matrix. In each row of comparison units, the spacing between two adjacent multi-bit comparison sub-units is less than or equal to 25% of the width of the multi-bit comparison sub-unit. In each column of n multi-bit comparison sub-units, the spacing between two adjacent multi-bit comparison sub-units is less than or equal to 10% of the height of the multi-bit comparison sub-unit.

11. The method according to claim 5, characterized in that, The top-level module of the constructed circuit includes: Extract library data for each circuit unit; the library data includes a timing library, a physical library, and a library model; the timing library is used to characterize the timing information of the circuit unit; the physical library is used to characterize the physical geometry information of the circuit unit; the library model is used to characterize the boundary interface logic information of the circuit unit. Based on the library data, construct the top-level module.

12. The method according to claim 11, characterized in that, The step of constructing the top-level module based on the library data includes: Based on the timing library and physical library of each circuit unit in the library data, each circuit unit is encapsulated into a corresponding macro unit, and the macro unit is deployed in the top-level module; Using the library model, the boundary timing between macrounits in the top-level module is optimized.

13. The method according to claim 5, characterized in that, The initial circuit is verified, and a multi-port comparison circuit is obtained when the verification is successful, including: The initial circuit is designed and flattened to obtain the circuit design to be approved; The circuit design is subjected to various signature analyses, and when all the signature analyses pass, the multi-port comparison circuit is obtained based on the circuit design. The signature analysis includes one or more of the following: equivalence verification, power consumption analysis, and power ground integrity analysis.