Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
AMS.pdf
Скачиваний:
76
Добавлен:
05.06.2015
Размер:
2.68 Mб
Скачать

Virtuoso AMS Environment User Guide

Working with Schematic Designs

electrical (* integer supplySensitivity = "cds_globals.\\vdd! " ; *) \vdd! ; electrical (* integer groundSensitivity = "cds_globals.\\vss! " ; *) \vss! ;

reg temp;

 

 

always begin

 

// Do this always.

if(V(aVal) >

((V(\vdd! ) - V(\vss! ))/2 + 0.5 ))

#1

temp

= 1;

// Delay 1 time unit,drive output 1.

else if

(V(aVal) < ((V(\vdd! ) - V(\vss! ))/2 -0.5))

#1

temp

= 0;

// or drive output 0, depending on aVal.

else

 

 

 

#1

temp

= 1’bx;

 

end

 

 

 

assign dVal = temp;

// Bind register to digital output.

endmodule

The next step is to specify the digital ports to which the connect module is sensitive. To do that, you add the groundSensitivity and supplySensitivity properties to the connected digital port. In the buffer string example illustrated above, connect modules are connected to both the input and the output ports of buffer bd2 and must therefore be sensitive to the supplies in those ports. In this case, the groundSensitivity and supplySensitivity properties must be added to both ports of the buffer, like this.

module bux2_5V (Z,A);

input

(* integer supplySensitivity="\\vdd! "; integer groundSensitivity="\\vss! "; *)

A ; output

(* integer supplySensitivity="\\vdd! "; integer groundSensitivity="\\vss! "; *)

Z;

wire \vss! ; wire \vdd! ;

analog begin

V(\vss! ) <+ 0.0 ; V(\vdd! ) <+ 5.0 ;

end

buf #1 (Z,A);

specify specparam

t_A_Z_rise = 0.1, t_A_Z_fall = 0.1;

// Delays

(A +=> Z) = (t_A_Z_rise,t_A_Z_fall); endspecify

endmodule

Making Connect Modules Sensitive to Inherited Connection Values

This section describes how to use the groundSensitivity and supplySensitivity properties to make a connect module sensitive to supplies whose values are set by inherited

April 2004

176

Product Version 5.3

Virtuoso AMS Environment User Guide

Working with Schematic Designs

connections. You might use this capability, for example, when you want to be able to switch between two different power supplies and have connect modules act differently depending on a value that is provided by inherited connection.

The primary change involved in making the connect module sensitive to values that are determined by inherited connections, is to the declarations of the ports in the ordinary module to which the connect module is sensitive. You use inherited connections to set the values of the signals in the ports and use the sensitivity properties to make the connect module sensitive to those values.

The following example illustrates how to set up the inherited connections and sensitivities in the ordinary module. Sensitivities are specified for both the input and output ports,A, and Z, so that connect modules can be inserted across and be sensitive to the supplies in either or both of those ports.

module bux2 (Z,A);

input

(* integer supplySensitivity="\\vdd! "; integer groundSensitivity="\\vss! "; *)

A ; output

(* integer supplySensitivity="\\vdd! "; integer groundSensitivity="\\vss! "; *)

Z;

wire

(* integer inh_conn_prop_name="lSup";

integer inh_conn_def_value="cds_globals.\\vss! "; *)

\vss! ; wire

(* integer inh_conn_prop_name="hSup";

integer inh_conn_def_value="cds_globals.\\vdd! "; *)

\vdd! ;

buf #1 (Z,A);

‘ifdef functional ‘else

specify specparam

t_A_Z_rise = 0.1, t_A_Z_fall = 0.1;

// Delays

(A +=> Z) = (t_A_Z_rise,t_A_Z_fall); endspecify

‘endif

endmodule

Notice how the input port A has a specifiedsupplySensitivity signal name of "\\vdd! ". When a supplySensitive connect module is connected to this input port, the connect module becomes sensitive to the value of "\\vdd! ".

April 2004

177

Product Version 5.3

Virtuoso AMS Environment User Guide

Working with Schematic Designs

Next, consider how the value of "\\vdd! " is set. That value is set according to the inherited connections properties farther down in the module. For "\\vdd! " the relevant specification looks like this.

wire

(* integer inh_conn_prop_name="hSup";

integer inh_conn_def_value="cds_globals.\\vdd! "; *)

\vdd! ;

This statement establishes an inherited connection with the name hSup and the default value of "cds_globals.\\vdd! ". If the value of hSup is not set anywhere above this module, then the value of \vdd! is set to the value of "cds_globals.\\vdd! ". If inherited connections are used to set a different value for hSup, then \vdd! takes on the different value, which, because supplySensitivity is being used, can be passed on to a connected connect module.

The connect module is set up in the usual way to be sensitive to the value of "cds_globals.\\vdd! ". For example, you might prepare the following A2D module to connect to the digital input port A mentioned above.

‘include "disciplines.vams"

connectmodule elect2logic(aVal, dVal); output dVal;

input aVal; logic dVal; electrical aVal;

electrical (* integer supplySensitivity = "cds_globals.\\vdd! " ; *) \vdd! ; electrical (* integer groundSensitivity = "cds_globals.\\vss! " ; *) \vss! ;

reg temp;

 

 

always begin

 

// Do this always.

if(V(aVal) >

((V(\vdd! ) - V(\vss! ))/2 + 0.5 ))

#1

temp

= 1;

// Delay 1 time unit,drive output 1

else if

(V(aVal) < ((V(\vdd! ) - V(\vss! ))/2 -0.5))

#1

temp

= 0;

// or drive output 0, depending on aVal.

else

 

 

 

#1

temp

= 1’bx;

 

end

 

 

 

assign dVal = temp;

// Bind register to digital output.

endmodule

With this preparation, you can then change the value of hSup and that changed value is inherited through the design. The sensitivity properties then make the attached connect modules sensitive to that changed value.

April 2004

178

Product Version 5.3

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]