let's discuss verilog-a for example opamp

Status
Not open for further replies.

rambus_ddr

Advanced Member level 4
Joined
Jun 26, 2001
Messages
107
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Activity points
970
veriloga opamp

I show a opamp example, but i have some question about their meaning.
what vout are the output of this opamp. let's us discuss their meanings.

The following is the main part of verilog-a code

1 @(initial_step or initial_step("dc") ) begin
2 cl= iin_max/(slew_rate);
3 gm_nom=2*'pi*freq_unitygain*cl;
4 r1=gain/gm_nom;
5 vmax_in=iin_max/gm_nom;
6 end
7 vin_val=v(vin_p,vin_n) + vin_offset;
8 // Gm stage with slewing
9 I(vref,cout) <+ V(vref,cout)/100e6;
10 if(vin_val > vmax_in)
11 I(vref,cout) <+ iin_max;
12 else if (vin_val <-vmax_in)
13 I(vref,cout) <+ -iin_max;
14 else
15 I(vref,cout) <+ gm_nom*vin_val;
16 //dominant pole
17 I(cout,vref) <+ ddt(cl*v(cout,vref));
18 I(cout,vref) <+ v(cout,vref)/r1;
19 //output stage
20 I(vref,vout) <+ V(cout,vref)/rout;
21 I(vout,vref) <+ V(vout,vref)/rout;
22 //soft output limiting
23 if (V(vout) >vsupply -vsoft))
24 I(cout,vref) <+ gm_nom*(V(vout,vspply_p) + vsoft);
25 else if (V(vout) <vsoft))
26 I(cout,vref) <+ gm_nom*vsoft;
27 end
 

opamp veriloga

hi rambus_ddr;

I really wonder a lot things about this code.

First of all, I couldn't locate all the nodes and elements properly. Do you have any idea about the complete schematic?

In addition to that, I couldn't understand the purpose of the Vref voltage? Do you have any idea?

Added after 2 minutes:

I also found this verilog-a model for opamps.

http://www.eda.org/verilog-ams/models/opamp.va

Do you have any idea about the following portion of the code;

// output current limitation
case (1)
iout > iout_max : iout = iout_max;
iout < -iout_max : iout = -iout_max;
endcase

Do you understand the syntax here?
 
Reactions: leesam

    leesam

    Points: 2
    Helpful Answer Positive Rating
verilog-a example

V(vout,vref)/rout<+ I(vout,vref)
 

verilog-a opamp

pfd001 said:
V(vout,vref)/rout<+ I(vout,vref)

Hi pfd001;

Thanks for your post, but I couldn't understand what you were trying to mention. Could you please explain it to me?
 

Re: opamp veriloga

// output current limitation
case (1)
iout > iout_max : iout = iout_max;
iout < -iout_max : iout = -iout_max;
endcase

Do you understand the syntax here?

Limit values (clamping) for iout are being set.
you could write the code like this:

if (iout > iout_max) iout = iout_max; // if iout is greather than iout_max then iout = iout_max
else if (iout < -iout_max) iout = -iout_max; // if iout is less than -iout_max then iout =-iout_max

regards!
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…