The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 4:15pm
Pages: 1 2 
Send Topic Print
Simulator gives error if parameters are changed (Read 15365 times)
JussiS
New Member
*
Offline



Posts: 9
Scandinavia
Simulator gives error if parameters are changed
Feb 09th, 2011, 4:00am
 
Has anyone else encountered a problem where the simulator (Cadence AMS) gives an error, if you change any of the parameters in a component from the schematic properties-view?

The error it gives is:


ncelab: *E,CUBSPA (./ihnl/Buck_vcm/Buck_voltage/schematic/verilog.vams,26||44): Assigment of string to real or integer type parameter.

The code is:

/Verilog-AMS HDL for "Buck_vcm", "Compensator" "verilogams"


`include "constants.vams"
`include "disciplines.vams"


module Compensator ( Vref, Vin, Vout);


input Vref, Vin;

output Vout;


parameter real Pole_a = 10;

parameter real Pole_b = 100e4;

parameter real Pole_c = 100e5;

parameter real Zero_a = 1000;

parameter real Zero_b = 20e3;


parameter real Gain_dB=20;


real PI=3.14159265;

real Poles[0:5];

real Zeros[0:3];

real Gain;






electrical Vin, Vref, Vout;

 
 analog begin



  Gain = pow(10,(Gain_dB/20));


  Poles[0] = -2*PI*Pole_a;

  Poles[1] = 0;

  Poles[2] = -2*PI*Pole_b;

  Poles[3] = 0;

  Poles[4] = -2*PI*Pole_c;

  Poles[5] = 0;

 Zeros[0] = -2*PI*Zero_a;

  Zeros[1] = 0;

  Zeros[2] = -2*PI*Zero_b;

  Zeros[3] = 0;

  V(Vout) <+ Gain*laplace_zp(V(Vref,Vin),Zeros,Poles);


 end



endmodule

If I don't touch the properties, the simulation is completed normally.
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Simulator gives error if parameters are changed
Reply #1 - Feb 9th, 2011, 9:12am
 
Seems like a problem with the netlisting code -- I bet, when you specify a parameter, you get
 Pole_a = "10"
instead of
 Pole_a = 10
on the instance line.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
JussiS
New Member
*
Offline



Posts: 9
Scandinavia
Re: Simulator gives error if parameters are changed
Reply #2 - Feb 9th, 2011, 9:38pm
 
So it would be bug in software itself?

How should one go about fixing the issue?
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Simulator gives error if parameters are changed
Reply #3 - Feb 11th, 2011, 4:06am
 
You might need to look into the CDF parameters that you defined for the symbol; I'll bet you have valueType "string" instead of valueType "int"

Did you create the symbol?  If not, you may need help from the person who did.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
JussiS
New Member
*
Offline



Posts: 9
Scandinavia
Re: Simulator gives error if parameters are changed
Reply #4 - Feb 11th, 2011, 5:39am
 
Geoffrey_Coram wrote on Feb 11th, 2011, 4:06am:
You might need to look into the CDF parameters that you defined for the symbol; I'll bet you have valueType "string" instead of valueType "int"

Did you create the symbol?  If not, you may need help from the person who did.


Yes, I created the symbol myself and was not aware that I have to define the CDF parameters outside of the verilog-ams code.

In the code the are defined: "parameter real nameofparameter".

Or then I'm 'missing' something here. Could you please elaborate on the subject of the CDF parameters?

Thanks for the info so far.

Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: Simulator gives error if parameters are changed
Reply #5 - Feb 12th, 2011, 3:13pm
 
Please enter in the CIW:

cdfDump("Buck_vcm" "Compensator.cdf" ?cellName "Compensator")

and then post the contents of the file Compensator.cdf here.

Best Regards,

Andrew.
Back to top
 
 
View Profile WWW   IP Logged
JussiS
New Member
*
Offline



Posts: 9
Scandinavia
Re: Simulator gives error if parameters are changed
Reply #6 - Feb 13th, 2011, 11:04pm
 
Here you go:


