The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 28th, 2024, 2:38am
Pages: 1
Send Topic Print
$freq while using AC analysis to access lookup table (Read 40 times)
Nik21
New Member
*
Offline



Posts: 3

$freq while using AC analysis to access lookup table
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
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: $freq while using AC analysis to access lookup table
Reply #1 - 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
Back to top
 
 
View Profile WWW   IP Logged
Nik21
New Member
*
Offline



Posts: 3

Re: $freq while using AC analysis to access lookup table
Reply #2 - 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
Back to top
 
« Last Edit: Nov 21st, 2019, 4:47am by Nik21 »  
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.