pancho_hideboo
Advanced Member level 5
- Joined
- Oct 21, 2006
- Messages
- 2,847
- Helped
- 767
- Reputation
- 1,536
- Reaction score
- 733
- Trophy points
- 1,393
- Location
- Real Homeless
- Activity points
- 17,490
We can evaluate frequency characteristics of z-domain transfer function, H(z) by using Verilog-A in Cadence Spectre.
Assume H(z) = (1-z^-1)^3 = 1 -3*z^-1 +3*z^-2 -1*z^-3
Here we have three options as expression in Verilog-A.
(1) zi_nd(V(Input), {1, -3, 3, -1}, {1}, Tsample);
(2) zi_zp(V(Input), {1,0, 1,0, 1,0}, {0,0}, Tsample);
(3) zi_zd(V(Input), {1,0, 1,0, 1,0}, {1}, Tsample);
However, only (1) can give accurate result.
See attached figure.
out1 is a result of Spectre primitive, zvcvs.
out2 is a result of (2).
Why can not (2) and (3) give accurate result ?
This is true for H(z) = (1-z^-1)^1 = 1 -1*z^-3
(1) zi_nd(V(Input), {1, -1}, {1}, Tsample);
(2) zi_zp(V(Input), {1,0}, {0,0}, Tsample);
(3) zi_zd(V(Input), {1,0}, {1}, Tsample);
My Cadence Spectre is Version 17.1.0.307.isr6 64bit -- 4 Jul 2018
"test_my_zi_nd.scs"
"my_zi_nd.va"
Assume H(z) = (1-z^-1)^3 = 1 -3*z^-1 +3*z^-2 -1*z^-3
Here we have three options as expression in Verilog-A.
(1) zi_nd(V(Input), {1, -3, 3, -1}, {1}, Tsample);
(2) zi_zp(V(Input), {1,0, 1,0, 1,0}, {0,0}, Tsample);
(3) zi_zd(V(Input), {1,0, 1,0, 1,0}, {1}, Tsample);
However, only (1) can give accurate result.
See attached figure.
out1 is a result of Spectre primitive, zvcvs.
out2 is a result of (2).
Why can not (2) and (3) give accurate result ?
This is true for H(z) = (1-z^-1)^1 = 1 -1*z^-3
(1) zi_nd(V(Input), {1, -1}, {1}, Tsample);
(2) zi_zp(V(Input), {1,0}, {0,0}, Tsample);
(3) zi_zd(V(Input), {1,0}, {1}, Tsample);
My Cadence Spectre is Version 17.1.0.307.isr6 64bit -- 4 Jul 2018
"test_my_zi_nd.scs"
Code:
ahdl_include "./my_zi_nd.va"
// Generated for: spectre
// Generated on: May 16 13:01:03 2019
// Design library name: My_Tools_TestBenches
// Design cell name: test_my_zi_nd
// Design view name: schematic
simulator lang=spectre
global 0
parameters fsample=36M
// Library name: My_Tools_TestBenches
// Cell name: test_my_zi_nd
// View name: schematic
V1 (net1 0) vsource mag=1 type=dc
E1 (out1 0 net1 0) zvcvs ts=1/fsample gain=1.0 \
polyarg=inversez sxz=none \
numer=[ 1 -3 3 -1 ] denom=[ 1 0 0 0 ]
V2 (net2 0) vsource mag=1 type=dc
I2 (net2 out2) my_zi_nd fsample=fsample
simulatorOptions options psfversion="1.1.0" reltol=1e-3 vabstol=1e-6 \
iabstol=1e-12 temp=25.0 tnom=27 scalem=1.0 scale=1.0 gmin=1e-12 \
rforce=1 maxnotes=5 maxwarns=5 digits=5 cols=80 pivrel=1e-3 \
sensfile="../psf/sens.output" checklimitdest=psf
ac ac start=1k stop=100M dec=101 annotate=status
designParamVals info what=parameters where=rawfile
saveOptions options save=allpub
"my_zi_nd.va"
Code:
`include "constants.vams"
`include "disciplines.vams"
module my_zi_nd(Input, Output);
inout Input, Output;
voltage Input, Output;
parameter real fsample = 1.0 from (0.0:inf);
voltage order_3;
real Tsample;
analog begin
@(initial_step) begin
Tsample = 1.0 / fsample;
end //initial_step
//H(z) = (1-z^-1)^3 = 1 -3*z^-1 +3*z^-2 -1*z^-3
//V(order_3) <+ zi_nd(V(Input), {1, -3, 3, -1}, {1}, Tsample);
V(order_3) <+ zi_zp(V(Input), {1,0, 1,0, 1,0}, {0,0}, Tsample);
//V(order_3) <+ zi_zd(V(Input), {1,0, 1,0, 1,0}, {1}, Tsample);
V(Output) <+ V(order_3);
end //analog
endmodule