/****************************************************/
LIBRARY = "Buck_vcm"
CELL    = "Compensator"
/****************************************************/

let( ( libId cellId cdfId )
   unless( cellId = ddGetObj( LIBRARY CELL )
       error( "Could not get cell %s." CELL )
   )
   when( cdfId = cdfGetBaseCellCDF( cellId )
       cdfDeleteCDF( cdfId )
   )
   cdfId  = cdfCreateBaseCellCDF( cellId )

   ;;; Parameters
   cdfCreateParam( cdfId
       ?name           "Pole3"
       ?prompt         "Pole3"
       ?defValue       "1e+07"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Pole3)"
       ?parseAsNumber  "yes"
       ?parseAsCEL     "yes"
   )
   cdfCreateParam( cdfId
       ?name           "Gain"
       ?prompt         "Gain"
       ?defValue       "0"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Gain)"
   )
   cdfCreateParam( cdfId
       ?name           "Pole1"
       ?prompt         "Pole1"
       ?defValue       "10"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Pole1)"
   )
   cdfCreateParam( cdfId
       ?name           "Zero1"
       ?prompt         "Zero1"
       ?defValue       "100"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Zero1)"
   )
   cdfCreateParam( cdfId
       ?name           "Pole2"
       ?prompt         "Pole2"
       ?defValue       "100"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Pole2)"
   )
   cdfCreateParam( cdfId
       ?name           "Zero2"
       ?prompt         "Zero2"
       ?defValue       "1"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Zero2)"
   )
   cdfCreateParam( cdfId
       ?name           "Pole"
       ?prompt         "Pole"
       ?defValue       "10"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Pole)"
       ?parseAsNumber  "yes"
       ?parseAsCEL     "yes"
   )
   cdfCreateParam( cdfId
       ?name           "Pole_b"
       ?prompt         "Pole_b"
       ?defValue       "7.9477e+06"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Pole_b)"
   )
   cdfCreateParam( cdfId
       ?name           "Pole_c"
       ?prompt         "Pole_c"
       ?defValue       "2e+12"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Pole_c)"
   )
   cdfCreateParam( cdfId
       ?name           "Zero_a"
       ?prompt         "Zero_a"
       ?defValue       "0.1"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Zero_a)"
   )
   cdfCreateParam( cdfId
       ?name           "Zero_b"
       ?prompt         "Zero_b"
       ?defValue       "794770"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Zero_b)"
   )
   cdfCreateParam( cdfId
       ?name           "Pole_a"
       ?prompt         "Pole_a"
       ?defValue       "1e-05"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Pole_a)"
   )
   cdfCreateParam( cdfId
       ?name           "Gain_dB"
       ?prompt         "Gain_dB"
       ?defValue       "0"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Gain_dB)"
   )

   ;;; Properties
   cdfId->formInitProc            = ""
   cdfId->doneProc                = ""
   cdfId->buttonFieldWidth        = 340
   cdfId->fieldHeight             = 35
   cdfId->fieldWidth              = 350
   cdfId->promptWidth             = 175
   cdfId->viewInfo                = '(nil verilogams (nil moduleName "Compensator" namePrefix "ahdl"
termOrder (Vref Vin Vout) parameterList (Pole_a Pole_b Pole_c Zero_a Zero_b
   Gain_dB
)
)
)
   cdfSaveCDF( cdfId )
)
Back to top
 
 
View Profile   IP Logged
JussiS
New Member
*
Offline



Posts: 9
Scandinavia
Re: Simulator gives error if parameters are changed
Reply #7 - Feb 13th, 2011, 11:05pm
 
And I'm guessing the problem is:

