A method and computing device for chip simulation
By extracting the register configuration of the driver software and converting it into a random constraint file for chip simulation, the problem of low chip simulation efficiency is solved, configuration errors can be quickly located and resolved, and the reliability and verification efficiency of the design are improved.
Patent Information
- Application Number
- CN202410941791.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-07-15
AI Technical Summary
Chip simulation efficiency in the existing technology is low, which results in joint simulation problem location taking a long time, occupying a lot of manpower and resources, and often increasing complexity due to software configuration errors, making it difficult to solve quickly.
By extracting the register configuration of the driver software, converting it into a random constraint file, using the electronic verification platform for simulation, and determining whether to continue the simulation based on the constraint solution results, configuration errors can be quickly screened out, and resource utilization and positioning efficiency can be optimized.
It improves the efficiency of locating chip configuration problems, reduces manpower and time consumption, improves the accuracy and reliability of testing, simplifies the problem recurrence and location process, and reduces the risk of errors caused by human negligence.
Smart Images

Figure CN118536445B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chip and electronic system design, and in particular to a method for chip simulation. Background Art
[0002] The final delivery of the chip needs to be accompanied by a matching software driver so that users can effectively use and configure the chip. The software driver is a bridge between the operating system and the chip hardware, ensuring that the hardware device can be correctly identified and used by the operating system. The software driver is implemented by configuring different chip registers according to the chip's user manual. Therefore, the driver software needs to be tested together with the chip before it is actually delivered. Use a real chip sample or a platform built with FPGA / EMU (field programmable gate array / emulator) to run the driver software on the platform and test whether the driver software functions correctly on the chip. At the same time, the driver software corresponds to the actual usage scenario, which is also an important step to verify the chip function through the actual usage scenario.
[0003] Currently, locating this type of software and hardware co-simulation problem requires the collaboration of software driver writers, chip designers, chip verifiers, and chip hardware personnel to check possible causes one by one. If the cause cannot be found on the sample chip / FPGA / EMU platform, it is necessary to construct the same verification scenario on the EDA verification environment to reproduce and locate the problem.
[0004] In theory, when testing on FPGA / EMU or sample platforms, the chips have been extensively verified and there will not be many problems missed, but each problem may be an important problem in actual use, so it will be highly valued and human resources will be invested in handling each problem. However, in actual implementation, most of the problems that need to be located are software problems, among which a large part are caused by configurations that do not meet chip requirements. These problems are actually misunderstandings of chip usage, not problems with the chip itself, but they take up a lot of resources and debugging time.
[0005] Therefore, a technical solution is needed to solve the problem that joint simulation is inefficient and takes up a lot of manpower and time. Summary of the invention
[0006] The present invention aims to provide a method for chip simulation, which can solve the problem of low efficiency of joint simulation problems, reduce labor costs, and shorten the time for problem locating.
[0007] According to one aspect of the present invention, there is provided a method for chip simulation, comprising:
[0008] Extracting the register configuration of the driver software, wherein the register configuration is used to configure the register of the chip, and extracting the configuration information according to the valid domain segment of the register;
[0009] Converting the valid domain segment extracted from the register configuration of the driver software into a random constraint file for an electronic verification platform;
[0010] Adding the random constraint file to the constraint list of the simulation;
[0011] Running the simulation to obtain constraint solving results according to the random constraint file;
[0012] Determine whether to continue the simulation according to the constraint solving result.
[0013] According to some embodiments, extracting the register configuration of the driver software includes:
[0014] Loading and simulating the binary verification file provided by the driver software until the register configuration is completed, and obtaining the register configuration of the driver software through a waveform value interception tool; or
[0015] The driver software provides a disassembled file of a binary verification file, and extracts keywords from the disassembled file to obtain the register configuration of the driver software; or
[0016] A configuration generated independently using the driver software.
[0017] According to some embodiments, running the simulation includes:
[0018] The random constraint file is used to control the random generation of a group of register configuration values, and is loaded into the register transfer level code for simulation.
[0019] According to some embodiments, converting the valid domain segment extracted from the register configuration of the driver software into a random constraint file includes:
[0020] The program code and logical relationship of the application layer of the driver software are converted into random constraints that can be recognized by the verification environment platform at the bottom layer of the chip.
[0021] According to some embodiments, further comprising:
[0022] Converting the register configuration of the driver software into a valid domain segment of the register;
[0023] Count the number of configurations of each valid domain segment;
[0024] The configured registers are optimized according to the configuration times.
[0025] According to some embodiments, further comprising:
[0026] The random constraint file is converted into an immediately executable program language to perform configuration legality check.
[0027] According to some embodiments, converting the valid domain segment extracted from the register configuration of the driver software into a random constraint file includes:
[0028] Extracting specific configuration values of the valid domain segment;
[0029] Based on the random configuration file of the verification environment platform, all register configuration fields in the chip contained in the random configuration file are assigned values using the specific configuration value, thereby obtaining the random constraint file of the verification environment platform.
[0030] According to some embodiments, adding the generated real-time random constraint file to the constraint list of the simulation includes:
[0031] Use file list or reference to add constraints.
[0032] According to some embodiments, determining whether to continue simulation according to the constraint solving result includes:
[0033] If the error is caused by the configuration not meeting the chip requirements, the simulation will be stopped after the constraint error is reported at the start of the simulation;
[0034] If the error is not caused by the configuration not meeting the chip requirements, the constraint solver will not report an error and the simulation will continue.
[0035] According to another aspect of the present invention, a computing device is provided, comprising a processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the processor executes any of the above methods.
[0036] According to another aspect of the present invention, there is provided a non-transitory computer-readable storage medium having computer-readable instructions stored thereon, and when the instructions are executed by a processor, the processor is caused to execute any of the above methods.
[0037] The chip simulation method of this example embodiment extracts valid domain segments from software configuration and converts them into random constraint files, obtains constraint result solutions through random constraint files, and determines whether to continue simulation based on constraint solution results. This efficient approach can effectively screen out test vectors, avoid invalid or redundant simulation runs, optimize resource utilization, and systematically locate and solve chip configuration problems, thereby improving design reliability and verification efficiency. Configuration errors of driver software can be quickly screened out through constraint solving, and the specific location of illegal configuration errors can be located, thereby improving efficiency, reducing manpower and time consumption, and avoiding errors introduced by human negligence or misunderstanding, thereby improving test accuracy and reliability.
[0038] This example embodiment uses a method for locating chip configuration error problems, and can use the random constraints used in the existing verification environment to verify, without the need to redevelop the inspection tool, with low difficulty and good reusability. Even for non-configuration illegal problems, the extracted configuration can be directly used to reproduce the problem in the verification environment, without the need to construct new use cases to reproduce and locate the problem, which improves efficiency and reduces the difficulty of problem reproduction.
[0039] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for describing the embodiments are briefly introduced below.
[0041] Figure 1 A flow chart showing a method of positioning a configuration according to an example embodiment is shown.
[0042] Figure 2 A flow chart of a method for extracting register configuration of driver software according to an example embodiment is shown.
[0043] Figure 3 A flow chart of a method for chip configuration according to an example embodiment is shown.
[0044] Figure 4 A block diagram of a computing device according to an example embodiment of the invention is shown. DETAILED DESCRIPTION
[0045] 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 the present invention will be comprehensive and complete and 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.
[0046] In addition, the described features, structures or characteristics may 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 invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.
[0047] 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.
[0048] 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.
[0049] 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 present inventive concept. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.
[0050] 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 the present invention 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.
[0051] 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 invention, and therefore cannot be used to limit the protection scope of the present invention.
[0052] Before describing the embodiments of the present invention, some terms or concepts involved in the embodiments of the present invention are explained.
[0053] EDA (Electronic Design Automation), electronic design automation, EDA verification environment is a collection of software and methods used to verify the functional correctness, performance and other characteristics of hardware design in integrated circuit (IC) and system-level design. In the modern chip design process, it ensures that the design can meet the predetermined requirements before actual manufacturing.
[0054] RTL, register transfer level, is a core concept in digital circuit design, which is used to describe the operational abstraction level of synchronous digital circuits. This description method mainly focuses on the flow of data between logic units such as hardware registers, memories, combinational logic devices and buses, and their logic algebraic operation.
[0055] A random constraint file, used in an electronic verification platform, is a file used to guide the random generation of test stimuli or test scenarios. It defines the scope and characteristics of test data by setting a series of rules and conditions.
[0056] SV (System Verilog), built on Verilog, significantly expands the design and verification capabilities by introducing features such as object-oriented programming, and is suitable for complex design verification projects. Based on SystemVerilog, verification engineers can create a verification environment with high automation and reusability.
[0057] RM (reference model) refers to the golden model, which is used to produce standard results. In integrated circuit design and software testing, a reference model is a preset, reliable model used to generate specific standard results, which are then used as a benchmark for comparison to verify the correctness and effectiveness of other models or systems. Reference models are usually built based on precise algorithms and data, and can accurately simulate the behavior of the real world or the performance of the system.
[0058] A bin file, or binary file, is a computer file that stores data in binary format. This type of file usually does not contain any text format content, but is composed of machine code, images, sounds, or other raw data in a specific format.
[0059] Co-Simulation is an electronic design automation (EDA) technology that allows hardware systems and software / algorithms to be simulated simultaneously in a hardware description language (HDL) simulation environment. This simulation method combines hardware behavioral level or register transfer level (RTL) simulation with software models, allowing designers to test and verify the entire system including hardware and embedded software before the hardware is actually manufactured.
[0060] After the chip is finally delivered, it needs a software driver to be used. The software driver is implemented by configuring different chip registers according to the chip manual. If the person who writes the software driver does not understand or pay attention to some conditions in the chip manual, the driver may not meet the chip requirements, and problems may occur during operation or even fail to run. When a running error occurs, it is necessary to locate the cause of the problem to see if it is a software configuration problem or a chip function problem.
[0061] As the scale of chips becomes larger and larger, the steps and content of software driver chip configuration are becoming more and more complicated, which makes configuration errors more common. At present, to locate this type of software and hardware joint simulation problems, software driver writers, chip designers, chip verification, and chip hardware personnel need to work together to locate possible causes one by one. If the cause cannot be found on the sample / FPGA / EMU platform, it is necessary to construct the same verification scenario on the EDA verification environment to reproduce and locate the problem. Since the driver may not only act on the current chip, but also interspersed with various CPU instructions, external chip control and other contents, the configuration is complex. EDA can only try to find relevant configurations based on the scenario description. It is difficult to accurately reproduce the scenario, and the cycle of solving the problem is usually long.
[0062] The configuration of pure chip module verification will set constraints according to the maximum possibility of chip support and use. These conditions will be reviewed many times and will be used together with the functional coverage to measure the completeness of chip functional verification. Therefore, it can be understood that these constraints are the constraints for chip use, and the configuration that meets these constraints meets the design requirements of the chip itself. On the contrary, if the configuration combination does not meet these constraints, it does not meet the design requirements of the chip and is likely to cause operation failure.
[0063] The first step of chip verification simulation is to generate chip configuration. At the beginning of the simulation, constraints are solved to obtain a set of configurations that meet the chip usage constraints. This process is usually very fast and only accounts for 10% of the chip simulation time. However, the process of building this set of constraints is time-consuming and requires discussion, review, and continuous iteration. It also requires a deep understanding of the chip's internals, which may take several weeks or even longer. The larger the chip, the longer it takes. Therefore, usually only chip verification will build a complete constraint file.
[0064] After the chip configuration is generated, it is also necessary to pass the configuration into RTL in a certain way to start simulation.
[0065] During the EDA chip verification process, the chip configuration can be loaded into the CPU contained in the RTL code through a bin file, and then the CPU runs and issues the configuration. In theory, this method can directly use the bin file provided by the software driver, but the efficiency of EDA simulation is thousands of times slower than that of FPGA / EMU / sample. It may be difficult to directly use the original bin file and it must be simplified. In addition, the RTL with CPU has a large code size and the simulation will be very slow.
[0066] The chip configuration can also be sent through the EDA verification environment, that is, the verification environment simulates the CPU to write values into different configuration registers. This method is the main configuration method for EDA verification, with fast simulation speed and easy control. However, this method cannot directly use the software configuration file, and the EDA use case needs to be reconstructed according to the software configuration file.
[0067] Therefore, the software-driven process needs to be verified and reproduced by EDA. One way is to optimize the C code process, simplify the operation, and then output the bin file to EDA for simulation with CPU. At this time, the simulation efficiency will be very low. Another way is to extract the configuration value of the software, write a new EDA verification case, use the EDA environment to issue the configuration, and reproduce the problem scenario.
[0068] In the current chip EDA verification process, the coverage-driven random verification method is mainly used. The method needs to limit and constrain the configuration content of each configurable register according to the chip specifications, configurable registers, and the association between configurations. Then, during simulation, a set of available chip configurations is randomly generated within the limits and constraints, and the chip functions under the configuration are verified to be correct. Finally, according to the functional coverage, it is confirmed that the randomly generated configuration combination has covered all possible configuration combinations supported by the chip, thereby proving that the chip function has been verified.
[0069] Existing methods use joint simulation problem and actual measurement platform positioning to verify and reproduce the problem through EDA. Joint simulation is a key technology in verifying the design of complex electronic systems, allowing hardware models written in hardware description languages (such as Verilog or VHDL) and software models implemented in high-level languages (such as C / C++) to work together in the same simulation environment.
[0070] When locating problems on actual measurement platforms (such as silicon samples, FPGA prototypes, and emulation platforms), it is necessary to carefully reconstruct the scenario in which the problem occurred, including all relevant hardware configurations, software interactions, and environmental factors. This is a complex and tedious process in itself, and requires close cooperation among interdisciplinary teams such as software engineers, hardware engineers, chip design engineers, and chip system verification engineers. Although multi-functional teams help to comprehensively analyze problems, they also increase communication costs and coordination difficulties.
[0071] The workflow of the existing method includes: discovering problems in a sample (Silicon bring-up), FPGA prototype verification or emulation environment, observing abnormal behavior or test failure by actually running software or test vectors; reading debug registers and trying to locate the problem. Hardware engineers and chip system verification engineers read the debug register status inside the chip through the debugging interface to preliminarily determine the module or cause of the problem; extracting the chip configuration of the test case of the actual measurement platform where the problem occurred. The chip system verification engineer and the hardware engineer record or export the specific chip configuration status that caused the problem, including but not limited to register settings, input signal sequences, etc.
[0072] According to the configuration information, test cases are constructed on the EDA verification platform. Chip system verification engineers and chip module verification engineers use EDA tools (such as UVM, etc.) to write or adjust the test bench according to the extracted measured platform configuration information to reproduce the same or similar chip configuration environment; try to reproduce the problem on the EDA platform. Chip system verification engineers and chip module verification engineers work together. If software interaction is involved, software engineers are also required to run the constructed test cases in the EDA simulation environment to observe whether the error phenomenon on the measured platform can be reproduced; locate the problem on the EDA platform. Chip system verification engineers and chip design engineers use the advanced debugging functions provided by EDA tools (such as waveform viewing, breakpoint setting, signal tracking, etc.) to accurately locate the specific location where the problem occurs.
[0073] Manual inspection revealed that the chip register configuration was incorrect. The chip system verification engineer and chip design engineer carefully reviewed the simulation results and compared them with the design specifications, identifying that the problem was caused by improper register configuration rather than a design defect. The configuration was corrected and the simulation was repeated on the EDA platform. The chip system verification engineer adjusted the register settings in the test case based on the incorrect configuration found, re-ran the simulation, and verified whether the problem disappeared due to the configuration modification. Confirming that the problem has been resolved, all relevant engineers confirmed that the simulation results after the configuration adjustment meet expectations and the problem does not recur. Then it may be necessary to verify the repair effect again on the actual measurement platform to ensure that the problem is completely resolved.
[0074] Through the collaborative work of software and hardware, using EDA to verify and reproduce the problem, manually checking the chip register configuration errors and making changes, this process involves multidisciplinary cooperation, and the long-term investment of multiple professional engineers also means high labor costs. If a lot of resources are consumed in the process of problem location, but it is found that the problem is not caused by factors other than the chip itself, this will undoubtedly greatly reduce the input-output ratio of the entire project.
[0075] To this end, the present invention proposes a technical solution. For joint simulation, the software configuration is extracted and converted into an SV constraint file, and the constraint file is loaded into the EDA verification environment for simulation. If the constraint solution fails, the wrong configuration can be automatically found, and the configuration can be modified and re-simulated until it is confirmed that the problem has been solved. According to the solution of the example embodiment, only software engineers and chip system verification engineers are required, and the problem-solving cycle can be shortened to 4 hours or even shorter.
[0076] Figure 1 A flow chart of a method for chip simulation according to an example embodiment is shown.
[0077] The actual chip product application is called by high-level software, such as Linux running on the CPU. But it is ultimately converted to the bottom layer, where the driver software converts the upper-level software instructions into a set of register read and write operations, and achieves the purpose of driving the chip by changing the value of the configuration register.
[0078] At S101 , the register configuration of the driver software is extracted.
[0079] According to some embodiments, the driver software provides a bin file compiled from the C language code to the verification engineer, which is loaded into the simulation CPU in the EDA environment for simulation. The simulation process only needs to be executed until the CPU configures the registers of the chip. Then, the bus interface output by the CPU is intercepted through the waveform value interception tool of the verdi tool to obtain a bus access combination of the address and the value. The address represents a configuration register, and the value is the configuration value written to the register. The software driver configuration refers to a set of register values generated by the chip's driver software, and the chip is made to work by configuring these values into the corresponding registers.
[0080] In S103, configuration information is extracted according to the valid domain segment.
[0081] According to some embodiments, with reference to the register manual of the chip, each register has a specific meaning, and the valid domain segment is determined according to the register manual of the chip, and each register has a specific valid domain segment. The registers of different bit widths are divided into n sub-parts, each sub-part is responsible for different functional meanings, and the register width occupied by each meaning is a domain segment, and the domain segment includes reserved or unused domain segments. The valid domain segments have the same or different widths. The chip will perform bus alignment according to a certain address bit width, such as 32bit, so there will be a minimum granularity for accessing the register, such as 32bit here, but in a 32bit register, there may be more than one meaning, and the register width occupied by each meaning is called a domain segment; and there may be invalid bits, such as a 32bit offset address configuration register, in which the highest bit represents the enable switch of the offset function, the lowest 8bit represents the offset address, and the rest is not used, then the register contains two valid domain segments, namely switch enable and offset address. Therefore, the valid domain segment in this article represents the register bit width with a specific meaning.
[0082] Extract configuration information according to the valid domain segment, that is, find the corresponding register configuration value according to the valid domain segment in the register. For example, the CPU writes address 0x20, and the value is 0x8000_0008. If the register is the offset address configuration register of the above distance, then the offset switch = 1 and the offset address = 8 can be extracted.
[0083] According to some embodiments, after obtaining the address + value access of the bus, the address + value is modified to the access format of UVM_RAL by a script, and the UVM_RAL model of the corresponding register is used for simulation. After writing the address, the value of the corresponding domain segment can be automatically modified. For example, the above-mentioned address offset function configuration register is named offset_cfg_reg in UVM_RAL, then the above process can be expressed as: offset_cfg_reg.write(status, addr, value, UVM_FRONTDOOR). Among them, status and UVM_FRONTDOOR are fixed formats of UVM syntax, addr is the above-mentioned 0x20, and value is the above-mentioned value 0x8000_0008. The corresponding domain segment can be accessed through UVM_FIELD: offset_cfg_reg.offset_en = 1, offset_cfg_reg.offset_addr = 8.
[0084] Preferably, an empty verification environment structure is used to process UVM_RAL: only the verification environment of the environment framework is built, and simulation can be performed after compilation. Such an environment runs fast and is convenient for extracting UVM_RAL information.
[0085] At S105 , the valid domain segment extracted from the register configuration of the driver software is converted into a random constraint file.
[0086] According to some embodiments, the specific configuration value of the valid domain segment is extracted, and the specific configuration value is used to assign values to all register configuration domain segments in the chip contained in the random configuration file, thereby obtaining a random constraint file of System Verilog. Using the random configuration file of the verification environment platform, the random configuration file contains all register configuration domain segments in the chip, and converts the program code and logical relationship at the application level of the driver software into random constraints that can be recognized by SystemVerilog at the bottom layer of the chip.
[0087] For example, the above address and enable can be converted to:
[0088] constraint offset_tc_constraint {
[0089] chip_reg_cfg.m_offset_en == 1;
[0090] chip_reg_cfg.m_offset_addr == 8;
[0091] }
[0092] in,
[0093] chip_reg_cfg is a random configuration file used by the EDA verification environment, which contains all the register configuration fields in the chip;
[0094] m_offset_en and m_offset_addr correspond to the offset_en and offset_addr fields of the register.
[0095] In S107, the generated random constraint file is added to the constraint list of the simulation.
[0096] According to some embodiments, to add the newly generated constraint file to the simulation or synthesis constraint list, the filelist or include method can be used to add the constraint list. And ensure that the format and content design of the constraint file are compatible to avoid introducing new naming conflicts and other possible problems. After adding the constraints, recompile to verify whether the constraints are correctly applied and no new errors are introduced.
[0097] In S109, the simulation is run, the constraint results are solved, and it is determined whether to continue the simulation according to the constraint solution results.
[0098] According to some embodiments, the random constraint file is used to control the random generation of a set of register configuration values, and loaded into the register transfer level code for simulation, for example, loaded into the central processing unit contained in the RTL code for simulation. Solve the constraint results. If the error is caused by the configuration not meeting the chip requirements, an error will be reported after the simulation and constraint solving start, and the simulation tool (such as VCS, IES) will display the specific conflicting constraints. For example, in the EDA environment constraint, m_offset_addr>= 32. This constraint conflicts with the above chip_reg_cfg.m_offset_addr == 8, and an error will be reported at the beginning of the simulation. The required simulation time is less than 10% of the complete operation of a use case. At this time, the root cause of the problem can be quickly confirmed.
[0099] Determine whether to continue the simulation based on the constraint solving results. If the error is not caused by the configuration not meeting the chip requirements, the constraint solving will not report an error and the simulation can continue. Because the same configuration of the software is used, the scene where the problem occurs can be directly reproduced for subsequent problem location. At this time, the configuration is issued by the EDA verification environment, and the simulation efficiency will be greatly improved compared to directly using bin files and CPU simulation.
[0100] For configuration errors that do not meet chip constraints, modify the corresponding conflicting configurations and record them. Then re-simulate until all conflicts are resolved. Feedback the recorded modifications to the software programmer, modify the software driver, and continue testing on the sample / PFGA / EMU platform.
[0101] For errors that are not caused by configuration not meeting chip constraints, the simulation continues to run until an error occurs, which can be analyzed and located on the EDA platform. At the same time, the problem can be located on the sample / PFGA / EMU platform simultaneously. Because it is a non-configuration conflict problem, whether it is a software process error or a chip function error, it has a high practical value in the end.
[0102] Figure 2 A flow chart of a method for extracting register configuration of driver software according to an example embodiment is shown.
[0103] In S201, a binary verification file provided by the driver software is loaded and simulated until the register configuration is completed, and the register configuration of the driver software is obtained by a waveform value interception tool.
[0104] According to some embodiments, providing a binary file compiled from the program code through the driver software is the most direct way, that is, after the developer writes the driver source code, it is converted into an executable binary file through a compiler. The binary file contains all the functional implementations of the driver and can be directly installed on the operating system, allowing the operating system to identify and control the hardware device.
[0105] Through EDA verification, executable simulation breakpoints are prepared, such as the ucli-save and ucli-restore commands supported by the VCS tool, and simulation can be continued from the previously saved node. When the save node is set after the chip is initialized and before the configuration is initiated, each time the bin file is changed, only the backdoor is used to load the bin file into the chip's storage space, and the simulation can be started from the breakpoint, without the need for recompilation, chip power on and off, chip initialization, etc.
[0106] According to some embodiments, extracting the register configuration of the driver software may also extract the disassembled file, the driver software provides the disassembled file of the binary verification file, extracting the keywords of the disassembled file to obtain the register configuration of the driver software; or using the driver software code to independently generate the relevant configuration of a specific format, using the configuration independently generated by the driver software. In order to understand or modify the behavior of an existing driver, it may be the customization of an open source driver, or for the purpose of reverse engineering, the existing driver binary file will be disassembled, and extracting the disassembled file can reveal the internal working logic and configuration structure of the driver, thereby allowing advanced users to modify the behavior of the driver or extract configuration information.
[0107] The driver development process sometimes includes a configuration script or tool that can extract information from the driver source code or configuration file and automatically generate a configuration file in a specific format. The configuration file may be used to simplify the deployment process and adjust driver parameters without in-depth code, such as device initialization parameters, operating modes, performance tuning options, etc. Using the driver software code to independently generate related configurations in a specific format can enhance flexibility and maintainability, and facilitate the deployment of the same driver in different environments. The software provides a disassembly file in C language. The script extracts the keywords of the disassembly file to obtain the content of the address and data value. Each address represents a configuration register, and the value is the configuration value written to the register.
[0108] The remaining steps are the same as above S103~S109.
[0109] The register configuration of the driver software covers the range from default settings at compile time to dynamic adjustments at runtime, as well as customization and optimization through advanced technical means. Each step is to ensure that the driver can serve the target hardware and operating system environment efficiently and stably.
[0110] The configuration of pure chip module verification will set constraints according to the maximum possibility of chip support and use. These conditions will be reviewed many times and will be used together with the functional coverage to measure the completeness of chip functional verification. Therefore, it can be understood that these constraints are the constraints for chip use, and the configuration that meets these constraints meets the design requirements of the chip itself. On the contrary, if the configuration combination does not meet these constraints, it does not meet the design requirements of the chip and is likely to cause operation failure.
[0111] Because these constraints are set according to the maximum supported range of the chip, the configuration content used by the chip in actual use should be a subset of the configuration combinations that can be generated by these constraints. For example, the maximum computing capacity supported by the display chip is 3840*2160 (4K), and all configurations less than this value are supported. However, when applied to ordinary monitors, only configurations of 1920*1080 or lower will be used. This actual configuration range is a subset of the maximum range of chip functions. During chip verification, random constraints will be written according to 3840*2160 as the boundary.
[0112] According to some embodiments, chip A supports two functions, convolution and matrix multiplication, and there are 300 related register domain segments. Among them, the width supports offset offset during matrix multiplication, and the maximum offset length is 127 and the minimum is 64; the convolution operation also supports offset offset, but only supports a maximum of 100 and a minimum of 40. Both constraints are in the random constraints of the EDA environment.
[0113] The software tester used 16384*16384 data for calculation, turned on the offset function, and configured the offset to 102. The test passed after configuring the matrix multiplication. The use case configuration was changed to a convolution scenario, and the test failed. The error was manifested as 25 data calculation errors, with no obvious pattern, and it was difficult to locate directly.
[0114] The software provides the compiled bin file to the system verification engineer. The simulation breakpoint is used to continue the simulation directly. The write address and write data of the CPU interface are extracted using the verdi method. The UVM_RAL write operation is written and simulated through an empty environment. The values of each configuration domain segment are obtained by printing information. The extracted domain segment values are converted into SystemVerilog random constraints through the script. There will be a constraint of "offset_addr==102". The extracted new constraints and the original constraints of the EDA environment are added to the simulation. An error will be reported when the constraint solution is started. "offset_addr==102" and "100>=offset_addr>=40" cannot be established at the same time. The cause of the problem is found, and offset_addr is modified between [40:100], and the test passes.
[0115] According to this exemplary embodiment, configuration errors of the driver software can be quickly screened out, and for errors of illegal configuration, the specific location of the error can be located, thereby improving efficiency and reducing consumption of manpower and time.
[0116] According to some embodiments, in the above embodiment, offset_addr meets the requirements, but an error still occurs.
[0117] EDA continued the simulation using the configuration generated by the merged constraints, and the error was reproduced. Among them, looking at the uvm_error in the simulation log, the first error occurred in the difference between RTL data 3762 and RM. Locating the waveform of this calculation and printing the log, it was found that during this calculation, the previous calculation had not yet ended. The software should wait for the previous calculation to end before initiating a new calculation. The cause of the problem was found, the software process was modified, and a waiting step was added. The problem was solved.
[0118] The above problems are difficult to locate only by using samples / FPGA, but the waveform of each beat can be seen on EDA, and the positioning efficiency is very high. Using the method for chip simulation of the present invention, EDA verification uses random constraints, and there is no need to redevelop the inspection tool, which is easy to use and has good reusability. Even if it is a non-configuration illegal problem, the extracted configuration can be directly used to reproduce the problem in the EDA environment, without constructing a new use case to reproduce and locate the problem, which improves efficiency and reduces the difficulty of problem reproduction.
[0119] Figure 3 A flow chart of a method for chip configuration optimization according to an example embodiment is shown.
[0120] At S301, the register configuration of the driver software is converted into a valid domain segment of the register.
[0121] According to some embodiments, the source code or configuration file of the driver software is deeply analyzed to identify all parts that perform read and write operations on hardware registers. The operations usually involve accessing specific register addresses to configure or query the hardware status, and the configuration items in the software are mapped one by one to the corresponding hardware register domains.
[0122] In S303, the configuration times of each valid domain segment are counted.
[0123] According to some embodiments, a logging function is added to the driver software to track each write operation to the hardware register, including information such as the register address, the value written, and the time of occurrence. Log data is collected for a long enough period of time, and the data is analyzed through scripts or tools to count the frequency of configuration changes of each register domain segment.
[0124] In S305, the configured register is optimized according to the configuration times.
[0125] According to some embodiments, the statistical results are analyzed and the configured registers are optimized according to the number of configurations, including finding register domains with extremely low configuration times. An extremely low configuration number means that there is a mismatch between the software configuration and the hardware implementation, or that there is unnecessary frequent configuration. If multiple register domains that do not change often are always set simultaneously or in association, consider merging them into a single register or command to reduce the number of configuration calls. For registers that are almost unchanged, consider setting their default values to the most commonly used configuration to reduce the need for initialization and dynamic configuration. Depending on the configuration frequency, it may also be necessary to consider optimizing the hardware logic, such as removing unused or rarely used functional modules to reduce chip area and power consumption.
[0126] This exemplary embodiment converts all configurations of the software driver test into register segments, counts the number of configurations of each segment, compares it with all the register segments of the chip, and optimizes the configuration registers according to the number of configurations. For example, can registers that are often configured together be optimized to one address to reduce the number of configurations, and confirm the reason for each configuration and whether there are redundant configuration processes; in addition, for register segments that have never been configured, whether they are redundant registers and whether they can be optimized.
[0127] By adjusting the driver software, reducing the frequent reading and writing of unnecessary registers, optimizing the configuration sequence, reducing the computational burden of real-time configuration, and achieving refined management and optimization of hardware register configuration, not only does it improve system performance, it also helps reduce power consumption and improve software maintainability.
[0128] According to some embodiments, register printing is added to the software driver code, and the configured register domain segment name and value are printed in a separate log. The System Verilog constraint file verified by EDA is converted into an immediately executable programming language, such as Python. In this way, there is no need for compilation and other steps, and no Linux server is required. Configuration legality checks can be quickly performed on Windows.
[0129] According to some embodiments, the following Python code will report an error immediately after execution, allowing real-time debugging:
[0130] offset_addr=102#Extracted software configuration value;
[0131] If offset_addr>100 or offset_addr<40: #SV environment constraint range is inverted, for example, if the constraint is [40:100], here it is <40 and >100;
[0132] print("error!! offset_address is not illegal")
[0133] Through the method for locating chip configuration error problems in this example embodiment, the configuration error problems of the driver software can be quickly screened out. For illegal configuration errors, the specific location of the error can be located, which improves efficiency and reduces the consumption of manpower and time. In addition, the method of this example embodiment can use the random constraints used in existing EDA verification, and there is no need to redevelop the inspection tool. It is easy to use and has good reusability. There is no need to construct new use cases to reproduce and locate problems, which improves efficiency and reduces the difficulty of problem reproduction.
[0134] Figure 4 A block diagram of a computing device according to an example embodiment of the invention is shown.
[0135] like Figure 4 As shown, computing device 30 includes processor 12 and memory 14. Computing device 30 may also include bus 22, network interface 16, and I / O interface 18. Processor 12, memory 14, network interface 16, and I / O interface 18 may communicate with each other via bus 22.
[0136] 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.
[0137] The memory 14 may include a machine system readable medium in the form of a volatile memory, such as a random access memory (RAM), a read-only memory (ROM) and / or a cache memory. The memory 14 is used to store one or more programs including instructions and data. The processor 12 may read the instructions stored in the memory 14 to execute the above-mentioned method according to the embodiment of the present invention.
[0138] 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.
[0139] 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.
[0140] 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.
[0141] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when the program is executed by a processor. 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 memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), a network storage device, a cloud storage device, or any type of medium or device suitable for storing instructions and / or data.
[0142] An embodiment of the present invention 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 method recorded in the above method embodiments.
[0143] Those skilled in the art can clearly understand that the technical solution of the present invention can be implemented with the help of software and / or hardware. "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.
[0144] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0145] 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.
[0146] In the several embodiments provided by the present invention, 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.
[0147] 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.
[0148] In addition, each functional unit in each embodiment of the present invention 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.
[0149] 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 memory. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.
[0150] 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.
[0151] The exemplary embodiments of the present invention are specifically shown and described above. It should be understood that the present invention is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present invention is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended clauses.
Claims
1. A method for chip simulation, It is characterized in that include: Extracting the register configuration of the driver software, wherein the register configuration is used to configure the register of the chip, and extracting configuration information according to the valid domain segment of the register, wherein the configuration information is a specific configuration value of the valid domain segment; Converting the specific configuration value of the valid domain segment extracted from the register configuration of the driver software into a random constraint file for an electronic verification platform; Adding the random constraint file to the constraint list of the simulation; Running the simulation to obtain constraint solving results according to the random constraint file; Determine whether to continue the simulation according to the constraint solving result.
2. The method according to claim 1, It is characterized in that Extracting the register configuration of the driver software includes: Loading and simulating the binary verification file provided by the driver software until the register configuration is completed, and obtaining the register configuration of the driver software through a waveform value interception tool; or The driver software provides a disassembled file of a binary verification file, and extracts keywords from the disassembled file to obtain the register configuration of the driver software; or A configuration generated independently using the driver software.
3. The method according to claim 1, It is characterized in that The running simulation comprises: The random constraint file is used to control the random generation of a group of register configuration values, and is loaded into the register transfer level code for simulation.
4. The method according to claim 1, It is characterized in that Converting the valid domain segment extracted from the register configuration of the driver software into a random constraint file includes: The program code and logical relationship of the application layer of the driver software are converted into random constraints that can be recognized by the verification environment platform at the bottom layer of the chip.
5. The method according to claim 1, It is characterized in that Also includes: Converting the register configuration of the driver software into a valid domain segment of the register; Counting the number of configurations of each of the valid domain segments; The configured registers are optimized according to the configuration times.
6. The method according to claim 1, It is characterized in that Also includes: The random constraint file is converted into an immediately executable program language to perform a configuration validity check.
7. The method according to claim 1, It is characterized in that Converting the valid domain segment extracted from the register configuration of the driver software into a random constraint file includes: Extracting specific configuration values of the valid domain segment; Based on the random configuration file of the verification environment platform, all register configuration fields in the chip contained in the random configuration file are assigned values using the specific configuration value, thereby obtaining the random constraint file of the verification environment platform.
8. The method according to claim 1, It is characterized in that The generated real-time random constraint file is added to the constraint list of the simulation including: Use file list or reference to add constraints.
9. The method according to claim 1, It is characterized in that Determine whether to continue simulation based on constraint solving results, including: If the error is caused by the configuration not meeting the chip requirements, the simulation will be stopped after the constraint error is reported at the start of the simulation; If the error is not caused by the configuration not meeting the chip requirements, the constraint solver will not report an error and the simulation will continue.
10. A computing device, It is characterized in that include: processor; as well as A memory 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 9.
