eddie
New Member
Offline
Posts: 7
|
Hi. I admit it, I'm new to VerilogA. I need a resistor in which the resistance changes depending on the voltage.
So a simple resistor is:
module res(p,n); inout p,n; electrical p,n; parameter real r=0 from [0:inf); analog V(p,n) <+ r*I(p,n); endmodule
I have a set of voltage threshold values and resistances that are defined at the top of my code (`define etc), basically a set of linear approximations to an exponential increase in resistance with voltage. So I have:
if (V(p,n) < VD2) Resistance = RA else if etc, where RA and VD2 are both defined in the file above.
Can anyone tell me why I get a syntax error in the if statement, already looked up if statements in the VerilogA Reference Manual. Is it that the values VD2 etc are not actually physically relevant (i.e. not actual voltages etc)
The error I get is: line 26: "if <<--? (V(p,n) <= VD2)" line 26: Error: syntax error
How would you change the resistance of a resistor with voltage, temperature etc. Thanks. Ed Fisher
|