A storage circuit verification method and computing device

By constructing mathematical models and instantiating multiple sets of register transfer level models, the problem of unpredictable address transformation in storage circuit verification is solved, verification efficiency and completeness are improved, and real-time comparison and accurate positioning are achieved.

CN118571297BActive Publication Date: 2024-10-29SHENZHEN CORERAIN TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410957149.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-10-29
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

Existing storage circuit verification technology is difficult to accurately predict address transformations, resulting in limited verification efficiency and completeness. It is impossible to compare specific error locations in real time, affecting positioning efficiency.

Method used

By obtaining the register transfer level model of the chip, constructing a mathematical model to identify the address mapping relationship, calculating the probability of different address distributions, instantiating multiple sets of register transfer level models, creating a memory model without address conversion logic, and performing multi-path comparison to verify functional equivalence. sex and correctness.

Benefits of technology

It improves the verification efficiency and completeness, realizes real-time comparison and accurate positioning, and ensures the correctness of the address transformation function and the accuracy of verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118571297B_ABST
    Figure CN118571297B_ABST
Patent Text Reader

Abstract

The present application provides a verification method and computing device for a storage circuit, including: obtaining the first register transfer level model and storage information of the current chip, constructing a mathematical model to identify the address mapping relationship, and calculating the probability of different address distributions accessed by the storage circuit; according to the probabilities of the different address distributions, instantiating multiple sets of second register transfer level models for chip storage circuits, each set of the second register transfer level models respectively using different address distribution patterns; creating a memory model that does not include address transformation logic for the storage circuit, and connecting the memory model to the address and data ports of the register transfer level to be verified; comparing the first register transfer level model with multiple sets of the second register transfer level models and the storage and reading results of the memory model. The technical solution of the present application can improve the verification efficiency and verification completeness while verifying the functional correctness of the address transformation, thereby improving the verification efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of AI chip verification technology, and in particular to a verification method and computing device for a storage circuit. Background Art

[0002] As the demand for AI chip computing power increases, memory and data bandwidth are also increasing. Data bandwidth has even become a bottleneck for computing power. In actual chip design, the bit width of data exceeds the bit width that a single storage circuit can provide. Therefore, large-bit-width data reading and writing will be completed by splicing multiple storage circuits. Among them, each storage circuit is called a storage group (bank), and a single access to a data interface will access multiple banks at the same time.

[0003] The storage circuit may have multiple external access ports, but the internal random access memory circuit (RAM) may only have one internal port, such as a static random access memory circuit (SRAM) with one write and one read (1W1R), which only has one read and one write. Therefore, each bank can only respond to one external port access at a time. The access addresses of multiple external ports are different, but they may all be on the same bank, which will lead to a decrease in access efficiency.

[0004] Refer to the example in Table 1. Assume that external ports A and B are independent of each other. Port A writes address 1 and port B writes address 2. 1 and 2 are in different banks. Therefore, only one clock is needed for both ports A and B to complete the write operation. However, if port A writes address 2 and port B writes address 4, and address 2 and address 4 are in the same bank, there will be a conflict. Only one data can be written at a time. First write address 2 of A, then write address 4 of B. It takes two clocks to complete the write. This will increase the write rate by one clock cycle compared to when there is no bank conflict. In addition, even if only one external port initiates the access, the data to be accessed may be on multiple banks or on the same bank. For example, if the external access is 1024 bits and the bit width of each RAM is 256 bits, four banks need to be accessed at the same time, so bank conflicts may also occur.

[0005] Table 1

[0006]

[0007] In order to increase access efficiency, the control part of the storage circuit usually adds various scheduling to avoid bank conflicts; for example: port A writes address 2, port B writes address 4, but the module performs address conversion inside, port A actually writes address 2, port B actually writes address 5, address 2 and address 5 are not in the same bank, so there will be no conflict, and only one shot is needed to complete, which improves efficiency. However, this will make the actual address inside the chip different from the address accessed by the external port, and the adjustment has a certain randomness, that is, the address conversion strategy of each port may be different, and the conversion may also be different according to the address accessed each time. That is, port A accesses address 2+4 and port B accesses address 2+4, which may be different after conversion; port A accesses 2+4 in scenario X and port A accesses 2+4 in scenario Y, and the conversion results may also be different; port A accesses 2+4 and port A accesses 2+6, and the address conversion of 2 may also be different; A and B access 2+4 at the same time and A and B access 2+4 in time-sharing, and the conversion results may also be different.

[0008] See also Figure 1 In the example in, usually in the current storage circuit verification technology, due to the large number of data address conversion and rearrangement, it is difficult to accurately predict, so the completeness of storage circuit verification is also challenged. If the address of the final operation can be accurately predicted, the storage part can be accurately modeled. First, the precise modeling and the register transfer level model (RTL) are highly coupled, very complex, and have many changes; second, if the implementation method is exactly the same as the RTL through precise modeling, the purpose of verifying the correctness of the RTL function cannot be achieved. In the existing technology, precise modeling is usually only for the path and connection combination of bank division, and address transformation cannot be modeled. Address conversion is often related to specific input / output ports and current access parameters. Unless the RTL is modeled 1:1, it is difficult to predict the absolute storage address. Therefore, it is impossible to compare the backdoor in real time, and only the final result can be compared. Such a detection method is difficult to determine the specific error location, which affects the verification positioning efficiency. Moreover, only checking whether the input and output meet expectations is feasible in high-level verification, such as system-level verification, but it is not enough for the verification test unit (UT) of a specific storage circuit, and the reliability of the internal conversion circuit cannot be verified.

