Comprehensive ADC analog circuit behavior model and simulation method
By using Verilog-HDL to describe the behavioral model of the capacitive DAC and comparator, and using the on switch and the three-throw switch to simulate the state changes of the capacitor bank, it solves the problem of high time overhead of joint simulation in ADC analog circuit design and the inability to apply the Verilog-A model. For the problem of FPGA simulation, rapid digital controller development and efficient FPGA hardware simulation are achieved.
Patent Information
- Application Number
- CN202410890660.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-01
AI Technical Summary
The existing ADC analog circuit design requires joint simulation of digital circuits and analog circuits during the verification phase, which results in a large time overhead, and the Verilog-A behavioral model cannot be applied to FPGA hardware simulation, making system integration and verification impossible.
Provides a comprehensive ADC analog circuit behavior model and simulation method, uses Verilog-HDL syntax to describe capacitive DACs and comparators, and simulates the state changes of the capacitor bank through conduction switches and three-throw switches to achieve rapid digital controller development and FPGA hardware simulation.
It realizes fast joint simulation, reduces the time node of digital circuit development, and solves the problem that Verilog-A model cannot be comprehensively laid out in FPGA hardware simulation, improving simulation speed and accuracy.
Smart Images

Figure CN118740160A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of analog circuit simulation, and in particular to a behavioral model and a simulation method of a synthesizable ADC analog circuit. Background Art
[0002] The analog-to-digital converter (SARADC) is usually divided into two parts: a sample-and-hold device, a capacitive DAC, and a comparator composed of analog circuits; and a controller composed of digital circuits. When converting an input analog voltage signal to a digital signal, these two circuits need to work together, and there is signal interaction between the two. The sample-and-hold device and the capacitive DAC are composed of a series of weight capacitors and their switches. At each establishment moment, the digital controller changes the open and closed state of the weight capacitor according to the output state of the current analog comparator, thereby re-establishing the state of the holding circuit. After each establishment is completed, the output of the analog comparator may change, and the output state of the analog comparator will affect the next establishment moment, and the digital controller controls the switch of the weight capacitor.
[0003] During the entire SARADC design, the control protocol between the digital circuit and the analog circuit is agreed upon in advance and designed by engineers of different disciplines. In the verification phase, the two circuits need to be jointly simulated, and two methods are generally used:
[0004] (1) Direct mixed simulation of digital circuits and analog circuits can fully verify the logic of digital circuits and the accuracy of analog circuits.
[0005] (2) Use behavioral models for analog circuits: Use Verilog-A language to describe the behavior of the sample-and-hold, capacitive DAC, and comparator, and establish a behavioral model of the analog circuit. Compared with the actual analog circuit, using analog behavioral models to participate in joint simulation reduces the simulation accuracy, but greatly speeds up the simulation speed, and can quickly verify the logic of the digital circuit in the early stage.
[0006] Although direct mixed simulation of digital circuits and analog circuits is complete, it takes a lot of time. In the early stage of design, especially for digital engineers, they only need to focus on logic control and do not need to care about the performance of analog circuits. Therefore, digital design engineers use Verilog-A behavioral models to speed up simulation. However, Verilog-A models cannot be synthesized and cannot be applied to FPGA hardware simulation. Summary of the invention
[0007] The object of the present invention is to provide a synthesizable behavioral model of an ADC analog circuit and a simulation method to solve the problems raised in the above background technology.
[0008] To achieve the above-mentioned object, the present invention provides the following technical solutions: a behavioral model and simulation method of an ADC analog circuit that can be synthesized, comprising a capacitive DAC and a comparator, wherein the output end of the capacitive DAC is set as a Vx end, the Vx end is electrically connected to one of the input ends of the comparator, the other input end of the comparator is electrically connected to a VCM end, and a conduction switch is electrically connected between the Vx end and the VCM end;
[0009] The input ends of the capacitive DAC are respectively provided with a VREF end, an Analog Input end and a GND end, a capacitor group is provided between the VREF end, the Analog Input end and the GND end and the Vx end, and a three-throw switch for controlling the connection object is provided between the capacitor group and the VREF end, the Analog Input end and the GND end.
[0010] Preferably, the capacitor group includes 8Cu capacitors, 4Cu capacitors, 2Cu capacitors, Cu capacitors and Cu capacitors, and a three-throw switch is arranged between the 8Cu capacitors, 4Cu capacitors, 2Cu capacitors, Cu capacitors and Cu capacitors and the VREF terminal, the Analog Input terminal and the GND terminal respectively, and the other ends of the 8Cu capacitors, 4Cu capacitors, 2Cu capacitors, Cu capacitors and Cu capacitors are electrically connected to the Vx terminal.
[0011] Preferably, the output end of the comparator is provided with a Digital Output end, and the output formula of the Digital Output end is expressed as:
[0012] Q = C * V (1);
[0013] Among them, Q represents the amount of charge between two potential points, V represents the voltage between the two potential points, and C represents the capacitance between the two potential points.
[0014] A method for simulating a behavioral model of a synthesizable ADC analog circuit, using the behavioral model, the simulation method comprises the following steps:
[0015] S1, at the sampling moment, the left end of the capacitor group is connected to the Analog Input terminal through a three-throw switch, and the right end is connected to the VCM terminal;
[0016] S2, turn on the conduction switch to disconnect the connection between the Vx terminal and the VCM terminal;
[0017] S3, toggle the three-throw switch to disconnect the left end of the capacitor bank from the Analog Input terminal and connect it to the GND terminal;
[0018] S4, connecting the left end of the capacitor group to the VREF terminal one by one in the order of the capacitance units of the capacitor group from large to small;
[0019] S5, if the newly generated Vx terminal value is greater than the VCM terminal value, the capacitor connected to the VREF terminal in S4 is reconnected to the GND terminal;
[0020] S6, loop S4 and S5, record the output value of the Digital Output terminal of the comparator, and obtain a set of 4-bit sequences, which is the final digital output of the behavior model.
[0021] Preferably, at the S1 sampling time, the total charge amount after all capacitors are charged by the Analog Input terminal is expressed as:
[0022] Q = 16Cu*(VCM-Vin) (2);
[0023] Wherein, Vin represents the input voltage of the Analog Input terminal, VCM represents the voltage of the VCM terminal, and Cu represents the unit capacitance.
[0024] Preferably, when S3 disconnects the capacitor group from the Analog Input terminal, in the process of switching the left end switches of each capacitor, a part of the capacitors are connected between the Vx terminal and the VREF terminal, and another part of the capacitors are connected between the Vx terminal and the GND terminal.
[0025] Preferably, during the process of disconnecting the capacitor group from the Analog Input terminal, the total charge on the capacitor remains unchanged, which is expressed as:
[0026] Q=16Cu*(VCM-Vin)=(Vx-GND)*mCu+(Vx-VREF)*nCu (3);
[0027] Among them, m represents the unit sum of the capacitance connected between the Vx terminal and the GND terminal, and n represents the unit sum of the capacitance connected between the Vx terminal and the VREF terminal.
[0028] Preferably, since the values of Q, VREF, VCM, and GND are fixed, the output voltage of the capacitive DAC is expressed as:
[0029]
[0030] Vx is compared with VCM to determine the output state of the analog comparator.
[0031] Preferably, the connection between the Vx terminal and the VCM terminal in S2 is disconnected, that is, the connection between the right end of the capacitor group and VCM is disconnected.
[0032] Preferably, after the left end of the capacitor group is connected to the VREF end in S4, the distribution of the charge on each capacitor is redistributed, and the output voltage Vx end of the capacitive DAC will change.
[0033] Technical effects and advantages of the present invention:
[0034] (1) This model is easy to implement. It only needs to use the most basic Verilog-HDL syntax to realize the behavioral model of the SARADC analog circuit. In the early stage of digital controller development, it can replace the analog circuit and join the joint simulation. Compared with mixed digital and analog simulation, the time node for joint simulation is greatly advanced. At the same time, because both the digital circuit and the behavioral model are implemented in Verilog-HDL, the simulation speed is greatly improved.
[0035] (2) During the system integration and verification phase, if FPGA hardware simulation is performed, the Verilog-A behavioral model cannot be synthesized and laid out on the FPGA chip. Therefore, the Verilog-HDL behavioral model of this solution is used instead to solve this problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is a schematic diagram of the 4-bit precision SAR ADC model of the present invention.
[0037] Figure 2 This is a schematic diagram of the 4-bit precision SAR ADC sampling and charging of the present invention.
[0038] Figure 3 This is a schematic diagram of the intermediate state of the 4-bit precision SAR ADC of the present invention.
[0039] Figure 4 The figure is a scale weighing simulation diagram showing the basic principle of the analog circuit in the SAR ADC of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] The present invention provides Figure 1A behavioral model of a synthesizable ADC analog circuit shown in the figure includes a capacitive DAC and a comparator, wherein the output terminal of the capacitive DAC is set to a Vx terminal, the Vx terminal is electrically connected to one of the input terminals of the comparator, the other input terminal of the comparator is electrically connected to a VCM terminal, and a conduction switch is electrically connected between the Vx terminal and the VCM terminal;
[0042] The input ends of the capacitive DAC are respectively provided with a VREF end, an Analog Input end and a GND end, a capacitor group is provided between the VREF end, the Analog Input end and the GND end and the Vx end, and a three-throw switch for controlling the connection object is provided between the capacitor group and the VREF end, the Analog Input end and the GND end.
[0043] It should be noted that DAC: Digital Analog Converter, also known as D / A Converter, or DAC for short, is a device that converts digital quantities into analog quantities. The most common digital-to-analog converter converts parallel binary digital quantities into DC voltage or DC current.
[0044] Embodiment 1, as Figure 4 As shown, the implementation principle of the analog circuit in SARADC is similar to that of a weighing scale. As shown in the figure, it is a level with 4-weight accuracy:
[0045] Use 4 weights of 8kg, 4kg, 2kg and 1kg to weigh the target object of 11.8kg. First, place the heavy object on the right side of the scale, and then place the 4 weights one by one on the left side of the scale in order from heavy to light. After placing a weight each time, if the scale is still tilted to the right (heavy on the right), continue to place the next weight; if the scale becomes tilted to the left (heavy on the left), remove the weight just placed before placing the next weight.
[0046] The specific steps are:
[0047] (1) Place the weight on the right side of the balance, and the balance will tilt to the right (the right side is heavier);
[0048] (2) Place the 8kg weight on the left side of the scale, and the scale still tilts to the right (the right side is heavier);
[0049] (3) Place a 4kg weight on the left side of the balance, and the balance will tilt to the left (the left side is heavier).
[0050] (4) Remove the 4kg weight first, and then place the 2kg weight on the left side of the balance. The balance will tilt to the right (the right side is heavier).
[0051] (5) Place a 1kg weight on the left side of the scale. The scale still tilts to the right (the right side is heavier).
[0052] (6) All weights are used up and weighing is completed. The sum of the weights on the left side of the balance is 8+2+1=11kg, which is the measurement result. The actual weight of the target object is 11.8kg, and the difference of 0.8kg is the precision error. Replacing with smaller weights and more weights can reduce the weighing error.
[0053] It should be noted that ADC: Analog-Digital Converter. In order to use digital circuits to process analog signals, the analog signals must be converted into corresponding digital signals before they can be sent to the digital system for processing. Pressure, temperature, sound, etc. are all common analog signals. The device that converts continuously changing analog signals into discrete digital signals is called an analog-to-digital converter.
[0054] SARADC: A type of ADC that uses a feedback comparison circuit structure. A digital value is added to the DAC, and a corresponding output analog voltage is obtained. This analog voltage is compared with the input analog voltage signal. If the two are not equal, the digital value taken is adjusted until the two analog voltages are equal. The final digital value taken is the desired conversion result.
[0055] Specifically, the capacitor group includes 8Cu capacitors, 4Cu capacitors, 2Cu capacitors, Cu capacitors and Cu capacitors, and a three-throw switch is arranged between the 8Cu capacitors, 4Cu capacitors, 2Cu capacitors, Cu capacitors and Cu capacitors and the VREF terminal, the Analog Input terminal and the GND terminal respectively, and the other ends of the 8Cu capacitors, 4Cu capacitors, 2Cu capacitors, Cu capacitors and Cu capacitors are electrically connected to the Vx terminal.
[0056] It should be noted that the meanings of the ports in the behavior model are shown in Table 1 below:
[0057]
[0058] Table 1
[0059] Furthermore, the output end of the comparator is provided with a Digital Output end, and the output formula of the Digital Output end is expressed as:
[0060] Q = C * V (1);
[0061] Among them, Q represents the amount of charge between two potential points, V represents the voltage between the two potential points, and C represents the capacitance between the two potential points.
[0062] A method for simulating a behavioral model of a synthesizable ADC analog circuit adopts the above-mentioned behavioral model. The simulation method comprises the following steps:
[0063] S1, at the sampling moment, the left end of the capacitor group is connected to the Analog Input terminal through a three-throw switch, and the right end is connected to the VCM terminal;
[0064] Specifically, Figure 2 As shown in the figure, at the S1 sampling moment, the total charge after all capacitors are charged by the Analog Input terminal is expressed as:
[0065] Q = 16Cu*(VCM-Vin) (2);
[0066] Wherein, Vin represents the input voltage of the Analog Input terminal, VCM represents the voltage of the VCM terminal, and Cu represents the unit capacitance.
[0067] S2, turn on the conduction switch to disconnect the connection between the Vx terminal and the VCM terminal;
[0068] Specifically, the connection between the Vx terminal and the VCM terminal in S2 is disconnected, that is, the connection between the right end of the capacitor group and VCM is disconnected.
[0069] S3, toggle the three-throw switch to disconnect the left end of the capacitor bank from the Analog Input terminal and connect it to the GND terminal;
[0070] Specifically, Figure 3 As shown, when S3 disconnects the capacitor group from the Analog Input terminal, in the process of switching the switches at the left ends of the capacitors, some of the capacitors are connected between the Vx terminal and the VREF terminal, and the other capacitors are connected between the Vx terminal and the GND terminal.
[0071] Furthermore, when the capacitor group is disconnected from the Analog Input terminal, the total charge on the capacitor remains unchanged, which is expressed as:
[0072] Q=16Cu*(VCM-Vin)=(Vx-GND)*mCu+(Vx-VREF)*nCu (3);
[0073] Among them, m represents the unit sum of the capacitance connected between the Vx terminal and the GND terminal, and n represents the unit sum of the capacitance connected between the Vx terminal and the VREF terminal.
[0074] Furthermore, since the values of Q, VREF, VCM, and GND are fixed, the output voltage of the capacitive DAC is expressed as:
[0075]
[0076] Vx is compared with VCM to determine the output state of the analog comparator.
[0077] S4, connecting the left end of the capacitor group to the VREF terminal one by one in the order of the capacitance units of the capacitor group from large to small;
[0078] Specifically, after the left end of the capacitor group is connected to the VREF end in S4, the distribution of the charge on each capacitor is redistributed, and the output voltage Vx end of the capacitive DAC will change.
[0079] S5, if the newly generated Vx terminal value is greater than the VCM terminal value, the capacitor connected to the VREF terminal in S4 is reconnected to the GND terminal;
[0080] S6, loop S4 and S5, record the output value of the Digital Output terminal of the comparator, and obtain a set of 4-bit sequences, which is the final digital output of the behavior model.
[0081] It should be noted that the Verilog-HDL behavioral model implements:
[0082] According to the above principles, the behavior model needs to implement the following functions (sub-models):
[0083] (1) Describe the capacitor model and determine the weight coefficient of each capacitor;
[0084] (2) Describe the sample-and-hold circuit model and calculate the total charge Q during the sampling phase (charging);
[0085] (3) Describe the capacitive DAC model and calculate the output voltage Vx of the capacitive DAC based on the capacitor switch state and the total charge;
[0086] (4) Describe the analog comparator model, perform numerical comparison on the current Vx and VCM, and output the comparison result.
[0087] Capacitor model:
[0088] It consists of two parts: weight coefficient and switch state.
[0089] The smallest capacitor is used as the unit capacitor, and the weight coefficient is 1. The weight coefficients of the remaining capacitors are the ratio of the capacitor to the smallest capacitor. There are non-integer multiples (the ratio has a decimal part), and considering the capacitor error, it is necessary to add the error (decimal part) to the ideal weight coefficient. Therefore, weight[4:0][16:0] is used to describe the capacitor weight, where the upper 8 bits are the integer part and the lower 8 bits are the decimal part. The capacitor model of the 4-bit precision SAR ADC is:
[0090] weignt={16'H0800,16'H0400,16'h0200,16'h0100,16'h0100,}(5);
[0091] The switch state of each capacitor is controlled by the 2-bit signal swtch[1:0], and the state is shown in Table 2 below:
[0092]
[0093] Table 2
[0094] Sample-and-Hold Model:
[0095] The output signal of the digital controller controls the behavioral model to enter the sampling and holding phase. At this time, according to Formula 2, the behavioral model calculates the total charge Q after the sampling is completed.
[0096] Capacitive DAC Model:
[0097] The output signal of the digital controller will control the state of each capacitor switch in the behavioral model at the next moment according to the comparator output of the behavioral model at the previous moment. Then, according to the current switch state, the behavioral model will calculate the output voltage Vx of the current capacitive DAC according to Formula 4. A divider is needed here.
[0098] Analog comparator model:
[0099] Compare Vx and VCM and output the comparison result. If Vx is greater than VCM, output 1; otherwise, output 0.
[0100] It should be noted that Verilog-A: A modular hardware description language that describes the structure, behavior, and characteristic parameters of analog circuit systems and analog circuit units. It can also be used to describe traditional signal systems such as solid mechanics, fluid mechanics, thermodynamics, and other systems.
[0101] FPGA hardware simulation: The behavior model described in hardware description language (RTL) is transplanted to field programmable gate array (FPGA) to verify the function. After the basic function of the chip is verified, the driver development can begin.
[0102] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A synthesizable behavioral model of an ADC analog circuit, characterized in that: It includes a capacitive DAC and a comparator, wherein the output end of the capacitive DAC is set to a Vx end, the Vx end is electrically connected to one of the input ends of the comparator, the other input end of the comparator is electrically connected to a VCM end, and a conduction switch is electrically connected between the Vx end and the VCM end; The input ends of the capacitive DAC are respectively provided with a VREF end, an Analog Input end and a GND end, a capacitor group is provided between the VREF end, the Analog Input end and the GND end and the Vx end, and a three-throw switch for controlling the connection object is provided between the capacitor group and the VREF end, the Analog Input end and the GND end.
2. The behavioral model of a synthesizable ADC analog circuit according to claim 1, characterized in that: The capacitor group includes 8Cu capacitors, 4Cu capacitors, 2Cu capacitors, Cu capacitors and Cu capacitors, and three-throw switches are respectively arranged between the 8Cu capacitors, 4Cu capacitors, 2Cu capacitors, Cu capacitors and Cu capacitors and the VREF terminal, the Analog Input terminal and the GND terminal, and the other ends of the 8Cu capacitors, 4Cu capacitors, 2Cu capacitors, Cu capacitors and Cu capacitors are electrically connected to the Vx terminal.
3. The behavioral model of a synthesizable ADC analog circuit according to claim 1, characterized in that: The output end of the comparator is provided with a Digital Output end, and the output formula of the Digital Output end is expressed as: Q = C * V (1); Among them, Q represents the amount of charge between two potential points, V represents the voltage between the two potential points, and C represents the capacitance between the two potential points.
4. A method for simulating a behavioral model of a synthesizable ADC analog circuit, using the behavioral model described in any one of claims 1 to 3, characterized in that: The simulation method comprises the following steps: S1, at the sampling moment, the left end of the capacitor group is connected to the Analog Input terminal through a three-throw switch, and the right end is connected to the VCM terminal; S2, turn on the conduction switch to disconnect the connection between the Vx terminal and the VCM terminal; S3, toggle the three-throw switch to disconnect the left end of the capacitor bank from the Analog Input terminal and connect it to the GND terminal; S4, connecting the left end of the capacitor group to the VREF terminal one by one in the order of the capacitance units of the capacitor group from large to small; S5, if the newly generated Vx value is greater than the VCM value, reconnect the capacitor connected to the VREF terminal in S4 back to the GND terminal; S6, loop S4 and S5, record the output value of the DigitalOutput terminal of the comparator, and obtain a set of 4-bit sequences, which is the final digital output of the behavior model.
5. The method for simulating a behavioral model of a synthesizable ADC analog circuit according to claim 4, characterized in that: At the S1 sampling moment, the total charge after all capacitors are charged by the Analog Input terminal is expressed as: Q = 16Cu*(VCM-Vin) (2); Wherein, Vin represents the input voltage of the Analog Input terminal, VCM represents the voltage of the VCM terminal, and Cu is the unit capacitance.
6. The method for simulating a behavioral model of a synthesizable ADC analog circuit according to claim 4, characterized in that: When S3 disconnects the capacitor group from the Analog Input terminal, in the process of switching the switches at the left ends of the capacitors, a part of the capacitors are connected between the Vx terminal and the VREF terminal, and another part of the capacitors are connected between the Vx terminal and the GND terminal.
7. The method for simulating a behavioral model of a synthesizable ADC analog circuit according to claim 6, characterized in that: During the process of disconnecting the capacitor group from the Analog Input terminal, the total charge on the capacitor remains unchanged, which is expressed as: Q=16Cu*(VCM-Vin)=(Vx-GND)*mCu+(Vx-VREF)*nCu (3); Among them, m represents the unit sum of the capacitance connected between the Vx terminal and the GND terminal, and n represents the unit sum of the capacitance connected between the Vx terminal and the VREF terminal.
8. The method for simulating a behavioral model of a synthesizable ADC analog circuit according to claim 7, characterized in that: Since the values of Q, VREF, VCM, and GND are fixed, the output voltage of the capacitive DAC is expressed as: Vx is compared with VCM to determine the output state of the analog comparator.
9. The method for simulating a behavioral model of a synthesizable ADC analog circuit according to claim 4, characterized in that: The connection between the Vx terminal and the VCM terminal in S2 is disconnected, that is, the connection between the right end of the capacitor group and VCM is disconnected.
10. The method for simulating a behavioral model of a synthesizable ADC analog circuit according to claim 4, characterized in that: After the left end of the capacitor group is connected to the VREF end in S4, the distribution of the charge on each capacitor is redistributed, and the output voltage Vx end of the capacitive DAC will change.
