The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> $freq while using AC analysis to access lookup table
https://designers-guide.org/forum/YaBB.pl?num=1574240440

Message started by Nik21 on Nov 20th, 2019, 1:00am

Title: $freq while using AC analysis to access lookup table
Post by Nik21 on Nov 20th, 2019, 1:00am

Hello everyone,
I am trying to model a filter using VerilogA. In order to do that, I simulate the actual design ( schematic ) using AC analysis and save the response of the filter.
The table contains 2 columns; the first contains the frequency and the second the corresponding magnitude.
I want the model to 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.
My simulator is Spectre.
Any ideas?

Thank you in advance,
Nikos

Title: Re: $freq while using AC analysis to access lookup table
Post by Ken Kundert on Nov 20th, 2019, 9:41am

You would have to save the response of your circuit as S-parameters (which you could do with an SP analysis) and then read the S-parameter file back into Spectre using a nport.

-Ken

Title: Re: $freq while using AC analysis to access lookup table
Post by Nik21 on Nov 21st, 2019, 12:04am


Ken Kundert wrote on Nov 20th, 2019, 9:41am:
You would have to save the response of your circuit as S-parameters (which you could do with an SP analysis) and then read the S-parameter file back into Spectre using a nport.

-Ken


Hello Ken,
Thank you for the reply. Would it be possible to instantiate an nport (as I would do with a module) in my behavioral code? Or it is mandatory to be added standalone in the schematic editor?

Thank you in advance

Update : I managed to instantiate it in my VerilogA code but it seems like  i cant connect the ports of nport by name ( e.g .p1(INP), .m1(INN) where INP,INN are the pins of the model and p1,m1 should be the ports of the nport primitive).

Update2 : For anyone interested, the corresponding port names when instantiating an nport are : t1,t2,t3.... for p1,p2,p3.. ports of schematic symbol and b1,b2,b3.... for m1,m2,m3

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.