[0009] To this end, a technical solution is needed that can improve the verification efficiency and verification completeness while verifying the functional correctness of the address transformation, thereby improving the verification efficiency. Summary of the invention

[0010] The present application aims to provide a verification method and computing device for a storage circuit, which can improve the verification efficiency and verification completeness while verifying the functional correctness of address transformation, thereby improving the verification efficiency.

[0011] According to one aspect of the present application, a storage circuit verification method is provided, comprising:

[0012] Obtain the first register transfer level model of the current chip;

[0013] Acquire information of a storage circuit for the current chip, and construct a mathematical model to identify an address mapping relationship;

[0014] Calculating the probability of different address distributions accessed by the storage circuit according to the mathematical model;

[0015] According to the probabilities of the different address distributions, instantiate multiple sets of second register transfer level models for chip storage circuits, wherein each set of the second register transfer level models respectively and fixedly uses a different address distribution mode;

[0016] Creating a memory model for the storage circuit that does not include address translation logic, and connecting the memory model to address and data ports of a register transfer stage to be verified;

[0017] The first register transfer level model and multiple sets of the second register transfer level models and the storage and reading results of the memory model are compared to verify functional equivalence.

[0018] According to some embodiments, the method further comprises:

[0019] When there is data change in the storage space in the reference model of the verification environment, the data of the corresponding address of the memory model is queried to compare whether the data is consistent with the reference model, thereby achieving real-time comparison.

[0020] According to some embodiments, the method further comprises:

[0021] The storage read result of the first register transfer level model is compared with the storage read result of the reference model to verify the correctness of the first register transfer level model.

[0022] According to some embodiments, the method further comprises:

[0023] Determine a first address node for verification, perform directional verification on the first address node, and perform multiple batches of random access on the remaining addresses.

[0024] According to some embodiments, the method further comprises:

[0025] Second register transfer level models of multiple sets of storage circuits are instantiated for multiple ports, thereby completing equivalence verification at the port level.

[0026] According to some embodiments, the method further comprises:

[0027] When performing upper-layer verification, the memory model is used to perform functional verification through backdoor operations.

[0028] According to some embodiments, instantiating multiple sets of second register transfer level models for storage circuits includes:

[0029] Directly globally instantiate multiple copies of the register transfer level code using different parameter configurations.

[0030] According to some embodiments, instantiating multiple sets of second register transfer level models for storage circuits includes:

[0031] The overall storage circuit space is divided into a plurality of overlapping segments, and a plurality of register transfer level models are instantiated for each segment according to the different address distribution probabilities.

[0032] According to some embodiments, instantiating multiple sets of second register transfer level models for storage circuits includes:

[0033] When the probability of a certain address distribution is less than a threshold, the second register transfer level model corresponding to the corresponding address distribution pattern is not instantiated, thereby reducing the resources and time required for verification.

[0034] According to some embodiments, the verification method further comprises: creating the reference model by performing storage space modeling only on used addresses to reduce resource consumption, such as using associative array modeling.

[0035] According to another aspect of the present application, there is provided a computing device, comprising:

[0036] Processor; and

[0037] A storage circuit stores a computer program, and when the computer program is executed by the processor, the processor executes any of the methods described above.

[0038] According to another aspect of the present application, a non-transitory computer-readable storage medium is provided, on which computer-readable instructions are stored. When the instructions are executed by a processor, the processor executes any of the above methods.

[0039] According to the embodiments of the present application, by instantiating multiple sets of second register transfer models for different address distribution probabilities, resource allocation is rationally planned, and while efficiently utilizing computing resources, each second register transfer model is ensured to accurately reflect the behavior of its corresponding address mode, thereby avoiding unnecessary duplication of work during the verification process. Multi-path comparison verifies the equivalence and functional correctness of address transformations, realizes automatic comparison, and improves verification efficiency and verification completeness.

[0040] According to some embodiments, the method of the present invention adds a memory model without address conversion logic as a comparison to ensure the accuracy of the comparison verification, support the backdoor operation of the upper layer verification, and improve the overall verification efficiency.

[0041] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for describing the embodiments are briefly introduced below.

[0043] Figure 1 A schematic diagram of a conventional memory circuit verification method according to an example embodiment is shown.

[0044] Figure 2 A flow chart of a verification method for a storage circuit according to an example embodiment is shown.

[0045] Figure 3 A schematic diagram of the architecture of a verification method for a storage circuit according to an example embodiment is shown.

[0046] Figure 4 A block diagram of a computing device is shown according to an exemplary embodiment. DETAILED DESCRIPTION

[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0048] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0049] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0050] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0051] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the concepts of the present application. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.

[0052] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0053] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present application, and therefore cannot be used to limit the scope of protection of the present application.

