Method and device for digital-analog mixed signal simulation and storage medium
By obtaining the digital model of the analog module and using the connector module to connect to the digital module, the problems of digital model modeling errors and low connection efficiency in mixed-signal simulation are solved, achieving a fast iteration and efficient simulation process, and reducing user debugging time. .
Patent Information
- Application Number
- CN202410977206.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-09-24
AI Technical Summary
The existing technology has problems with digital model modeling errors and low module connection efficiency in mixed-signal simulation, resulting in frequent simulation failures. Moreover, existing methods rely on manual adjustments, which are inefficient and error-prone.
By obtaining the digital model of the analog module, use the connector module to generate it according to the configuration file, connect to the digital module, and simulate it in the digital simulator; when the simulation fails, an error report is provided to the modification tool, and the digital model is modified based on the report to improve Simulation efficiency and accuracy.
It achieves rapid iteration of digital models, improves the efficiency and accuracy of mixed-signal simulation, reduces user debugging time, and improves simulation and debugging efficiency.
Smart Images

Figure CN118690711A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer software technology, and in particular to a method, device and storage medium for digital analog mixed signal simulation. Background Art
[0002] In the field of integrated circuit verification, simulation can refer to compiling a logical system design and then running it using simulation tools to simulate and test various functions of the design. The design can be, for example, an application-specific integrated circuit (ASIC) or a system-on-chip (SOC). Therefore, the design tested or verified in simulation can also be called the design under test (DUT).
[0003] In chip design, it is often necessary to perform mixed signal simulation on analog modules and digital modules. Since the simulation principles of analog modules and digital modules are completely different, it is necessary to digitally model the analog modules to obtain the digital model of the analog modules, and then simulate the digital model together with the digital modules using a digital simulator. Summary of the invention
[0004] The first aspect of the present application provides a method for digital analog mixed signal simulation. The method comprises: obtaining a digital model of an analog module; connecting the digital model to a digital module via a connector module, the connector module being generated according to a configuration file of the mixed signal simulation; simulating the digital model and the digital module as a whole in a digital simulator; and in response to the simulation failure, providing an error report of the simulation failure to a modification tool of the digital model, so that the modification tool modifies the digital model based on the error report.
[0005] A second aspect of the present application provides an electronic device, comprising: a memory for storing a set of instructions; and at least one processor configured to execute the set of instructions so that the electronic device performs the method as described in the first aspect.
[0006] A third aspect of the present application provides a non-transitory computer-readable storage medium, which stores a set of instructions for a computer, and the set of instructions is used to cause the computer to perform the method as described in the first aspect when executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0008] Figure 1 A schematic structural diagram of an exemplary electronic device according to an embodiment of the present application is shown.
[0009] Figure 2 A schematic diagram of an exemplary simulation system according to an embodiment of the present application is shown.
[0010] Figure 3 A schematic diagram of an exemplary compiler according to an embodiment of the present application is shown.
[0011] Figure 4 A schematic diagram of mixed signal simulation according to an embodiment of the present application is shown.
[0012] Figure 5 A flow chart of a method for digital analog mixed signal simulation according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0013] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0014] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in this application should be understood by people with ordinary skills in the field to which this application belongs. The words "first", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0015] The digital modeling of the analog model can usually be done by a modeling tool or manually by the user. It is understandable that for analog-digital mixed signal simulation, the quality of the digital modeling of the analog model is crucial. If the digital model provided to the digital simulator is wrong, the mixed signal simulation will easily fail. At the same time, the connection between the digital model and the digital module is also extremely important.
[0016] Therefore, how to improve the efficiency of mixed-signal simulation is a technical problem that needs to be solved urgently.
[0017] Figure 1 FIG. 1 is a schematic diagram showing the structure of an electronic device 100 according to an embodiment of the present application. The electronic device 100 may be an electronic device for running a simulation system. Figure 1 As shown, the electronic device 100 may include: a processor 102, a memory 104, a network interface 106, a peripheral interface 108 and a bus 110. The processor 102, the memory 104, the network interface 106 and the peripheral interface 108 are connected to each other through the bus 110 in the electronic device.
[0018] Processor 102 may be a central processing unit (CPU), an image processor, a neural network processor (NPU), a microcontroller (MCU), a programmable logic device, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or one or more integrated circuits. Processor 102 may be used to perform functions related to the technology described in this application. In some embodiments, processor 102 may also include multiple processors integrated into a single logical component. Figure 1 As shown, the processor 102 may include a plurality of processors 102a, 102b, and 102c.
[0019] The memory 104 may be configured to store data (eg, instruction sets, computer codes, intermediate data, etc.). In some embodiments, the simulation test system for simulation test design may be a computer program stored in the memory 104. Figure 1 As shown, the data stored in the memory may include program instructions (for example, program instructions for implementing the method for digital analog mixed signal simulation of the present application) and data to be processed (for example, the memory may store temporary codes generated during the compilation process). The processor 102 may also access the program instructions and data stored in the memory, and execute the program instructions to operate on the data to be processed. The memory 104 may include a volatile storage device or a non-volatile storage device. In some embodiments, the memory 104 may include a random access memory (RAM), a read-only memory (ROM), an optical disk, a magnetic disk, a hard disk, a solid-state drive (SSD), a flash memory, a memory stick, etc.
[0020] The network interface 106 can be configured to provide the electronic device 100 with communication with other external devices via a network. The network can be any wired or wireless network capable of transmitting and receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, near field communication (NFC), etc.), a cellular network, the Internet, or a combination thereof. It is understood that the type of network is not limited to the above specific examples. In some embodiments, the network interface 106 can include any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, etc., in any combination.
[0021] The peripheral interface 108 can be configured to connect the electronic device 100 to one or more peripheral devices to achieve information input and output. For example, the peripheral devices can include input devices such as a keyboard, a mouse, a touch pad, a touch screen, a microphone, and various sensors, and output devices such as a display, a speaker, a vibrator, and an indicator light.
[0022] The bus 110 may be configured to transmit information between various components of the electronic device 100 (e.g., the processor 102, the memory 104, the network interface 106, and the peripheral interface 108), such as an internal bus (e.g., a processor-memory bus), an external bus (USB port, PCI-E bus), etc.
[0023] It should be noted that, although the above electronic device architecture only shows the processor 102, the memory 104, the network interface 106, the peripheral interface 108 and the bus 110, in the specific implementation process, the electronic device architecture may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above electronic device architecture may also only include the components necessary for implementing the embodiment of the present application, and does not necessarily include all the components shown in the figure.
[0024] Figure 2 FIG. 2 is a schematic diagram of an exemplary simulation tool 200 according to an embodiment of the present disclosure. The simulation tool 200 may be a computer program running on the electronic device 100 .
[0025] In the field of chip design, a design can usually be simulated using a simulation tool, such as the GalaxSim simulation tool produced by Xinhuazhang Technology Co., Ltd. Figure 2The exemplary simulation tool 200 shown may include a compiler 210 and a simulator 220. The compiler 210 may receive source code 204 (e.g., a hardware description language such as VHDL, Verilog, SystemVerilog, etc.) and compile it into an executable code 206 (e.g., machine code, assembly code, software code, etc.). It is understood that the description of the logic system design may be described in a hardware description language (HDL), a register transfer level (RTL) language, binary code, assembly code, or machine code, etc. The simulator 220 may perform simulation according to the executable code 206 and output the simulation result 208. For example, the simulation tool 200 may output the simulation result 208 via Figure 1 The peripheral interface 108 outputs the data to an output device (eg, displayed on a display).
[0026] Figure 3 FIG. 2 is a schematic diagram of an exemplary compiler 210 according to an embodiment of the present application. Figure 3 As shown, compiler 210 may include a front end 212 , a middle end 214 , and a back end 216 .
[0027] The front end 212 may be used to analyze the lexical, grammatical, and semantic aspects of the source code according to a specific source language.
[0028] After the lexical, grammatical and semantic analysis of the source code is completed, the middle end 214 can convert the source code into an intermediate representation (or intermediate code) and can optimize the intermediate representation. The intermediate language (intermediate code) is a syntax-oriented, equivalent internal representation code of the source code that is easy to translate into the target program. Its comprehensibility and the degree of easy generation of execution code are between the source code and the execution code. Commonly used intermediate codes include reverse Polish notation, quadruple, ternary and tree representation. For example, the middle end 214 can remove useless code, remove inaccessible code, clear unused variables, etc. Optimization can include machine-related optimization and machine-independent optimization. Among them, machine-related optimization, for example, can be the optimization of the test platform (Testbench, TB), and some test platform characteristics can be used to help optimize. Machine-independent optimization, for example, can be the optimization of the design under test (Design Under Test, DUT). The optimized intermediate representation can be passed to the back end 126 for further processing.
[0029] The back end 216 can be configured based on the target processor (e.g., Figure 1 The intermediate representation is further optimized according to the architecture of the processor 102, and an execution code is generated. Usually, the execution code is a machine code.
[0030] It is understood that the structure of the compiler is not limited to Figure 3For example, front end 212 and middle end 214 may be collectively referred to as a front end of a compiler.
[0031] The compiler 210 can generate an execution code based on the computer code to be compiled. The computer code to be compiled can also be called source code, such as a written logic system design. Usually, the source language for writing the source code is a high-level programming language. The high-level programming language can be the above-mentioned software programming language or hardware programming language. The execution code can be, for example, assembly code, machine code, etc. Usually, the compiler 210 can be stored in Figure 1 The compiler 210 is stored in the memory 104 shown in the figure and is executed by the processor 102 to compile the logic system design into execution code. The compiler 210 can convert the description of the logic system design from a high-level language description (e.g., HDL language) into a lower-level description (e.g., RTL language or binary code) so that the underlying hardware can run the logic system design.
[0032] As described above, digital simulation of an analog module using a digital simulator requires modeling the analog module to obtain a digital model.
[0033] Since the signal generated by the analog module is a continuous signal, while the signal of the digital module is a discrete signal, it is necessary to convert the continuous analog signal into a discrete digital signal during the modeling process. The usual practice is to use a digital signal in WREAL format to represent the analog signal. Since the data bit width of the WREAL format is different from that of an ordinary digital signal, it often needs to be converted before it can be matched, so as to connect the digital model of the analog module with the digital module. Therefore, quickly completing the connection between the digital model and the digital module has always been a technical problem that needs to be solved.
[0034] In addition, as mentioned above, the reason for the failure of mixed signal simulation may be the modeling error of the digital model. The existing technology generally manually checks the error records and then manually adjusts the digital model, which is inefficient and prone to errors. Therefore, how to quickly iterate the digital model is also a technical problem in the field of mixed signal simulation.
[0035] Figure 4 FIG. 4 is a schematic diagram of a mixed signal simulation 400 according to an embodiment of the present application.
[0036] like Figure 4 As shown, the analog module 402 may be a model circuit design of various types, such as a phase-locked loop.
[0037] The analog module 402 can be modeled as a digital model 406. In some embodiments, the modeling is manual modeling by the user. In other embodiments, the modeling can be completed via a modeling tool 404 running via the electronic device 100. For example, the modeling tool 404 can convert the description of the analog circuit in the analog module 402 into an equivalent digital model 406 described by Verilog AMS.
[0038] The digital module 408 is usually a digital circuit design that has been prepared. In order to facilitate the connection between the digital model 406 and the digital module 408, the embodiment of the present application provides a configuration file 410. The digital module 408 can be, for example, a digital circuit part of a chip, which is used to connect with the analog module 402.
[0039] The configuration file 410 describes the configuration of the interface of the digital model 406 and the configuration of the interface of the digital module 408. For example, the configuration file 410 may describe the width of the signal in the digital model 406 (e.g., the signal in Wreal format) and the width of the signal in the digital module 408. The simulation tool 200 may generate a connector module 412 based on the configuration file 410 to connect the digital model 406 and the digital module 408. In some embodiments, the connector module 412 may convert a signal with an excessively long width into an appropriate signal width.
[0040] The connection problem between the digital model 406 and the digital module 408 can be solved by the configuration file 410 .
[0041] The simulation tool 200 may perform mixed signal simulation on the digital model 406 and the digital module 408 as well as the connector module 412 connecting them as a complete logic system design.
[0042] The mixed signal simulation may generate simulation results 414. The simulation results 414 may include, for example, simulation waveforms and simulation logs. The simulation log may include an error report 416. It is understood that the error report 416 may also include only warnings (for example, in a scenario where the simulation is successful).
[0043] Mixed signal simulation may fail. When mixed signal simulation fails, simulation tool 200 may provide simulation result 414 of mixed signal simulation to modeling tool 404. More specifically, simulation result 414 may be provided to a modification tool (not shown) in modeling tool 404. It is understood that in some embodiments, modeling tool 404 and modification tool are integrated, so in Figure 4 Only the modeling tool 404 is shown.
[0044] The error report 416 may include at least one of: port and signal declaration errors, physical quantity definition errors, math or function errors, simulation parameter errors, interface mismatches, or timing errors.
[0045] Port and signal declaration errors may be that the port direction or signal type is not correctly declared in the model 406. Physical quantity definition errors may be that the unit of the physical quantity is not specified or is incorrectly specified in the nature declaration. Mathematical or function errors may be that the wrong mathematical expressions or functions, such as differentiation and integration, are used in the model 406. Simulation parameter errors may be that the simulation step size, termination time or convergence conditions are set incorrectly. Interface mismatch may be that in a mixed digital-analog simulation, the interface between the digital part and the analog part does not match. Timing errors may be that the timing constraints are violated.
[0046] Modeling tool 404 can modify digital model 406 accordingly to solve the problem of incorrect model according to error report 416. For example, for port and signal declaration errors, modeling tool 404 can modify the direction of the port with errors in digital model 406; for physical quantity definition errors, modeling tool 404 can specify the correct unit of the physical quantity; for mathematical or function errors, modeling tool 404 can modify mathematical expressions or call the correct Verilog AMS function; other measures may also include adjusting timing constraints, adjusting electrical and timing characteristics of interfaces, etc.
[0047] In some embodiments, the above modifications are not directly applied to the digital model 406, but are presented on a graphical user interface, thereby giving the user some modification suggestions and modification assistance. The final modification can be implemented manually by the user.
[0048] In this way, the modeling tool 404 can quickly modify the digital model 406 according to the error report 416, and provide the modified digital model 406 to the simulation tool 200 to start a new round of mixed signal simulation.
[0049] For a new round of mixed signal simulation, the digital model 406 may be further automatically modified, thereby saving the debugging time of the user and improving the efficiency of mixed signal simulation and debugging.
[0050] Figure 5 FIG. 5 is a flow chart of a method 500 for digital analog mixed signal simulation according to an embodiment of the present application. The method 500 may be Figure 1 The electronic device 100 shown is implemented, more specifically, by the simulation tool 200 running on the electronic device 100. The method 500 may include the following steps.
[0051] In step 502, the electronic device 100 may obtain an analog module (eg, Figure 3A digital model of the simulation module 402) (e.g., Figure 3 digital model 406).
[0052] In step 504, the electronic device 100 can transmit the digital model to the electronic device 100 via a connector module (eg, Figure 3 The connector module 412) is connected to the digital module. The connector module is configured according to the configuration file of the mixed signal simulation (for example, Figure 3 A configuration file 410) is generated.
[0053] In step 506 , the electronic device 100 may simulate the digital model and the digital module as a whole in a digital simulator (eg, the simulation tool 200 ).
[0054] In response to the simulation failure, the electronic device 100 may provide an error report (e.g., error report 416) of the simulation failure to a modification tool (e.g., modeling tool 404) of the digital model in step 508, so that the modification tool modifies the digital model based on the error report. The error report may include at least one of the following: port and signal declaration errors, physical quantity definition errors, mathematical or function errors, simulation parameter errors, interface mismatches, or timing errors.
[0055] In some embodiments, modifying the digital model based on the error report further comprises: generating modification suggestions based on the error report; and displaying the modification suggestions on a graphical user interface.
[0056] In some embodiments, the method 500 may further include: obtaining a modified digital model of the simulation module. The modified digital model may be provided again to the simulation tool 200 to start a new round of simulation.
[0057] In this way, the modeling tool 404 can quickly modify the digital model 406 according to the error report 416, and provide the modified digital model 406 to the simulation tool 200 to start a new round of mixed signal simulation.
[0058] The present application also provides an electronic device. The electronic device may be Figure 1 The electronic device 100 may include a memory for storing a set of instructions; and at least one processor configured to execute the set of instructions so that the electronic device performs the method 500.
[0059] The embodiment of the present application further provides a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores a set of computer instructions, and the set of instructions is used to enable the electronic device to perform method 500 when executed.
[0060] Some embodiments of the present application are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0061] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present application as described above, which are not provided in detail for the sake of simplicity.
[0062] Although the present application has been described in conjunction with specific embodiments of the present application, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the discussed embodiments.
[0063] This application is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application should be included in the scope of protection of this application.
Claims
1. A method for digital analog mixed signal simulation, comprising: Obtaining a digital model of the analog module; connecting the digital model to a digital module via a connector module, the connector module being generated according to a configuration file of the mixed signal simulation; Simulating the digital model and the digital module as a whole in a digital simulator; as well as In response to the simulation failure, an error report of the simulation failure is provided to a modification tool of the digital model, so that the modification tool modifies the digital model based on the error report.
2. The method of claim 1, further comprising: A modified digital model of the simulation module is obtained.
3. The method of claim 1, wherein: The error report includes at least one of the following: port and signal declaration errors, physical quantity definition errors, math or function errors, simulation parameter errors, interface mismatches, or timing errors.
4. The method of claim 1, wherein: Modifying the digital model based on the error report further comprises: generating modification suggestions based on the error report; The modification suggestion is displayed on a graphical user interface.
5. An electronic device comprising: a memory for storing a set of instructions; as well as At least one processor is configured to execute the set of instructions so that the electronic device performs the method according to any one of claims 1 to 4.
6. A non-transitory computer-readable storage medium storing a set of instructions for a computer, the set of instructions being used to cause the computer to perform the method according to any one of claims 1 to 4 when executed.
