Introducing SLPS

Introducing SLPS

This chapter introduces the PSpice SLPS interface and lists the requirements to run SLPS:

·  Introducing the PSpice SLPS Interface

·  Requirements for PSpice SLPS Interface

Introducing the PSpice SLPS Interface

PSpice SLPS Interface is an interface tool that links PSpice to the MATLAB modeling tool and also to Simulink system simulator, provided by The Mathworks. This interface tool has been developed in partnership with Cybernet Systems Co Ltd.

PSpice is a SPICE-based simulator used for simulating electrical and electronic circuits, and The Mathworks tools are used for system designing. PSpice SLPS interface integrates these two simulators to provide a simulation flow that can be used to design any kind of system with electronic sub-systems.

Circuits with PSpice models can now be included in system model. PSpice SLPS Interface allows users to substitute electronic blocks in PSpice, while the rest of the design is simulated using MATLAB or Simulink. As a result, you can now use a single prototype to co-simulate the electrical and mechanical systems. Co-simulation environment allows to simulate whole system with more realistic element models before trial manufacturing.

Requirements for PSpice SLPS Interface

To be able to use PSpice SLPS Interface, you need to acquire SLPS license from Cadence, and should have the following combination of The Mathworks and OrCAD products installed on your system:

The Mathworks products (R13 or higher)

a.  MATLAB 6.5 - 7.4

b.  Simulink 5.0 - 6.6

Note: SLPS does not support 64-bit MATLAB.

Cadence OrCAD products (R16.0 or later) or Cadence Allegro products (R16.0 or later)

Install one of the following schematic designer tools:

a.  Capture

b.  Capture CIS

c.  Allegro Design Entry CIS

d.  Allegro Design Entry HDL

Install one of the following simulators:

a.  PSpice A/D

b.  AMS Simulator

Instead of above two products you can also install one of the following Unison products:

a.  Unison EE

b.  Unison Ultra

Note: SLPS 2.9 does not work with OrCAD R15.7 or lower.

To set up PSpice SLPS, you need to set the SLPS path to the PSpice installation under MATLAB.
Set the SLPS path as <Cadence_Installation>\tools\pspice\slps. For example, if the installation path is
D:\OrCAD_16.0, the path should be set to D:\OrCAD_16.0\tools\pspice\slps. You can also run the <Cadence_installation>\tools\pspice\slps\slpssetup.p file from MATLAB to setup the SLPS path.
The SLPS demonstrations and example files are available from
<Cadence_installation>\tools\pspice\capture_samples\SLPSdemos and
<Cadence_installation>\tools\pspice\concept_samples\SLPSdemos.
Creating a Schematic
This chapter explains how to create and edit a schematic using either OrCAD Capture or
Allegro Design Entry HDL, simulate the schematic using PSpice, and then create and setup a block diagram using MATLAB:
·  Creating a schematic
·  Using PSpice A/D to Simulate Schematic
·  Creating and Setting Up a Block Diagram Using MATLAB
Creating a schematic
You can use either OrCAD Capture or Allegro Design Entry HDL to create and edit schematics. OrCAD Capture is a schematic design tool set for the Windows environment. With Capture, you can draft schematics and produce connectivity and simulation information for printed circuit boards and programmable logic designs.
Design Entry HDL helps you capture the design of a Printed Circuit Board (PCB) in the schematic
form. Design Entry HDL organizes schematic information into pages. It captures and displays only
one page of schematic information at a time. Design Entry HDL is a by-reference editor because
it references all parts in the schematic from various libraries that reside at the reference or local
area. To know more about Design Entry HDL, refer to the Allegro Design Entry HDL User Guide.
SLPS uses files created with OrCAD Capture and Allegro Design Entry HDL, so you cannot
directly assign net lists created with applications other than Capture or Design Entry HDL.
But you can use Capture to convert a SPICE net list to a symbol and incorporate it into a
circuit. After inserting the symbolized net list into a circuit, perform transient analysis
with PSpice, and then assign it to SLPS. Refer to to the chapter Designing for other EDA
applications of the online OrCAD Capture User's Guide on how to incorporate a SPICE
netlist into a circuit. Refer to the Transient analysis chapter of the online PSpice User's
Guide on how to perform transient analysis using PSpice.
The following section explains how to create schematics.
Using OrCAD Capture
You need to perform the following steps to create a schematic using Capture:
1.  Create a project in OrCAD Capture
2.  Create the schematic
You will use the New Project dialog box, as shown in the Figure 2-1, of OrCAD Capture to
create a new project.
D Praca Ucenie SSAEO materialy SLPS teoria SLPSUserGuide part02 subory 63c952424cc3f0599213c608 png
You can enter the name of the project in the Name text box. You can also select the purpose of the
new project from the options under Create New Project Using. The Location text box allows you to
specify a work directory to save your files.
Perform the following steps to create a new project:
1.  Start OrCAD Capture
2.  Choose File - New - Project to open the New project dialog box.
3.  Enter MOSCKT into the Name text box.
4.  Select Analog or Mixed A/D under Create New Project Using group box.
5.  Specify the work directory in the Location text box. For this example, create a directory,
Work in the C drive.
6.  Click OK.
The Create PSpice Project dialog box, shown in Figure2-2, will be displayed since you had selected
Analog or Mixed A/D under Create New Project Using group box.
D Praca Ucenie SSAEO materialy SLPS teoria SLPSUserGuide part02 subory e42ca0456c011bcab3b7dc14 png
Figure 2-2 Create PSpice Project dialog box
7.  Select Create a Blank Project and click OK.
The project window and schematic page is displayed as shown in Figure 2-3.
D Praca Ucenie SSAEO materialy SLPS teoria SLPSUserGuide part02 subory 46dbc75da501110bfaf2c010 png
Figure 2-3 Project window with schematic page
You have created the project, now you can create a schematic. Create the circuit as shown in
Figure 2-4. This circuit is comprised of a MOSFET, resistors, and voltage sources.
D Praca Ucenie SSAEO materialy SLPS teoria SLPSUserGuide part02 subory 2a73b3b6145c4ebc33add15d png
Figure 2-4 Circuit with MOSFET, resistors, and voltage sources
The input signal of the circuit for verifying operation is a 0.5µ wide 1-shot pulse.
Attach the node name "OUT" to the drain node. You will use this name to specify output
voltage from the SLPS block later.
D Praca Ucenie SSAEO materialy SLPS teoria SLPSUserGuide part02 subory aa08d62bc3596665d52af15f png
D Praca Ucenie SSAEO materialy SLPS teoria SLPSUserGuide part02 subory 18910d321a46a8b01b4cff59 png
Creating and Setting Up a Block Diagram Using MATLAB
In this section, you will learn how to use MATLAB to create a block, set SLPS block parameters, set up
Simulink analyses, and simulate using both PSpice and Simulink.
Creating a Block
To create a block:
1.  Start MATLAB
2.  Set the current MATLAB directory to be the work directory where PSpice files are saved,
which is c:\work for the example in this chapter.
3.  From the MATLAB comand window, choose File - New - Model to create a new model.
4.  From the MATLAB command window run the slpslib command to call the SLPS library.
Note: A warning might be displayed about inexact match when you run slpslib. However, you can
ignore this warning and use SLPS if the SLPS block library is displayed at the slpslib command of the
MATLAB R14 command window.
If an error is displayed because slpslib is not found, choose File - Set Path. Set the path to
<installation_directory>\tools\pspice\slps.
5.  Create a bloack diagram, as shown in Figure 2-9, using the blocks Repeating
Sequence/Sources and Scope/Sinks.