[0054] In the usual storage circuit verification, if the address of the final operation can be accurately predicted, the storage part can be accurately modeled. This can achieve a variety of effects, for example; it can verify in real time whether the written data is correct; or process the data in the format of accurate modeling, and load it into the RTL through the specific address by backdoor load, and then verify the correctness of the storage circuit by frontdoor reading; it can also load the configuration through backdoor load to accelerate the simulation. Among them, the advantage of real-time automatic detection is that the problem can be found immediately at the time when the problem occurs, and the positioning efficiency is high. For example, the address X is written 20 times, and an error occurs the third time; but the data is stored in the memory. If there is no real-time comparison, the error will only be found when it is read out, but when it is read out, it may be far away from the node with the error, and a lot of information has been overwritten, which requires more time to locate the problem. If there is real-time comparison, the third write will immediately report an error, and the problem location can be quickly locked according to the error reporting time point and log.

[0055] See also Figure 1In the example, in the current storage circuit verification technology, due to the large number of data address conversion and rearrangement situations, it is difficult to accurately predict, so the completeness of storage circuit verification is also challenged. If the address of the final operation can be accurately predicted, the storage part can be accurately modeled. First, the precise modeling is highly coupled with RTL, which is very complex and requires many changes; second, if the implementation method is exactly the same as RTL through precise modeling, the purpose of verifying the correctness of RTL function cannot be achieved. In the prior art, precise modeling is usually only for the path and connection combination of bank division, and address transformation cannot be modeled. Address conversion is often related to specific input / output ports and current access parameters. Unless RTL is modeled 1:1, it is difficult to predict the absolute storage address. Therefore, it is impossible to compare the backdoor in real time, and only the final result can be compared. Such a detection method is difficult to determine the specific error location, which affects the verification positioning efficiency. Moreover, only checking whether the input and output meet expectations is feasible in high-level verification, such as system-level verification, but it is not enough for the verification UT of specific storage circuits, and the reliability of the internal conversion circuit cannot be verified.

[0056] To this end, the present application proposes a verification method and computing device for a storage circuit, which can improve the verification efficiency and verification completeness while verifying the functional correctness of the address transformation, thereby improving the verification efficiency. According to the embodiment, the address transformation equivalence and functional correctness are verified through multi-path comparison, and automatic comparison is realized, thereby improving the verification efficiency and verification completeness; by adding a memory model without address transformation logic as a comparison, the accuracy of the comparison verification is guaranteed. The backdoor operation of the upper-level verification is supported, thereby improving the overall verification efficiency.

[0057] The exemplary embodiments of the present application are described below in conjunction with the accompanying drawings.

[0058] Figure 2 A flow chart of a verification method for a storage circuit according to an example embodiment is shown.

[0059] See also Figure 2 According to an example embodiment, a verification method of a storage circuit includes:

[0060] At S101 , a first register transfer level (RTL) model of the current chip is obtained.

[0061] According to some embodiments, first, the RTL source code of the chip is obtained from the design team or an existing design database. The RTL model is a code written in a hardware description language (such as Verilog or VHDL) that describes in detail the logical behavior of the digital circuit, including components such as storage circuits, logic gates, registers, and the connection between them.

[0062] In S103, information about the storage circuit used for the current chip is obtained, and a mathematical model is constructed to identify an address mapping relationship.

[0063] According to some embodiments, the specifications of the current chip are confirmed, including the storage circuit configuration, address bus width, data bus width, number of RAM blocks, number of banks, possible address distribution, etc. Based on the number of address lines of the storage circuit of the current chip, such as how RAM (random access memory circuit) is divided into multiple banks and their addressing rules, a mathematical model is constructed based on this information to represent all possible address mapping relationships to ensure the accuracy of subsequent verification work.

[0064] According to some embodiments, a mathematical model is constructed to identify the address mapping relationship, and the logical address space is mapped to the physical address space, and all expected access modes are covered by calling the address mapping function multiple times.

[0065] According to some embodiments, after constructing a mathematical model to identify the address mapping relationship, it is also necessary to abstract the scenario into a set of parameters in a mathematical expression, and the parameters are used to confirm whether the address needs to be rearranged and in what manner. For example, a set of original addresses (before rearrangement) x=0, 1, 2, 3, 4, 5, 6, 7, assuming that the new address y can be set to y=ax+b if xn%c==xm; otherwise, y=x. Wherein a, b, c are variable parameters. Assuming c=4, for addresses 0, 1, 2, 3, no rearrangement is required, and the new address y=x; for addresses 4, 5, 6, 7, rearrangement is required due to repetition after modulo 4; when a=1, b=8, the addresses are rearranged to y=12, 13, 14, 15. When a=2, b=1, the addresses are rearranged to y=9, 11, 13, 15. It can be seen that a, b, and c may have multiple values ​​and combinations. Similarly, the input address may not be 0, 1, 2, or 3, but may be 0, 4, 8, 12, or other combinations. Under the same parameters, different rearrangement results also need to be considered.

[0066] According to some embodiments, the source of the parameter is related to the actual circuit implementation and the usage scenario. For example, if 4 banks are to be accessed simultaneously, c may be 4. For example, if a bank is 16 bits and the interface width is 128 bits, a maximum of 8 banks can be accessed at a time, but only 1 to 7 banks may be accessed. The parameters are different for each access scenario.

[0067] At S105, the probability of different address distributions accessed by the storage circuit is calculated according to the mathematical model.

