You are on page 1of 39

Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec.

2020

Tutorial for Simulating a Simple Receiver Using SpectreRF


A. Start the Cadence software

1. Open an “Terminal” through the “Applications -> System Tools -> Terminal”.

2. Using the linux command “ls” to see all the file and sub-directories under the

current directory.

3. Using the command “cd <directory_name>” to enter a sub-directory. Here we will

enter into “cad_smic55ll_202010”.

P. 1/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

4. Using “ls” to make sure that the file “conf.sh” is under the current directory and

then using the command “source conf.sh” to start the cadence.

B. Create the Cadence library for the simple receiver

1. Add the rfLib that contains the behavior model of the simple receiver by typing

$ gedit cds.lib &

2. Add the following sentence in the popped text edit:

DEFINE rfLib $CDS_INST_DIR/tools/dfII/samples/artist/rfLib

P. 2/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

[Note] Steps 1 and 2 are only needed to be done once. After the rfLib has been added,

it will be saved and we will see it in the library manger every time we open the

cadence.

3. Close the Cadence software and restart again:

$ source conf.sh

4. Open the Library Manager from the menu in the main window by clicking “Tools

 Library Manager”

5. Create a new library named “tutorial” in the Library Manager by clicking “File 

New  Library”

P. 3/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

6. Now you can see a new library named “tutorial” appears in the Library Manager

P. 4/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

as:

7. Create a design of schematic named “simple_receiver” in the library “tutorial” by

clicking “File  New  Cell View”:

8. Now you can see a new design named “simple_receiver” with a schematic appears

under the library “tutorial” and a new window of schematic will pop out:

P. 5/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

9. Now we can add instance of the receiver in the schematic window. Firstly, we add

a “LNA” from the “rfLib” library by clicking “Add  Instance” or press “i” in the

schematic:

P. 6/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

10. Then put the instance of “MIXER_PB” from the “rfLib” library in the same way.

Also put the two instances of “psin” from the “analogLib” library and three

instance of “gnd” from the “analogLib” library in the schematic:

P. 7/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

11. Now we can connect all the components together by clicking “Add  Wire

(narrow)” or press “w” in the schematic:

12. Connect each node on by one as the schematic shown below:

P. 8/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

13. Add input pin by clicking “Add  Pin…” or press “p” in the schematic:

P. 9/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

14. Add the output pin using the same way and connect the two pins, and save the

schematic by clicking the “save and check” button in the left tool bars:

YOU NEED TO SAVE AND CHECK EVERYTIME if you change anything in

the schematic (wire, parameter, pin, symbol, etc.)

15. Setting the parameters (e.g. gain, input/output resistance, input referred IP3, noise

figure) of the LNA, MIXER and psin.

(1) Select the LAN symbol and press the button “q” in the keyboard. In the tab

popped out, set the parameters as shown below:

(2) Select the MIXER symbol and press the button “q” in the keyboard. In the tab

popped out, set the parameters as shown below:

P. 10/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

(3) Select the psin symbol at the left side and press the button “q” in the keyboard.

In the tab popped out, set the parameters as shown below:

P. 11/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

(4) Select the psin symbol at the right side and press the button “q” in the

P. 12/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

keyboard. In the tab popped out, set the parameters as shown below:

The port name can be changed as well, you need to make sure you select only

current button first and change the name of the input and output port to rf and if,

respectively.

P. 13/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

P. 14/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

16. Save the schematic again by clicking the “save and check” button in the left tool

bars.

P. 15/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

C. Setting up the simulation for the simple receiver.

1. In the Schematic window, click upper left button Launch-ADEL

2. In the pop-upped window, choose Variables – copy from cellview

P. 16/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

3. Then there will be three variables, double click each of them and set their values

respectively. Their values should be: flo=5G; frf=5.2G; prf=-50.

D. Setting up for the simulation of the transient response:

1. Click on the rf source in the Schematic window and press q to edit the

properties of the voltage source. Make sure the source type is sine.

2. Choose Analyses - Choose in the Simulation window.

P. 17/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

3. In the Choosing Analyses form, click on tran.

4. Type 100n in the Stop Time field and click the button OK.

E. Running the transient simulation

1. In the Schematic window, choose Design - Check and Save. AGAIN,

REMEMBER TO CHECK AND SAVE EVERYTIME YOU CHANGED STH IN

THE SCHEMATIC!!!

2. To run the simulation, choose Simulation - Netlist and Run in the Simulation

window.

P. 18/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

3. The output log file appears and displays information about the simulation as

it runs. If nothing happens, it means you didn’t check and save, look in the CIW

