Continue to Site

# [SOLVED]Define a voltage function in Cadence Virtuoso

Status
Not open for further replies.

#### Erick_Guerrero

##### Newbie level 5
Hi guys,
Recently i designed a model for an ISFET in HSpice but now i have to translate it to Cadence. I'm using ic5.1 schematic editor and i have a problem. The model consists of some voltage controled sources wich value is a matematical function of another voltages. Does anybody know how can i define such a function in the schematic editor?

#### smlogan

##### Newbie level 4
HI Erick,

Virtuoso has the standard analogLib elements vcvs (voltage controlled voltage sources) that might be of use. You can define the input source to the element as the voltage between two nodes in the circuit. There is also a polynomial based source to create a more complex transfer function.

Shawn

Erick_Guerrero

### Erick_Guerrero

Points: 2

#### JoannesPaulus

If the math function is a polynomial function, follow Shawn's advice. If not, you can write a verilog-A module for your vcvs (or maybe the whole model). :wink:

Points: 2

### bsh3

Points: 2

#### Erick_Guerrero

##### Newbie level 5
Thanks for your answer guys. I've been trying and searching about cadence but the thing is that i've never used it before. Does anybody know where to find a complete docuent about cadence? i don't have anything where to search so i need something to read. thanks again.

Staff member
Erick_Guerrero

### Erick_Guerrero

Points: 2

#### Erick_Guerrero

##### Newbie level 5
It seems it will be a loong loong night, i have a lot to read jaja. Thanks for the document, as far as the Thread i won't mark it as solved, i want to read first and see if i can finally solve my problem, otherwise i will come to you guys again.
Thank you very much

#### erikl

##### Super Moderator
Staff member
seems it will be a loong loong night, i have a lot to read jaja.
Seems you're really a brave ;-) guerrero ;-), Erick!

#### Erick_Guerrero

##### Newbie level 5
Well, i'm back to you again. As i said before, i'm trying to simulate an ISFET model in Cadence. In my netlist (Hspice) i have a VCVS which gain is something like this:

Vx = exp(V(a,b)-V(c)) / exp(a,b)*V(d), where V(a,b) represents the voltage between node a and b.

Does anybody know how can i get this gain for the controlled source? I've been trying to find out but i'm kind of lost right now.
Thanks again.

#### JoannesPaulus

You will need to tweak this but it is a starting point.
Code:
include "constants.vams"
include "disciplines.vams"
module isfet(...);
input ...;
output ...;
electrical ...;

analog begin
@(initial_step("static")) begin
end

if (analysis("ac","noise")) begin
end
else if (analysis("static","xf")) begin
end
else begin // transient and large signal analyses
V(x) <+ exp(V(a,b)-V(c)) / exp(a,b)*V(d);
end
end
endmodule
You will need to define your inputs, outputs and inout and do not need to use the "initial step" condition unless you need special initialization for your model.
In the simplest form you could just have:
Code:
include "constants.vams"
include "disciplines.vams"
module isfet(...);
input ...;
output ...;
electrical ...;

analog begin
V(x) <+ exp(V(a,b)-V(c)) / exp(a,b)*V(d);
end
endmodule
You can find a verilog-a manual in your C(a)dence installation or on the internet search for "veriaref.pdf". Of course, I can help you in your effort.

Last edited:
melkord and Saghi

### Saghi

Points: 2

#### Erick_Guerrero

##### Newbie level 5
hi JoannesPaulus,
thanks a lot for the help. Te source i'm trying to define it uses its self voltage as a parameter also. I created a VerilogA module but in the two nodes i see the same voltage, can you check if it's anything wrong? My guess is that both voltages initializes at the same value and then, remain the same. I tryied to initialize one of them too but still have same values.
Code:
// VerilogA for ISFET, EpH, veriloga

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

module EpH(r10,r1,n23,n46);
inout r10,r1;
input n23,n46;
electrical r10,r1,n23,n46;

//   real pH;

analog begin
//	@(initial_step) begin
//	    V(r1) <+ 0;
//	end
//	pH = V(r10,r1);
V(r10,r1) <+ (pow(1.345223707,-36)*(exp(-77.294686*V(r10,r1)-exp(V(n46)))))/(exp(-77.294686*V(r10,r1))+exp(V(n23)*exp(-38.647343*V(r10,r1)))+exp(V(n46))) + (pow(8.968158044,-37)*exp(-38.647343*V(r10,r1)))/(exp(-38.647343*V(r10,r1)) + pow(6.329113924,-12)*exp(V(n23)));
end

endmodule

Thank you again

Saghi

### Saghi

Points: 2

#### JoannesPaulus

Your model seems to be functionally correct.
If I understand correctly your equation there is a parenthesis mismatch and with those small numbers you might have very small voltages variations, the second fraction could be: (pow(1.345223707,-36)*(exp(-77.294686*V(r10,r1))-exp(V(n46))))

Saghi

### Saghi

Points: 2

#### Erick_Guerrero

##### Newbie level 5
After a lot of simulating and checking, i finally got it. I did what i should done hours ago, delete everything, take a few minutes to relax and start over again, jeje. The model was (as you said) functionally correct, the mistake i had is that i was using "pow(1.3453,-3)", when the correct number was 1.3453*pow(10,-34), (among another small details).
Anyway, thanks a lot for your advises, this VerilogA modules will get me out of lot of problems in the future.

Saghi

Points: 2