[0068] According to some embodiments, the probability of different address distributions accessed by the storage circuit is calculated based on the mathematical model previously constructed. Based on the expected usage scenario of the chip or system, one or more groups of typical data access modes are defined. These modes may include mathematical models of address mapping relationships established in stages such as continuous address access (such as sequential reading and writing), random address access, and hotspot access (a certain address or address interval is frequently accessed), and the logical address space is mapped to the physical address space. For each access mode, the probability of each address or address interval being accessed is estimated based on historical data, software behavior analysis, or theoretical predictions. For example, a certain chip is mainly used for accelerating matrix multiplication, the image size is mainly 128*128 pixels, RGB three colors, using the A algorithm, the kernel size is 3*3, and stride1~7 is mainly used. Then the data storage in RAM is mainly H*W, channel_size=3, and the probability of stride=1~7 is the highest. This probability needs to be determined based on the usage scenario and functional requirements of the chip, based on empirical evaluation, and there is no fixed formula.

[0069] At S107 , multiple sets of second register transfer level (RTL) models for storage circuits (RAM) are instantiated according to the probabilities of the different address distributions, wherein each set of register transfer level models respectively and fixedly uses a different address distribution mode.

[0070] According to some embodiments, the part with the highest probability is divided according to the different address distribution probabilities obtained by the previous analysis and the actual scene requirements. Multiple sets of RTL of the storage part are additionally instantiated as needed, and different address distribution modes are fixedly used respectively. Each set of RTL can only run one set of parameters. To simulate multiple sets of parameters at the same time, multiple copies of RTL need to be instantiated and given different parameter settings respectively. Because there are many addresses, there are many conditions for judging whether the address needs to be rearranged, and there are also many parameters for rearrangement, so it is difficult to traverse all addresses and all conditions. According to the example embodiment, this multi-path simultaneous verification method is designed to verify the correctness of the address in the main possible scenarios while verifying the correctness under the current random configuration, and the functions they embody externally should be consistent. In addition, this step verifies the equivalence of the current address calculation and the non-rearranged address, and the non-rearranged SIM_RAM can be used for backdoor real-time comparison. The so-called backdoor real-time comparison is that when the data in a certain address in the RM changes, the value in the circuit RAM corresponding to the address is directly checked from the circuit backdoor to see whether the same change occurs, while the content of other addresses will not change. Otherwise, the data in RAM can only be known whether it has changed when it is read out.

[0071] According to some embodiments, first, the address mapping logic of the storage circuit is adjusted or redesigned for each different address distribution mode. Then, the parameterized characteristics of the RTL design are used to generate a RAM model with a specific configuration for different address distribution modes, so that a new RAM RTL model is instantiated for each mode with a higher probability of address distribution. Moreover, each model adopts a fixed specific address distribution strategy, and the parameters of these RAM models are automatically generated or manually configured according to the probability distribution data to ensure that each model can accurately simulate a specific access mode.

[0072] According to some embodiments, the designed RTL model should be flexible enough to quickly adapt to different address distribution patterns. Instantiating multiple models will increase the demand for verification resources, so it is necessary to reasonably plan resource allocation to ensure that each model can accurately reflect the behavior of its corresponding address pattern while efficiently utilizing computing resources, avoiding unnecessary duplication of work during the verification process.

[0073] Still taking the above example, since each combination of a, b, and c in the mathematical formula represents a possible scenario, there may be many combinations, which cannot be traversed and modeled at the same time. And since the RTL is not modeled 1:1 exactly, it is impossible to know how many parameters and combinations there are. Therefore, according to actual needs, the most likely types are modeled at the same time, and the address conversion of an address in different scenarios is simulated at the same time to verify that the results presented to the outside under these different conversions are equivalent, and to ensure that the verification of common scenarios is complete to the greatest extent.

[0074] At S109 , a memory model excluding address conversion logic is created for the storage circuit, and the memory model is connected to address and data ports of a register transfer level (RTL) to be verified.

[0075] According to some embodiments, a simplified memory model is created for verification, which does not include address translation logic in order to isolate and focus on verifying other components or processes, such as data paths, control logic, etc., without being distracted by address mapping complexity.

[0076] According to some embodiments, in a verification environment (such as a UVM environment), the newly created memory model is integrated as part of the RTL design to be verified. It is ensured that the address port of the memory model is directly connected to the address bus of the RTL design, and the data port is respectively connected to the write data and read data buses. The read and write enable signals of the memory model are connected to the corresponding control signals in the RTL design to ensure operation synchronization.

[0077] According to some embodiments, by creating and integrating the memory model without address transformation logic, centralized verification of other key logics in the RTL design is achieved, which helps to improve verification efficiency and accuracy and ensure that basic functional problems can be identified and resolved in the early stages of complex system design.

[0078] At S111 , the first register transfer level (RTL) model is compared with the plurality of sets of second register transfer level (RTL) models and the storage read results of the memory model to verify functional equivalence.

[0079] According to some embodiments, all RTL models to be verified (the first RTL model and multiple sets of second RTL models) are integrated with the memory model into a unified verification environment to ensure that they can receive the same test stimulus and respond independently. A comprehensive test vector set is generated based on various expected application scenarios of the storage circuit and the different address distribution probabilities previously defined, including but not limited to various access modes such as random access, sequential access, and hotspot access. In the verification environment, all RTL models and memory models are simulated synchronously to ensure that they perform corresponding read and write operations in the same clock cycle. Utilizing the backdoor interface of the memory model, its internal storage content is captured immediately after each read operation, and accurately compared with the data read by each RTL model through the normal interface.

