【正文】
2. 波形描述在檔頭后面即為波形描述。這兩部分之間至少用一個(gè)空行隔開。波形描述部分由若干行組成。每一行格式為:時(shí)間值 邏輯電平值其中時(shí)間值與邏輯電平值之間應(yīng)該用空格分開。(1) 時(shí)間值:時(shí)間單位為秒。時(shí)間值可以用絕對模式(如45ns,),或相對模式(如+5ns,+1e9等)表示。如果在檔頭中有TIMESCALE設(shè)置值,則每一個(gè)時(shí)間值還應(yīng)用該設(shè)置相乘(見下面圖77例3)。(2) 邏輯電平值:波形描述部分邏輯電平值可采用的字符及其含義如表8所示。表8 邏輯電平設(shè)置值二進(jìn)制OCT(8進(jìn)制)HEX(16進(jìn)制)高低電平(High/Low)0,1070F不確定(Unknown)XXX高阻(Hiimpedance)ZZZ上升(Rising)RR下降(Falling)FF如表8所示,在設(shè)置邏輯電平時(shí),對OCT和HEX,同一個(gè)分組中的幾個(gè)信號高低電平分別用一個(gè)8進(jìn)制和16進(jìn)制數(shù)表示,但程序運(yùn)行時(shí)會自動將其轉(zhuǎn)換為等價(jià)的二進(jìn)制數(shù),并按從最高位(msb)到最低位(lsb)的順序依次將每一位二進(jìn)制數(shù)分別賦給分組括號中的每一個(gè)信號。如果邏輯電平值設(shè)置為X、Z、R或F,則分組內(nèi)的每一個(gè)信號均取該設(shè)置值。由于F是16進(jìn)制數(shù)中的一個(gè)數(shù),因此對HEX分組,不允許設(shè)置“下降”邏輯狀態(tài)。例3:下述文件內(nèi)容描述了13個(gè)信號的波形。其中Addr7,…Addr0共8個(gè)信號分別用兩個(gè)HEX分組表示。在檔頭中設(shè)置了時(shí)間倍乘因子值。TIMESCALE=10nsClock, Reset, In1, In2HEX(Addr7, Addr6, Addr5, Addr4)HEX(Addr3, Addr2, Addr1, Addr0)RW0 0000 00 01 110R 4E 02 0101 4E 1+3 1111 4E 17 011F C3 08 11X0 C3 1在上述波形描述中,同時(shí)采用了絕對時(shí)間模式和相對時(shí)間模式兩種表示方式,分別給出了t=0,10ns,20ns,50ns,70ns和80ns六個(gè)時(shí)刻的波形變化。由于文件頭中包括5個(gè)一位信號,兩個(gè)HEX分組信號,因此在波形描述部分,時(shí)間值后面邏輯電平設(shè)置項(xiàng)共有7個(gè)字符。前4個(gè)對應(yīng)4個(gè)一般信號的邏輯狀態(tài)設(shè)置,第5和第6個(gè)字符為兩個(gè)16進(jìn)制數(shù),對應(yīng)兩個(gè)HEX分組內(nèi)一共8個(gè)信號的邏輯狀態(tài)設(shè)置。最后一個(gè)字符用于描述文件頭中最后一個(gè)一般信號RW的信號邏輯電平。波形描述文件確定的信號波形(例3)上述文件描述的13個(gè)信號波形如上圖所示。B、FILESTIMn信號源波形設(shè)置FILESTIMn參數(shù)設(shè)置由于FILESTIMn類信號源波形由波形描述文件中資料確定,因此其信號設(shè)置比較簡單。在電路圖中連擊該類信號源符號,屏幕上出現(xiàn)元器件屬性設(shè)置框,如下圖所示,常規(guī)元器件屬性參數(shù)項(xiàng)外,F(xiàn)ILESTIMn所特有的參數(shù)有4項(xiàng)。1. FILENAME(波形描述文件名)本項(xiàng)參數(shù)的作用是指定調(diào)用那一個(gè)波形描述檔。2. SIGNAME(信號名)該項(xiàng)參數(shù)用于指定從波形描述檔中讀取那幾個(gè)信號名對應(yīng)的波形描述資料。下面以前面例3所示波形描述文件的調(diào)用為例,說明與該參數(shù)設(shè)置有關(guān)的幾個(gè)問題。(1) 1位信號源FILESTIM1:對這種信號源,只需要指定一個(gè)信號名。若SIGNAME參數(shù)設(shè)置為Reset,作為該信號源的激勵(lì)信號波形。顯然,被調(diào)用的波形描述檔中一定要有一個(gè)名稱與SIGNAME參數(shù)設(shè)置名或信號源輸出端節(jié)點(diǎn)名相同的信號名。(2) 多位信號源FILESTIMn:這種信號源有16或32位輸出,因此,需從波形設(shè)置文件中讀取多組資料。具體設(shè)置方法與上述1位號源情況類似。波形描述文件中的信號名個(gè)數(shù)與信號源位數(shù)(即信號源輸出端節(jié)點(diǎn)名個(gè)數(shù))不一定相等。即不要求文件中每一個(gè)信號名均被調(diào)用。但波形描述文件中一定要有與信號源輸出端節(jié)點(diǎn)名稱相同的信號名。在一個(gè)電路圖中,可以有多個(gè)FILESTIMn信號源調(diào)用同一個(gè)波形描述檔十一、 模型編輯在PSpice中,為了方便用戶修改器件模型,提供了一個(gè)模型編輯器(PSpice Model Editor),通過PSpice Model Editor,也可以新建自己的模型。 編輯器件模型在Capture的Schematic中,選中需要編輯的器件,點(diǎn)擊EditPspice Model,系統(tǒng)將會自動到PSpice的模型庫中查找該器件的模型,并彈出如下窗口:通過修改窗口中的文本,并保存退出,即已經(jīng)修改了該模型。但是修改后的模型只對該設(shè)計(jì)起作用,并不會影響到PSpice的仿真庫。另外一種方法是直接從開始菜單中打開PSpice Model Editor,然后直接打開相對應(yīng)的庫檔,選中相應(yīng)的器件然后開始修改,這樣將會直接影響以后該器件的模型。 新建器件模型從開始菜單中打開PSpice Model Editor,從菜單ModelNew,系統(tǒng)彈出如下對話框:在Model中輸入模型名稱,點(diǎn)擊OK,即會出現(xiàn)如下窗口:你可以通過View菜單中的Normal或Model text選擇以波形或文本的形式來編輯器件模型。注意:PSpice支持的模型參數(shù)含義,在軟件光盤的下面文件中有詳細(xì)的介紹:光盤\Document\在附件A中舉出三極管的模型參數(shù)??梢詤㈤啞8郊嗀:三極管模型參數(shù)附件B:PSpice常用的全局函數(shù)附件C:ABM行為器件庫的應(yīng)用實(shí)例一、Modeling voltagecontrolled and temperaturedependent resistorsVoltagecontrolled resistorIf a Resistance vs. Voltage curve is available, a lookup table can be used in the ABM expression. This table contains (Voltage, Resistance) pairs picked from points on the curve. The voltage input is nonlinearly mapped from the voltage values in the table to the resistance values. Linear interpolation is used between table values.Let’s say that points picked from a Resistance vs. Voltage curve are:VoltageResistance2550100The ABM expression for this is shown in Figure 1.Figure 1 Voltage controlled resistor using lookup tableTemperaturedependent resistorA temperaturedependent resistor (or thermistor) can be modeled with a lookup table, or an expression can be used to describe how the resistance varies with temperature. The denominator in the expression in Figure 2 is used to describe mon thermistors. The TEMP variable in the expression is the simulation temperature, in Celsius. This is then converted to Kelvin by adding . This step is necessary to avoid a divide by zero problem in the denominator, when T=0 C.NOTE: TEMP can only be used in ABM expressions (E, G devices).Figure 3 shows the results of a DC sweep of temperature from 40 to 60 C. The yaxis shows the resistance or V(I1:)/1A.Figure 2 Temperature controlled resistorFigure 3 PSpice plot of Resistance vs. Temperature (current=1A)Variable Q RLC networkIn most circuits the value of a resistor is fixed during a simulation. While the value can be made to change for a set of simulations by using a Parametric Sweep to move through a fixed sequence of values, a voltagecontrolled resistor can be made to change dynamically during a simulation. This is illustrated by the circuit shown in Figure 5, which employs a voltagecontrolled resistor. Figure 4 Parameter sweep of control voltageThis circuit employs an external reference ponent that is sensed. The output impedance equals the value of the control voltage times the reference. Here, we will use Rref, a 50 ohm resistor as our reference. As a result, the output impedance is seen by the circuit as a floating resistor equal to the value of V(Control) times the resistance value of Rref. In our circuit, the control voltage value is stepped from volt to 2 volts in volt steps, therefore, the resistance between nodes 3 and 0 varies from 25 ohms to 100 ohms in 25 ohmsteps.Figure 5 Variable Q RLC circuitA transient analysis of this circuit using a ms wide pulse will show how the ringing differs as the Q is varied.Using Probe, we can observe how the ringing varies as the resistance changes. Figure 6 shows the input pulse and the voltage across the capacitor C1. Comparing the four output waveforms, we can see the most pronounced ringing occurs when the resistor has the lowest value and the Q is greatest. Any signal source can be used to drive the voltagecontrolled resistance. If we had used a sinusoidal control source instead of a staircase, the resistance would have varied dynamically during the simulation.54 /