+ Post New Thread
Results 1 to 13 of 13
-
19th November 2019, 17:19 #1
- Join Date
- Jan 2017
- Posts
- 97
- Helped
- 1 / 1
- Points
- 943
- Level
- 6
$freq while using AC analysis to access lookup table
Hello all,
I have saved in a table the response of a filter. The table contains 2 columns; the first contains the frequency and the second the corresponding magnitude.
I am building a model that will instantly "read" the value of the frequency during an AC analysis and using that value will find the corresponding magnitude through the table.
My thought was using something like $table_model( $freq, "table_link.dat") and assigning that value to the output, but it doesnt seem to work. Actually it seems like the only value of frequency is 0Hz.
Any ideas?
Thank you in advance
-
20th November 2019, 00:05 #2
- Join Date
- Jan 2008
- Location
- Bochum, Germany
- Posts
- 45,764
- Helped
- 13912 / 13912
- Points
- 261,871
- Level
- 100
Re: $freq while using AC analysis to access lookup table
Forgot to mention the circuit analysis tool.
-
20th November 2019, 00:59 #3
- Join Date
- Oct 2006
- Location
- Real Homeless
- Posts
- 2,681
- Helped
- 724 / 724
- Points
- 17,409
- Level
- 31
Re: $freq while using AC analysis to access lookup table
If you mean Verilog-A, $freq is not available in Verilog-A.
https://www.edaboard.com/showthread.php?373837#6
-
Advertisement
-
20th November 2019, 08:41 #4
- Join Date
- Jan 2017
- Posts
- 97
- Helped
- 1 / 1
- Points
- 943
- Level
- 6
Re: $freq while using AC analysis to access lookup table
Last edited by NikosTS; 20th November 2019 at 08:51.
-
20th November 2019, 10:24 #5
- Join Date
- Oct 2006
- Location
- Real Homeless
- Posts
- 2,681
- Helped
- 724 / 724
- Points
- 17,409
- Level
- 31
Re: $freq while using AC analysis to access lookup table
Use spectre primitive, nport.
If you use Keysight ADSsim, use DAC(Data Access Component).
https://www.edaboard.com/showthread.php?364412/page2#23Last edited by pancho_hideboo; 20th November 2019 at 10:31.
1 members found this post helpful.
-
20th November 2019, 11:42 #6
- Join Date
- Jan 2017
- Posts
- 97
- Helped
- 1 / 1
- Points
- 943
- Level
- 6
Re: $freq while using AC analysis to access lookup table
-
Advertisement
-
21st November 2019, 11:32 #7
- Join Date
- Oct 2006
- Location
- Real Homeless
- Posts
- 2,681
- Helped
- 724 / 724
- Points
- 17,409
- Level
- 31
Re: $freq while using AC analysis to access lookup table
If you insist on Verilog-A, instantiate spectre’s primitive nport in Verilog-A.
https://designers-guide.org/forum/Ya...m=1574240440#2
Other possibility is “deriv(ac_stim(1))/(M_TWO_PI)”.
I don’t know whether it works as independent variable for table_model().
1 members found this post helpful.
-
21st November 2019, 11:41 #8
- Join Date
- Jan 2017
- Posts
- 97
- Helped
- 1 / 1
- Points
- 943
- Level
- 6
Re: $freq while using AC analysis to access lookup table
Hello and thank you for the reply.
Instantiating the nport in VerilogA seems like a very good way to get the response I want. However, I can only connect the ports by order and not by name.
Specifically:
I want to instantiate an nport with 2 ports and NO common reference. The instance will have 4 pins : p1,m1,p2,m2 (at least in schematic editor ).
My VerilogA model has 4 pins also : INP,INN,OP,ON and I want to connect port (p1 with INP) , (m1 with INN) , (p2 with OP), (m2 with ON).
My code works and simulates correctly when I instantiate the nport as :
nport #(params) NPORT0(INP,INN,OP,ON )
but produces an error when I try to instantiate it as:
nport #(params) NPORT0(.p1(INP),.m1(INN),.p2(OP),.m2(ON) ) .
Any ideas on this?
-
21st November 2019, 12:11 #9
- Join Date
- Oct 2006
- Location
- Real Homeless
- Posts
- 2,681
- Helped
- 724 / 724
- Points
- 17,409
- Level
- 31
Re: $freq while using AC analysis to access lookup table
Compare CDF parameter and spectre -h nport.
Or simply use gnd node in Verilog-A.
Ground node declaration.Last edited by pancho_hideboo; 21st November 2019 at 12:30.
1 members found this post helpful.
-
21st November 2019, 12:54 #10
- Join Date
- Jan 2017
- Posts
- 97
- Helped
- 1 / 1
- Points
- 943
- Level
- 6
Re: $freq while using AC analysis to access lookup table
-
22nd November 2019, 10:17 #11
- Join Date
- Oct 2006
- Location
- Real Homeless
- Posts
- 2,681
- Helped
- 724 / 724
- Points
- 17,409
- Level
- 31
Re: $freq while using AC analysis to access lookup table
Code:`include "constants.vams" `include "disciplines.vams" module my_freq(out); output out; voltage out; electrical gnd; ground gnd; voltage hoge; analog begin V(hoge) <+ ac_stim(); V(out) <+ abs( ddt( V(hoge) ) ) / `M_TWO_PI; end //analog endmodule
You can get analysis frequency value in Verilog-A.
Also I showed gnd node definition in Verilog-A.
nport #(params) NPORT0(.t1(INP),.b1(gnd),.t2(OP),.b2(gnd) )Last edited by pancho_hideboo; 22nd November 2019 at 10:34.
1 members found this post helpful.
-
25th November 2019, 17:07 #12
- Join Date
- Oct 2006
- Location
- Real Homeless
- Posts
- 2,681
- Helped
- 724 / 724
- Points
- 17,409
- Level
- 31
Re: $freq while using AC analysis to access lookup table
Correction.
Code:`include "constants.vams" `include "disciplines.vams" module my_freq(out); output out; voltage out; electrical gnd; ground gnd; voltage aho, boke; analog begin V(aho) <+ ac_stim(); V(boke) <+ ddt( V(aho) ) / `M_TWO_PI; V(out) <+ abs( V(boke) ); end //analog endmodule
-
Advertisement
-
25th November 2019, 17:13 #13
- Join Date
- Jan 2017
- Posts
- 97
- Helped
- 1 / 1
- Points
- 943
- Level
- 6
+ Post New Thread
Please login