[0080] According to some embodiments, the results of each read operation are strictly compared, and any mismatches are recorded, including differences in addresses, expected data values, and actual read values. Statistical analysis is performed to identify error patterns or functional inconsistencies under specific conditions, which helps to locate design defects or configuration issues in the verification environment.

[0081] According to some embodiments, for the inconsistencies found, you can try to inject faults in the suspected problem area, or perform more detailed tests under boundary conditions to further locate the root cause of the problem. After fixing the problem, you need to re-execute all or part of the test vectors and perform regression testing to verify the effectiveness of the repair measures and ensure the functional equivalence between all models.

[0082] According to some embodiments, the method further includes: when there is a data change in the storage space in the reference model of the verification environment, querying the data of the corresponding address of the memory model, and comparing whether the data is consistent with the reference model, thereby achieving real-time comparison.

[0083] According to some embodiments, when data changes occur in the storage space of the reference model in the verification environment, the consistency of the corresponding address data in the memory model is compared in real time. First, a monitoring point (Monitor) is set in the verification environment, and an event notification is triggered immediately when there is a write or update operation in the storage circuit of the reference model. After the event is triggered, the changed address and its new data value in the reference model are immediately captured. The backdoor interface (BackdoorInterface) of the memory model is used, which is a mechanism for directly accessing the internal state of the memory without going through the normal read and write channels to directly query the data of the corresponding address.

[0084] According to some embodiments, the data value of the storage unit corresponding to the changed address of the reference model in the memory model is read through the backdoor interface. The new data captured from the reference model is instantly compared with the data obtained from the memory model through the backdoor interface. If the data is found to be inconsistent, the details of the difference are immediately recorded, including the address, expected value, actual value, and time of occurrence. Once the data is inconsistent, the verification environment should generate a detailed error report, including specific information about the comparison failure, to facilitate rapid problem location. Based on the comparison results, the debugging process is entered to analyze whether it is a problem with the memory model, a configuration error of the verification environment, or an error in the expected behavior setting of the reference model.

[0085] According to some embodiments, the method further comprises: comparing a storage read result of the first register transfer level (RTL) model with a storage read result of the reference model to verify correctness of the first register transfer level (RTL) model.

[0086] According to some embodiments, the first RTL model and the verification environment reference model are simulated respectively using a simulation tool (such as a Verilog or VHDL simulator). During the simulation process, all relevant storage circuit access events are recorded, including read and written data and their corresponding addresses and timestamps. The storage circuit reading results of the two models are extracted from the simulation log or waveform file and automatically compared. Through such a systematic method, it is possible to efficiently and accurately verify whether the storage reading behavior of the first RTL model meets expectations, thereby ensuring its correctness.

[0087] According to some embodiments, the method further comprises: determining a first address node for verification, performing directional verification on the first address node, and performing multiple batch random accesses on the remaining addresses.

[0088] According to some embodiments, when performing storage circuit verification, performing directional verification on specific address nodes and performing multiple batch random accesses on remaining addresses can improve verification efficiency and coverage.

[0089] According to some embodiments, based on the design features of the storage circuit and the expected application scenarios, address nodes that are critical to the system function are identified. These nodes may include boundary addresses, special function register addresses, control register addresses, etc., which often have a significant impact on the stability and security of the system. Directed verification is performed on important specific address nodes, such as the bank interface of the RAM, the starting addresses are in different bank locations, etc., to verify the main identifiable scenarios. In this way, access to the same address simultaneously verifies a variety of main address change scenarios, increases verification efficiency, and verifies each other through multiple paths, thereby increasing the reliability of verification. Moreover, automatic comparison will be more efficient than manual confirmation and more suitable for random verification.

[0090] According to some embodiments, a random access pattern is generated for the remaining addresses, and a previously constructed address distribution probability model is used to ensure that random access can cover the entire address space, especially those addresses that may be less accessed in actual applications. By using an automated testing framework and coverage tools, the verification progress and coverage are monitored to ensure that random access fully explores the address space. The verification of the RTL functional combination is confirmed by code coverage and conditional coverage. When the coverage is collected to 100%, the verification is considered to be basically complete. By combining directional verification and random access verification strategies, the storage circuit can be verified more comprehensively and effectively to ensure its stability and reliability under various conditions.

[0091] The following is an explanation with reference to specific embodiments. Embodiment 1: Assume that a chip design includes a shared storage space (memory). For the memory, there is an external port A that can access its content.

[0092] Among them, the data width of A is 1024 bits. The memory consists of 4 banks, and the data interface of each bank is 256 bits. Each access to A requires accessing 4 banks at the same time, so the access will include 4 addresses addr_a1, addr_a2, addr_a3, and addr_a4. The interval between the 4 addresses may change with each access, set to W. W may be a combination of multiple parameters. For simplicity, W is used here to represent the extracted abstract scene.

[0093] According to the above information, an address addr_a1 can be expressed as addr_a1 = 4*X1+Y1, where X represents the address in the same bank and Y represents the address in one of the four banks. For the remaining addresses, for example, addr_a2 = addr_a1 + W. If Y1=Y2 of addr_a1 and addr_a2, a bank conflict will occur, but for this set of equations, there may be infinite combinations that cannot be traversed at the same time.