1.  Specify the repeating sequence parameters as shown in Figure 2-10.

Figure 2-10 Repeating Sequence parameters
2.  Save the model with the file name mosckt.mdl in the current directory.
You can place only one SLPS block in a single Simulink model. If you want to incorporate
multiple circuits, use Capture to create multiple circuit diagram pages within a project, and
connect all the data lines in the Simulink model, which need to be connected to the circuit,
to a single SLPS block.
Now that you have created a block and saved it, you will specify the block parameters.
Setting Up Block Parameters
You will use the SLPS settings window to specify the following block parameters:
·  the Capture project file
·  the input sources and outputs for the SLPS block
·  the PSpice data saving options
Double-click the SLPS block in the MATLAB command window to open the SLPS Settings
window as shown in Figure 2-11.

Figure 2-11 SLPS Settings window
Enter the capture project file MOSCKT.opj into the Capture Project file text box. You can also
use the Browse button to specify the project file. The PSpice Circuit file box lists the CIR files
created for each PSpice analysis setup and you can designate the file to be used. The example
project has only one file, tran.cir. Therefore, it is selected automatically.
You can click the Select button under Input Sources to display the power sources in a circuit in
the IN/OUT select dialog box. You can then select the power source that you want to designate
as the source for the SLPS block. In this example, select the source V1.
Note: At least one input must be designated for SLPS, but you may want to assign a circuit
with only output to SLPS (i.e. an oscillator). In this case, create a dummy circuit (for example,
with a power source and resistance) within the circuit diagram page, do not connect it with the original
circuit, and allocate some data to this power source.
To specify an output for the SLPS block click the Select button under Outputs. In this example,
select V(OUT) from the list displayed in the IN/OUT select dialog box.
After specifying the input sources and output, you can specify data saving options for PSPice in
the opt_settings dialog box. To open the opt_settings dialog box, click Options Parameters in the
SLPS settings window. In this example, specify the PSpice Data Saving Option as Selection Only.
If you select any option other than none from the PSpiceData Saving Option list, the
analysis speed will be slower. Therefore, it is not recommended to change this option unless you need it.
After completing the settings, click OK to close the SLPS settings window. You can now set up Simulink
analyses.
Setting Up Simulink Analyses
You can use the Simulation Parameters dialog box, shown in Figure 2-12, to set up a Simulink analyses. To open the Simulation Parameters dialog box, choose Simulation - Simulation Parameters from the model window menu.

Figure 2-12 Simulation Parameters dialog box
In the Simulation Parameters dialog specify the following parameters:
·  Under Simulation time, enter 3e-6 (3usec) into the Stop time text box.
·  Under Solver Options:
o  In the Type list boxes specify Fixed-step and discrete.
o  In the Fixed step size list box, specify 1e-9.
Save the file after setting up the parameters: choose File - Save.
Simulating and Verifying Results
You can now simulate the analyses using Simulink and then verify the SLPS block results from
both Simulink and PSpice.
To simulate using Simulink, choose Simulation - Start. When analysis is finished, double-click
Scope to display the waveform and perform Autoscale. The waveform that appears in Simulink,
shown in Figure 2-13,is similar to the one displayed PSpice.

If you selected any option other than none in the PSpiceData Saving Option in SLPS settings
window, you can display the SLPS results using PSpiceA/D. To display the SLPS simulation
results in PSpice, perform the following tasks:
1.  From PSpice A/D, choose File - Open
2.  Select the file c:\Work\MOSCKT-PSpice File\SCHEMATIC\SLPS_tran.dat
3.  Choose Trace - Add Trace to open the Add Trace dialog box.
4.  Select V (M1:d) from the Add Trace dialog box.
The PSPice Probe window displays the SLPS simulation result, as shown in Figure 2-14: