Analog Modeling Using Event-Driven HDLs
Analog Modeling Using Event-Driven HDLs
Authorized licensed use limited to: VIT University. Downloaded on August 03,2022 at 06:45:00 UTC from IEEE Xplore. Restrictions apply.
By using standard transformation techniques such Anabg values can be represenred as 64-bit rtals in
as the bilinear transformation, differential equafim can be Verilog. Verilog tasLs $bitsmeal and Srealtotrits [Ref [211
transformed into difference equations which can be modeled allow the uansf-011 between the bit and real
in an event-driven HDL. Delay elements can be used to reprcscncations. Rcal values can be passed through the
describe Z-domain discrete systems. An example is the terminals of a Verilog module in @-bit f m . Verilog
transfer characteristic of a DSP filter (shown in Figure 1) supports a basic set of arithmetic operators: *, /, +, -.
which can be represented in an event-driven simulator. 'Ikigonomeak and transce&mi functions (such as an
exponential function which is used in the AGC) can be
linked in through PLI Wef [l]]. We will explore some
lgure 1.DSP Filter models which use these system tasks.
64
Authorized licensed use limited to: VIT University. Downloaded on August 03,2022 at 06:45:00 UTC from IEEE Xplore. Restrictions apply.
Fig 4. ADC Verilog Behavioral model
'timescale Ins / Ins
'define N 16 /* Number of bits of the ADC */
'define N1 15
module adc( startconv, clk, eoc, Vin-bits, Vin-d-bits,
Vin-t-bits,Vref-bits, Dout ) ;
input startconv, clk, Vin-bits, Vin-d-bits, Vin-t-bits,
Vref-bits; output Dout, eoc;
wire [63:01 Vin-bits, Vin-d-bits, Vin-t-bits;
wire [63:01 Vref-bits; reg ['Nl:O] Dout; reg eoc;
real Vin, Vin-d, vin-t, Vsample, Vref, Vdac, Vbit;
integer i;
reg ['N1:0] bit; reg ['N1:0] fullscale;
initial begin
eoc = 1; Dout= 'N'bO;
end
always @ (negedge startConv) ADconversion;
always @ (posedge startconv) begin
disable ADconversion; eoc = 1;
end
task ADconversion; begin
eoc = 1; Dout= 'N'bO; fullscale= 'bo;
fullscale= -fullscale ;
Vin = $bitstoreal( Vin-bits ) ;
Vin-d = $bitstoreal( Vin-d-bits ) ;
Vin-t = $bitstoreal( Vin-t-bits ) ;
// find the value of Vin corresponding to current time.
Vsample = Vin + Vin-d * ($time - Vin-t);
Vref = $bitstoreal( Vref-bits ) ;
Vdac = 0.0; bit = 'N'bl << ("1); i = 'NI;
repeat (IN) begin
@ (negedge clk) W i t = (bit*Vref)/fullScale;
Vdac= Vdac + Vbit;
if (Vdac >= Vsample) begin DoutCi] = l'bO;
Vdac = Vdac - Vbit;
end else Dout[i] = 1,bl;
bit = bit >> 1; i = i - 1;
end
@ (negedge clk) eoc = 0;
end
endtask
endmodule
66
Authorized licensed use limited to: VIT University. Downloaded on August 03,2022 at 06:45:00 UTC from IEEE Xplore. Restrictions apply.
llag to 1 Bt the end of convasion.The input vdrage to the 2.7.1 Simulation results
ADC is qrcscnted as a piecewise Linear wavefam as
disc& earlier. Thatfore, besides the value of the input The comet functioning of h e circuit has been
voltage (vin-bits). its slope (vin-d-bits) and the spmple time successfully vaified with specs-verilog. The circuit was
point (vin-t-bits) are input to the block. If a piecewise simulated with a 300 Hz sinewave input over 3OOmS with a
coastantrpproximariwr is used as forvref-b& the s b p e a d clock rate of 1 Mhz.The total simulation time was about IS
thesnmpbpointaremnquired. mins on a Sparc IPX with 32Meg memory. A Specm
simulation of the circuit at the transistor level would have
2.6 Mixed-signalsimuLtion taka days and Couldonly have been dm afterall the blocLs
inthecircUithadbeeni"ented
In the Specmz-Wog mixed-signal solution.
analog signals can cross simulator boundaim such that
analogbehpviaal models inverilogcanbe used in amixed-
~collext
In a c b s s i d mixai-signal simu&or, aaabg
fmmhu~~mnlrlal macimitsimulamrandtb di&d
f"B in a digital simahax. At the intafaar barrrm
malogrd d i g w a2d (aaslog to dilptal) o r a (digital m
mrbe) e"BIC used a2d canvatj an anrbg
into a single-bit logic MLue: 0, 1, or X based on a
thshoMhg limcaon. d2a convem a single bit bgtc vaiue
into an anaiog signal (voltage or current) using a ramp
function
1 - 1 - l I I
Authorized licensed use limited to: VIT University. Downloaded on August 03,2022 at 06:45:00 UTC from IEEE Xplore. Restrictions apply.