for a message that says the simulation completed successfully or where you did

sth. wrong.

4. Choose Results - Direct Plot – Transient Signal. To plot the voltage against

time, click on the net(s)(wires you connect) in the Schematic window and press

P. 19/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

ESC to finish the selection.

5. The transient response of the receiver can then be read in the Waveform

Window display. However, it is difficult to interpret the results in the transient

domain. Thus, it is necessary to perform the Period Steady State simulation.

The waveform of the net “out” is plotted in the picture below.

P. 20/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

F. Save and load your simulation states

If you don’t finish your simulation and want to continue later, or if you want to

re-run the same simulation a while after, you don’t need to set the analyses again.

You can save your state and load it anytime you want to simulate.

In the ADEL, click session and save state:

Choose Cellview and change the name of the state in the Cellview Options state to

anything you want.

P. 21/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

If you want to load a state, In the ADEL, click session and load state, choose

Cellview in the Load State Option, and choose the state you want to load in the

Cellview Options

P. 22/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

G. Setting up the PSS analysis

1. In the Simulation window, use Analysis - Disable to disable any analyses you

ran previously.

2. Choose Analyses - Choose in the Simulation window.

3. In the Choosing Analyses form, click on pss.

4. Add Name lo, Expression flo, and Name rf, Expression frf into the

Fundamental Tones. At the lower right corner of the Fundamental Tones section,

highlight the Auto Calculate button. The Beat Frequency is now displayed as

200M. The Beat Frequency button is highlighted by default.

5. In the Output harmonics cyclic field, choose Number of harmonics and type

30 in the field.

6. Highlight conservative for the Accuracy Defaults (errpreset) setting and type

10n in the field, Additional Time for Stabilization (tsab).

7. The completed form appears like the one below.

P. 23/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

H. Running the PSS simulation

1. To run the simulation, choose Simulation - Netlist and Run in the Simulation

window.

2. When the simulation is finished, choose Results - Direct Plot – Main Form.

In the PSS Results form, click power, select Port (fixed R(port)) and highlight

dBm for modifier.

3. Click on the port in the Schematic window and press ESC to finish the

selection. The Waveform Window display appears like the one below. Output

power should be -20dBm = -50dBm(input power)+20dB(LNA

Gain)+10dB(Mixer Gain).

P. 24/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

I. Setting up the swept PSS analysis for calculating the 1db compression point

1. In the Simulation window, choose Analyses - Choose.

2. In the Choosing Analyses form, choose pss for the Analysis.

3. In the Fundamental Tones list box, make sure the Auto Calculate button is

highlighted.

4. The Beat Frequency is now displayed as 200M. The Beat Frequency button is

highlighted by default.

5. In the Output harmonics cyclic field, choose Number of harmonics and type

2 in the Number of harmonics field.

6. Highlight conservative for the Accuracy Defaults (errpreset) setting.

7. Highlight the Sweep button. There is a little change in the form after the

button is highlighted.

8. Type prf in the variable name field. Choose Start-Stop for the Sweep Range,

and then type -50 and 0 for the Start and Stop values, respectively, in the fields.

9. Choose Linear for the Sweep Type, and specify 5 for the Number of Steps.

10. The completed Choosing Analyses form looks like the one below.

P. 25/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

11. Click OK in the Choosing Analyses window.

12. When the simulation is finished, choose Results - Direct Plot – Main Form.

13. Highlight Compression Point for Function.

14. Type -50 for Extrapolation Point (dBm).

This value specifies the point where the ideal amplification curve intersects the

output curve. If you do not specify a value, the plot defaults to the minimum

variable value.

15. In the Harmonic list box, highlight harmonic 1 (200 MHz). This is the IF

frequency.

16. The completed PSS Results form looks like this.

P. 26/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

17. In the Schematic window, click on the output port and the Waveform

Window display looks like the one below.

P. 27/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

P. 28/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

Setting up the PSS analysis for calculating the IP3 of the receiver

Setup of PSS analysis

18. Click on the rf voltage source in the Schematic window and press q to edit

the properties of the voltage source.

19. Type frf2 in the Frequency 2 field.

20. Type prf in the Amplitude 2 (dBm) field.

21. In the Edit Object Properties form, click OK.

22. In the Schematic window, choose Design - Check and Save.

23. Add variable frf2 in the field Design Variables, as we did in part B. Its value

is set to be 5.22GHz.

24. In the Simulation window, choose Analyses – Choose and choose pss for the

Analysis in the Choosing Analyses form.

25. In the Fundamental Tones list box, make sure the Auto Calculate button is