[0094] Assume that for the usage scenario of this chip, the address span of A is mainly concentrated in the range of 1-4, that is, W=1~4; therefore, 4 additional RTLs are instantiated, and W=1~4 are fixed respectively: for simplicity, only Y is discussed.

[0095] When W=1, addr_a1=Y1, addr_a2=Y1+1, addr_a3=Y1+2, addr_a2=Y1+3; when divided by 4, the quotients are all 0, and the remainders are 0, 1, 2, and 3 respectively, so there will be no bank conflict.

[0096] When W=2, addr_a1=Y1, addr_a2=Y1+2, addr_a3=Y1+4, addr_a2=Y1+6; subtracting the constant multiple of 4, the remainders are Y1, Y1+2, Y1, Y1+2 respectively; it can be seen that addr_a1 and addr_a3, addr_a2 and addr_a4 have bank conflicts, and the addresses will be changed, and so on.

[0097] Although there may be an infinite number of combinations of accessed addresses, the main range falls within W=1~4. Therefore, 4 sets of RTL are instantiated for W=1~4, plus the original RTL based on actual configuration, a total of 5 sets. When accessing from port A, the accessed address is sent to 5 paths at the same time, and each accesses its own space. That is, for any address input: when writing, it goes through 5 address transformations and writes to each address; when reading, it also goes through 5 address transformations and reads from 5 different RTLs.

[0098] At the same time, a memory model without address transformation is established, and memory is implemented directly using an array, [255:0]mem[]. The corresponding 256 bits are accessed directly according to the RTL addr, without considering bank conflicts. In this way, the address where data is written can be accurately predicted. When there is data change in the storage space of the reference model of the verification environment, the corresponding address of the memory model is queried to compare whether the data is consistent with the reference model, and real-time comparison is achieved.

[0099] After each readout, the results of the five RTL groups and one memory model are compared. When all six groups of results are the same, the comparison is considered to be successful, that is, the functions presented to the outside by the six paths are equivalent, and the address change does not affect the reading and writing of data. If the data values ​​in the six groups are different, it is considered that a certain path has an inequality, and the cause of the problem needs to be located.

[0100] At the same time, the final output of the RTL after reading is compared with the data output by the RM of the verification environment. If they are consistent, the comparison is considered to be successful; if they are inconsistent, the cause of the problem needs to be located. In this way, the correctness of the RTL function can be verified from an abstract functional level (this can include not only memory reading and writing, but also some subsequent functions).

[0101] Coverage modeling is performed on the RTL address W, where [1:4] is a weight and [5:$] is a weight. Directed verification is performed on key addresses, such as 256, 512, 768, and 1024. A large number of random accesses are performed on the remaining addresses, and code coverage and condition coverage are combined to support verification completeness.

[0102] Example 2: Based on Example 1, the RAM is changed to 8 banks and an interface B is added. Interface B is 1024 bits and will access 4 banks at the same time. In addition to considering the conflict of A itself, there is also the conflict between A and B. A and B are modeled with W=1~4 respectively, and then A and B are considered comprehensively.

[0103] According to some embodiments, the method further includes: instantiating a plurality of second register transfer level (RTL) models of storage circuits (RAM) for a plurality of ports, thereby completing equivalence verification at the port level.

[0104] According to some embodiments, in order to instantiate multiple sets of second register transfer level (RTL) models of storage circuits (RAM) for multiple ports and complete equivalence verification from the port level, multiple sets of RAM models are instantiated in the top-level design. For example, in Example 2, two copies of RTL are instantiated. Among them, the input and output addresses of port A and port B of instantiation 1 are respectively connected to port B and port A in instantiation 2, so that the equivalence of multiple paths is compared at the external port level. Each instance can be configured to access different address spaces or have different behavioral characteristics to simulate actual usage scenarios, thereby ensuring the equivalence of multiple sets of RAM instances in different configurations and usage scenarios from the port level, and improving the reliability and verification efficiency of the overall design.

[0105] The method further includes: when performing upper layer verification, using the memory model to perform functional verification through backdoor operation.

[0106] According to some embodiments, the backdoor operation refers to directly accessing the contents of the RAM at address 31 in RAM_A in the manner of TH.DUT.TOP.MODULE_A.RAM_A.memory

[31] according to the instantiation hierarchical path of the RAM. This access method does not go through an interface and has no timing, and can complete access to different addresses at the same simulation time. The backdoor operation is relative to the frontdoor operation. The frontdoor operation refers to accessing the contents of RAM and REG through an external interface, such as an AXI or AHB bus interface, through the CPU, and through a complete input interface timing. For storage circuits that have already used multiple paths to verify the equivalence of address transformations at the lower layer, during upper-layer verification (such as system-level verification), a memory model without address transformation can be used in most scenarios to verify other functions. At this time, since there is no address transformation, various backdoor operations can be used, which can improve verification efficiency.

[0107] According to some embodiments, the memory model is designed with a "backdoor" interface that allows direct access to the internal state of the memory, bypassing the normal read and write paths, and facilitating direct reading or modification of storage content during simulation. After each memory access, the actual storage content is immediately read using the backdoor interface of the RM, and automatically compared with the data read by the RTL design through normal means. Once a mismatch is found, the verification environment should immediately record error information, including operation type (read / write), address, expected value and actual value, to facilitate subsequent analysis and debugging. Real-time backdoor comparison can not only verify functional correctness, but also provide information about design performance, such as access latency, bandwidth utilization, etc., which helps to optimize the design.

[0108] According to some embodiments, during the verification process, artificial intelligence can be used to learn random configuration and coverage changes in real time, and infer the direction in which the configuration should be modified, thereby automatically modifying constraints, controlling the random range, and increasing the speed of random convergence.

[0109] According to some embodiments, multiple sets of second register transfer level (RTL) models for storage circuits (RAM) are instantiated, including: using different parameter configurations respectively, and directly instantiating multiple copies of register transfer level codes globally. When the memory space is not large, multiple copies can be directly instantiated. Due to the fixed configuration and simple logic, the additional instantiation of RTL has little impact on simulation performance.

[0110] Instantiate multiple sets of second register transfer level (RTL) models for storage circuits (RAM), including:

[0111] The overall storage circuit space is divided into a plurality of overlapping segments, and a plurality of register transfer level (RTL) models are instantiated for each segment according to the different address distribution probabilities.

[0112] According to some embodiments, when the memory is large, multiple instantiations may affect the simulation speed, and the environment may not be able to model too large an array. Therefore, the overall storage circuit space is divided into multiple overlapping segments, and multiple register transfer level (RTL) models are instantiated for each segment according to the different address distribution probabilities. Specifically, the instantiated RTL is split, and the overall memory space is divided into multiple segments, such as 5 segments such as ABCDE, where ABC segment is instantiated with 1 copy W=1; BCD segment is instantiated with 1 copy W=2, CDE segment is instantiated with 1 copy: W=3, and ABCDE segments are all instantiated with 1 copy W=4, which reduces the number of overall instantiations, but various combinations have overlaps.

[0113] Instantiating multiple sets of second register transfer level (RTL) models for storage circuits (RAM), and also including: when the probability of a certain address distribution is less than a threshold, not instantiating the second register transfer level model corresponding to the corresponding address distribution pattern, thereby reducing the resources and time required for verification.

[0114] According to some embodiments, when the probability of a certain address distribution is less than a threshold, the second register transfer level model corresponding to the corresponding address distribution pattern is not instantiated. When the probability of a certain address distribution is greater than the threshold, only the second register transfer level (RTL) model corresponding to the corresponding address distribution pattern is instantiated. For example, the above-mentioned working scenarios are subdivided. For example, in the scenario in Example 1, only the probability of W=1~2 is high. At this time, only two copies of W=1~2 can be instantiated in this scenario, and multiple copies can be considered for other scenarios to speed up the simulation.

[0115] According to some embodiments, the verification method further includes: creating the reference model by modeling the storage space only for the addresses used, for example, creating the environment reference model by modeling the associated data group. For modeling in the ordinary array mode, assuming that the memory has a depth of 1024 and the unit is 8 bits, the modeling result is reg[7:0] sim_ram

[1024] , which requires 1024*8=8192 memory space; for the associative array mode, assuming that the memory also has a depth of 1024 and the unit is 8 bits, the modeling result is reg[7:0] sim_ram1[bit[9:0]]. Because the depth used for each simulation may be different, for example, if the simulation uses a depth of 32, only 32*(10+8)=576 memory space is required. For the environment reference model, associative array modeling is used, that is, only the addresses that have been written are modeled and stored, so that only the storage content that has been operated needs to be saved, and the entire storage space does not need to be modeled, which can improve the simulation efficiency.

[0116] Figure 3 A schematic diagram of the architecture of a verification method for a storage circuit according to an example embodiment is shown.

[0117] See also Figure 3 , the figure shows the verification method of the storage circuit according to the above method. First, the first register transfer level model (RTL) of the current chip is obtained to obtain the basic structure and functional characteristics of the design to be verified, a mathematical model is constructed to identify the address mapping relationship, and the probability of different address distributions accessed by the storage circuit is calculated. Multiple sets of second register transfer level models are instantiated according to the probability to fully verify the function of the storage circuit. A memory model is created and connected to the address and data ports of the register transfer level to be verified to simulate the behavior of the storage circuit in a real environment for functional verification.

[0118] The storage and reading results of the first register transfer level model, multiple sets of second register transfer level models, and the memory model are compared. By comparing the results of each model, it can be determined whether there is functional equivalence between them, that is, whether they have the same behavior and functional characteristics. According to some embodiments, the method of the scheme of the present invention verifies the equivalence of address transformation and functional correctness through multi-path comparison, realizes automatic comparison, and improves verification efficiency and verification completeness.

[0119] According to some embodiments, the method of the solution of the present invention is decoupled from the actual implementation mode of RTL, which reduces the difficulty of modeling. By adding a memory model without address conversion logic as a comparison, the accuracy of the comparison verification is guaranteed. The backdoor operation of the upper layer verification is supported, which improves the overall verification efficiency.

[0120] Figure 4 A block diagram of a computing device according to an example embodiment of the present application is shown.

