The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> Verilog-AMS >> Function of CDS_inherited_parameter
https://designers-guide.org/forum/YaBB.pl?num=1559779044

Message started by krishna95 on Jun 5th, 2019, 4:57pm

Title: Function of CDS_inherited_parameter
Post by krishna95 on Jun 5th, 2019, 4:57pm

Hi, I came across "* cds_inherited_parameter * " in a verilogA document which mentioned it in the following code. It looks like it is used for modelling a monte-carlo simulation effect.

module res(vp, vn);
inout vp, vn;
electrical vp, vn;
(* cds_inherited_parameter *) parameter real monteres = 0;
parameter real r = 1k;
localparam real r_effective = r + monteres; // nominal resistance plus
// monte-carlo mismatch effect
analog
V(vp, vn) <+ (r_effective)*I(vp, vn);
endmodule

I wrote this code in my cadence verilogA simulator it seems its not recognizing the cds definition as it appears gray as shown in figure. Although there are no error while running the va file, the resistor component thus made gives an error in transient simulation. The error specifies that "parameter montres is unknown". But when I write an extra line "parameter real montres=0", it works fine. But then what is the function of cds_inherited _parameter? How is it used?


Title: Re: Function of CDS_inherited_parameter
Post by Geoffrey_Coram on Jun 13th, 2019, 10:52am

I think the gray is just the syntax-highlighting of your editor: comments are red, keywords are blue, etc.

The (*  *) characters indicate an attribute. I often see attributes like
(* desc="width" unit="m" *) parameter real w=1u;

You could try putting that in your source code and see if it also gets colored gray, and whether w is accepted as a parameter.

Title: Re: Function of CDS_inherited_parameter
Post by Geoffrey_Coram on Jun 13th, 2019, 10:54am


Quote:
The error specifies that "parameter montres is unknown".


There's a typo there: is it montres or monteres?

I just don't know if there's a typo in the actual netlist, or if you just mistyped it in your post.

Title: Re: Function of CDS_inherited_parameter
Post by krishna95 on Jun 14th, 2019, 9:40am

The error specifies that "parameter monteres is unknown". Sorry for the previous typo. The command  " cds_inherited..." gives a default value for monteres so I dont need to specify "parameter real monteres=0" again, but I dont know why the error appears from the cadence simulation. How can I resolve it?

Title: Re: Function of CDS_inherited_parameter
Post by Geoffrey_Coram on Jun 14th, 2019, 10:47am

(* cds_inherited_parameter *) is an attribute. In principle, attributes aren't supposed to change the answer, just give the simulator a hint for optimization. I'm puzzled that this attribute appears to "hide" the parameter.

What if you just delete (* cds_inherited_parameter *) ?

Title: Re: Function of CDS_inherited_parameter
Post by Geoffrey_Coram on Jun 14th, 2019, 10:53am

Ah, OK, it looks like that attribute is used so you don't have to specify monteres on the instance line; the model will pick up the value from the hierarchy where the instance resides. That is, you will need

parameters monteres = 0

in the netlist or model library, and then you can use a statistics mismatch block to give the distribution for monteres.


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