highlighted, the Beat Frequency is now displayed as 20M.

26. In the Output harmonics cyclic field, choose Number of harmonics and type

12. Harmonic 10 and 11 represent frequency 200MHz (20M*10) and 220MHz

(20M*11), they are fundamental tones down-converted by mixer, harmonic 9 and

12 are IM3.

27. Highlight conservative for the Accuracy Defaults (errpreset) setting.

28. Highlight the Sweep button. Type prf in the variable name field. Choose

Start-Stop for the Sweep Range, and then type -50 and 0 for the Start and Stop

values, respectively, in the fields.

29. Choose Linear for the Sweep Type, and specify 5 for the Number of Steps.

30. The completed Choosing Analyses form looks similar to the simulation of

1dB compression point.

P. 29/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

Looking at the result

1. When the simulation is finished, choose Results - Direct Plot – Main Form.

2. Highlight IPN Curves for Function.

P. 30/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

3. Choose Variable Sweep ("prf") for Circuit Input Power.

4. Type -30 for Extrapolation Point (dBm). This value is the intercept point for the

ideal amplification extrapolation. If you do not specify a value, the plot defaults to

the minimum variable value.

5. Highlight 12 240M in the 3rd Order Harmonic list box and 10 200M in the 1st

Order Harmonic list box.

6. In the Schematic window, click on the output port

P. 31/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

The waveform will be the same as the picture below.

J. Setting up the PSS and pnoise analysis for calculating the noise figure of the

receiver

Setup of PSS analysis

1. Click on the rf source in the Schematic window and press q to edit the

properties of the voltage source. Change the field, source type, from sine to dc.

2. Type 27 in the field “Noise temperature”. (The default value is not 27oC, if

left blank, the simulated noise figure will be 5.226dB)

P. 32/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

3. In the Schematic window, choose Design - Check and Save.

4. Choose Analyses – Choose and pss for the Analysis in the Choosing Analyses

form.

5. In the Fundamental Tones list box, if the frf and frf2 tones are still there,

delete them first and only the flo can be left here. That is because we have already

set the source type to dc in the input port and frf and frf2 should not be effective.t

6. Then highlight the Auto Calculate button.


P. 33/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

7. In the Output harmonics cyclic field, choose Number of harmonics and type

0 in the Number of harmonics field.

8. Highlight conservative for the Accuracy Defaults (errpreset) setting.

9. Make sure that the sweep button is now unchecked this time.

Setup of pnoise analysis

1. At the top of the Choosing Analyses form, highlight pnoise.

2. The Choosing Analyses form changes to let you specify data for a pnoise analysis.

3. In the Frequency Sweep Range (Hz) cyclic field, choose Start-Stop.

4. Type 100M and 1G as the Start and Stop values, respectively in the fields (the

P. 34/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

frequency range is set according to the IF frequency but not RF).

5. In the Sidebands cyclic field, choose Array of indices and type 1 for the Array of

indices. With this setting, it means that RF frequency contributes noise to the

output.

6. Make sure the Noise Figure buttom is chosen

7. In the Output Voltage option cyclic field, choose port for the Output value.

Highlight the Output Port Instance Select button. Then click on the IF voltage

source in the Schematic window.

8. In the input Voltage option cyclic field, choose port for the input value. Highlight

the Input Port Instance Select button. Then click on the RF voltage source in the

Schematic window.

9. Type 1 in the Reference Sideband field. This field specifies that RF frequency is

sideband 1 relative to IF frequency according to LO frequency translation.

10. The completed Periodic Noise Analysis section of the Choosing Analyses form

appears like the one below.

P. 35/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

11. In the Choosing Analyses form, click OK.

12. When the simulation is finished, choose Results - Direct Plot –Main Form.

13. Highlight pnoise for Analysis Type and highlight Noise Figure for Function.

14. Click on Plot in the PSS Results form. The Waveform window displays the noise

P. 36/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

figure as shown below.

The Y axis has extremely small range, you should enlarge the range and make the

waveform looks quite natural.

To change the range of the Y axis, right click the area of the Y axis and select Axis

properites.

P. 37/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

Choose Scale, and change the Mode to manual. Then you can change the range of the

Y axis.

P. 38/39
Verilog-A SpectreRF Simulation Tutorial Notes 07 Dec. 2020

After changing the scale, the Noise figure will look like the picture below. You can

add a maker by select the wave of the noise figure and then press “m”.

K. Reference

1. Affirma RF Simulator (SpectreRF) User Guide, Chapter 4, Simulating Mixer,

Cadence manual.

P. 39/39

You might also like