[0121] like Figure 4 As shown, computing device 30 includes processor 12 and memory circuit 14. Computing device 30 may also include bus 22, network interface 16, and I / O interface 18. Processor 12, memory circuit 14, network interface 16, and I / O interface 18 may communicate with each other via bus 22.

[0122] The processor 12 may include one or more general-purpose CPUs (Central Processing Units, processors), microprocessors, or application-specific integrated circuits, etc., for executing relevant program instructions. According to some embodiments, the computing device 30 may also include a high-performance graphics card (GPU) 20 for accelerating the processor 12.

[0123] The storage circuit 14 may include a machine system readable medium in the form of a volatile storage circuit, such as a random access memory circuit (RAM), a read-only memory circuit (ROM), and / or a cache memory circuit. The storage circuit 14 is used to store one or more programs including instructions and data. The processor 12 may read the instructions stored in the storage circuit 14 to execute the above-mentioned method according to the embodiment of the present application.

[0124] The computing device 30 may also communicate with one or more networks via the network interface 16. The network interface 16 may be a wireless network interface.

[0125] The bus 22 may include an address bus, a data bus, a control bus, etc. The bus 22 provides a path for exchanging information between components.

[0126] It should be noted that, in the specific implementation process, the computing device 30 may also include other components necessary for normal operation. In addition, those skilled in the art may understand that the above device may only include components necessary for implementing the embodiments of this specification, and need not include all components shown in the figure.

[0127] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash storage circuit device, a magnetic card or an optical card, a nanosystem (including a molecular storage circuit IC), a network storage device, a cloud storage device, or any type of medium or device suitable for storing instructions and / or data.

[0128] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any one of the methods recorded in the above method embodiments.

[0129] Those skilled in the art can clearly understand that the technical solution of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array, an integrated circuit, etc.

[0130] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0131] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0132] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0133] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0134] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0135] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage circuit. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage circuit, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.

[0136] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0137] The exemplary embodiments of the present application are specifically shown and described above. It should be understood that the present application is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present application is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended clauses.

Claims

1. A verification method for a storage circuit, It is characterized in that include: Obtain the first register transfer level model of the current chip; Acquire information of a storage circuit for the current chip, and construct a mathematical model to identify an address mapping relationship, wherein the mathematical model simulates address conversion in different scenarios, and the different scenarios are abstracted as a set of parameters in a mathematical expression corresponding to the mathematical model, and the set of parameters is used to confirm whether the address needs to be rearranged and the rearrangement method; Calculating the probability of different address distributions accessed by the storage circuit according to the mathematical model; Instantiating a plurality of sets of second register transfer level models for the storage circuit according to the probabilities of the different address distributions, wherein each set of the second register transfer level models respectively and fixedly uses a different address distribution mode; Creating a memory model for the storage circuit that does not include address translation logic, and connecting the memory model to address and data ports of a register transfer stage to be verified; The first register transfer level model and multiple sets of the second register transfer level models and the storage and reading results of the memory model are compared to verify functional equivalence.

2. The verification method according to claim 1, It is characterized in that The method further comprises: When there is data change in the storage space in the reference model of the verification environment, the data of the corresponding address of the memory model is queried to compare whether the data is consistent with the reference model, thereby achieving real-time comparison.

3. The verification method according to claim 2, It is characterized in that The method further comprises: The storage read result of the first register transfer level model is compared with the storage read result of the reference model to verify the correctness of the first register transfer level model.

4. The verification method according to claim 1, It is characterized in that The method further comprises: A first address node for verification is determined, a directed verification is performed on the first address node, and multiple batches of random access are performed on the remaining addresses.

5. The verification method according to claim 1, It is characterized in that The method further comprises: Second register transfer level models of multiple sets of storage circuits are instantiated for multiple ports, thereby completing equivalence verification at the port level.

6. The verification method according to claim 1, It is characterized in that The method further comprises: When performing upper-layer verification, the memory model is used to perform functional verification through backdoor operations.

7. The verification method according to claim 1, It is characterized in that Instantiate multiple sets of second register transfer level models for storage circuits, including: Directly globally instantiate multiple copies of the register transfer level code using different parameter configurations.

8. The verification method according to claim 1, It is characterized in that Instantiate multiple sets of second register transfer level models for storage circuits, including: The overall storage circuit space is divided into a plurality of overlapping segments, and a plurality of register transfer level models are instantiated for each segment according to the probability of the different address distributions.

9. The verification method according to claim 8, It is characterized in that Instantiate multiple sets of second register transfer level models for storage circuits, including: When the probability of a certain address distribution is less than a threshold, the second register transfer level model corresponding to the corresponding address distribution pattern is not instantiated, thereby reducing the resources and time required for verification.

10. The verification method according to claim 2, It is characterized in that The verification method further includes: creating the reference model in a manner of performing storage space modeling only on used addresses, thereby reducing resource consumption.

11. A computing device, It is characterized in that include: processor; as well as A storage circuit storing a computer program, which, when executed by the processor, enables the processor to perform the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Memory controller with flexible address decoding

    CN109478169A

  • Verification method and device of integrated circuit, computer equipment and storage medium

    CN114462338A

  • Verification method and device of memory circuit, platform, equipment and storage medium

    CN114662428A

  • Security systems and methods for integrated circuits

    US20210182432A1

  • Chip verification method and apparatus, electronic device, and storage medium

    US20240036111A1