cdfCreateParam( cdfId
      ?name           "Pole3"
      ?prompt         "Pole3"
      ?defValue       "1e+07"
      ?type           "string"    <-Right there??

-Jussi
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Simulator gives error if parameters are changed
Reply #8 - Feb 14th, 2011, 5:59am
 
JussiS wrote on Feb 11th, 2011, 5:39am:
Yes, I created the symbol myself and was not aware that I have to define the CDF parameters outside of the verilog-ams code.


How did you create the symbol?  Did you use "create cellview from cellview" or something?  (I've never made a symbol for a Verilog-AMS module myself.)  I would think that, if the CDF parameters for the symbol were automatically generated from the .vams file, then they should have the right data type.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Simulator gives error if parameters are changed
Reply #9 - Feb 14th, 2011, 6:21am
 
JussiS wrote on Feb 13th, 2011, 11:05pm:
And I'm guessing the problem is:

cdfCreateParam( cdfId
      ?name           "Pole3"
      ?prompt         "Pole3"
      ?defValue       "1e+07"
      ?type           "string"    <-Right there??

-Jussi


Yep.  Also the defValue is "1e+07" (a string) rather than 1+e07 (a floating-point number).

Perhaps Andrew can tell you how to load the cdf back in, after you change all those "string" to "real"
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
JussiS
New Member
*
Offline



Posts: 9
Scandinavia
Re: Simulator gives error if parameters are changed
Reply #10 - Feb 15th, 2011, 4:19am
 
Geoffrey_Coram wrote on Feb 14th, 2011, 5:59am:
JussiS wrote on Feb 11th, 2011, 5:39am:
Yes, I created the symbol myself and was not aware that I have to define the CDF parameters outside of the verilog-ams code.


How did you create the symbol?  Did you use "create cellview from cellview" or something?  (I've never made a symbol for a Verilog-AMS module myself.)  I would think that, if the CDF parameters for the symbol were automatically generated from the .vams file, then they should have the right data type.


I first created the Verilog-AMS cellview and after saving and closing the file, Cadence says, that no symbol exists, would you like to create it?

Click yes and the symbol view appears in the listing of the components views.
Back to top
 
 
View Profile   IP Logged
JussiS
New Member
*
Offline



Posts: 9
Scandinavia
Re: Simulator gives error if parameters are changed
Reply #11 - Feb 20th, 2011, 10:54pm
 
Geoffrey_Coram wrote on Feb 14th, 2011, 6:21am:
JussiS wrote on Feb 13th, 2011, 11:05pm:
And I'm guessing the problem is:

cdfCreateParam( cdfId
      ?name           "Pole3"
      ?prompt         "Pole3"
      ?defValue       "1e+07"
      ?type           "string"    <-Right there??

-Jussi


Yep.  Also the defValue is "1e+07" (a string) rather than 1+e07 (a floating-point number).

Perhaps Andrew can tell you how to load the cdf back in, after you change all those "string" to "real"



What is Andrews nick on this board? (Probably just "Andrew", but gotta ask anyways).

Thanks
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: Simulator gives error if parameters are changed
Reply #12 - Feb 22nd, 2011, 5:26am
 
I meant Andrew Beckett, who responded earlier in this thread.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
JussiS
New Member
*
Offline



Posts: 9
Scandinavia
Re: Simulator gives error if parameters are changed
Reply #13 - Apr 4th, 2011, 11:01pm
 
Tried contacting Andrew with a PM, but no response so far (it's been a month).

Anybody else have any idea as to how to fix this?
Back to top
 
 
View Profile   IP Logged
boe
Community Fellow
*****
Offline



Posts: 615

Re: Simulator gives error if parameters are changed
Reply #14 - Apr 5th, 2011, 8:22am
 
JussiS,

the output of cdfDump looks like a SKILL script to me, so you should try to just run it. But you could also use the CDF tool to change this directly with the GUI.
BTW, you could also leave the parameter type as string and change the parseAsNumber...
Code:
cdfCreateParam( cdfId
       ?name           "Pole3"
       ?prompt         "Pole3"
       ?defValue       "1e+07"
       ?type           "string"
       ?display        "artParameterInToolDisplay('Pole3)"
       ?parseAsNumber  "yes"  ;; needed for all numeric values w type=string
       ?parseAsCEL     "yes"     ;; may also be needed
... 

Does this help?
B O E
Back to top
 
 
View Profile   IP Logged
Pages: 1 2 
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.