ad1

Monday, November 30, 2015

How does spectre get stimuli information

In the input.scs file, netlister adds an "include" statement,
include "./_graphical_stimuli.scs"
In the _graphical_stimuli.scs file, the necessary sources are listed as shown below,


Friday, November 27, 2015

Stateflow Data


"Diagnostic for default case" for Multiport Switch (Simulink)



Debug Stateflow

To debug stateflow, choose Simulation Menu, and then Debug > Debug Chart...

Use pattern matching in saving current (spectre)

The save statement takes a list of signals followed by some optional parameters as an argument.
save X[:param] ... [depth=num] [sigtype=node|dev|subckt|all]
  • The parameters control pattern matching; 
  • depth controls the depth of the pattern matching ( default: all hierarchical levels);
  • sigtype defines the type of X (default value: node)
The following save statement can be used in post-layout simulation, when you want to check all the currents of a specific device that has a m other than 1:
save I0.MTP3319.*:d sigtype=subckt

Wednesday, November 25, 2015

Using Multiple Events in A Chart

When the Mux block is connected to the trigger port on top of the Stateflow chart, the index of the signals in the array is associated with the numbered ports.

LDO Step Response

Due to the pole-zero doublet induced by the output capacitance with ESR and load resistance, the step response will slow down at the end of the ramp process.

Spectre Namespaces


  1. schematic name: begins with a "/", that is, the hierarchical name stored in Virtuoso database;
  2. netlist name:  refer to spectre's naming rules (i.e. dot "." as the hierarchy separator, and ":" for terminal access or operating point parameter access).
To map between these two namespaces, spectre use files in netlist/map and netlist/amap directories.

Spectre "save" option

Default save option: "selected"
saveOptions options save=selected currents=selected
With spectre, "selected" means that any signals that appear in save statements; if no outputs are explicitly saved then it will save all node voltages. This is to keep things simple - if you didn't tell it what to save, it assumes you wanted to see something, so it saves the most likely.

Benefit of Using Multiple Test in ADEXL


  • Enables you to use different testbench schematic to test different aspect of the circuit performance, e.g. transient, ac, envelop, etc.
  • Enables you to share variables

How to use APS in simulation

You should not use "aps" as the choice of simulator under Simulator/Directory/Host - that is obsolete and was the initial interface to the APS technology. In fact in later IC615 ISRs it has been removed. The correct interface is the Setup->High Performance Simulation.

In both modes the simulator is the same - but the interface via "aps" as  the simulator is more limited because it dates from when APS had just been implemented and only supported a subset of spectre's capability.



Tuesday, November 24, 2015

Wall-Clock Time

Wall-clock time, or wall time, is the human perception of the passage of time from the start to the completion of a task. In the context of a task being performed on a computer, wall-clock time is a measure of the real time that elapses from start to end, including time that passes due to programmed (artificial) delays or waiting for resources to become available. In other words, it is the difference between the time at which a task finishes and the time at which the task started.

The term is used rather than "real" time to avoid a naming conflict with real-time systems.

Runs and Jobs

So, here we go.  We're talking about 2 forms here.  The first, the Job Policy Setup form, is accessed by selecting Options->Job Setup from the ADE XL window.  The second, where most of the confusion seems to come in, is the Run Options form, accessed by selecting Options->Run Options.

The upper part of the Job Policy Setup form concerns how you want to distribute your simulation runs in ADE XL.  This will vary depending on what type of job distribution system your company uses (LSF, SGE, etc.).   We'll take that up another time.  For now, let's just assume you have some sort of system that lets you fire off simulations onto a farm of machines.

Now we need to define some terms:

A "run" in ADE XL = pressing the green Run button in the UI.  Each "run" could be a single simulation or it could be 100 corner simulations...
A "job" in ADE XL = a remote job that is started for a run.
The way ADE XL works is that each run starts a number of jobs (actually the process is called "ICRP") on whatever machines you tell it to use (local, SGE, LSF, etc).  It uses the "Max. Jobs" field on the Job Policy Setup form to determine the maximum number of those jobs to start.

Those processes stay alive for some "linger time" so that ADE XL can more efficiently start new simulations as needed.  So it will start by sending out a simulation to each job, and then as each simulation completes, it will send that job a new simulation until all simulations in the run are completed.

Remember that.  A "job" is assigned to a  particular "run" and will likely receive a series of simulations to perform (assuming the "run" involves more than a single simulation).

Let's skip to the Run Options form now.

The default in the Run Options form is Serial - i.e. if you hit the green Run button twice, the second run will not use any jobs until the first run completes.

If you set this to Parallel, if you hit the green Run button twice, the runs will start in parallel. They will either share resources equally (which means if Max Jobs = 10, each run will use 5 jobs). Or you can specify - something like 3 jobs per run.

This applies to all run modes--corners, sweeps, Monte Carlo, optimization, etc.

So - for any given run, all jobs run in parallel. However multiple runs in ADE XL are serial by default and can be made parallel.

Now, what about the fields at the bottom of the Job Policy Setup form--For Multiple Runs (reassign immediately or wait until currently running points complete)?

Let's say your setup is:

  • Run in parallel
  • Share resources equally
  • Max jobs = 10.

You start a run and the simulations are going to take 10 minutes. All ten jobs start running the simulations.

Now you start another run after making some changes to the setup.

So -- the question is -- do you want to immediately kill five of the current jobs and re-assign them to the second run or do you want to wait until the first five currently running simulations finish before re-assigning the jobs to the second run.

(Don't worry, the simulations that were killed will be assigned to re-run on one of the (now) five jobs assigned to the first run)

It's an efficiency issue. Do you want to waste the progress already made by the jobs on a simulation or do you want to make sure the subsequent run(s) start right away?

Version and Subversion of Spectre and Virtuoso

Use -V and -W to get version and subversion respectively

Tell Cadence to use 32-bit or 64-bit version software

Add the following line into your cshrc file
setenv    CDS_AUTO_64BIT   {ALL|NONE|"<list>"}
then, the wrapper will try to do as you required.

Prevent Simulation Results From Being Deleted in ADEXL

RMB (right mouse button) on a history item, you can select "Lock" to make sure those results will not be deleted when you hit the maximum number of saved entries.


Thursday, November 19, 2015

Using "save" Statement In Corner Simulation


where the content of  save.scs file is something like:

OPAMP Not Working Issue

The issue is:
when supply power (Vdd) is lower, LDO loses its control to its output. Turns out that at this moment the OPAMP is not working.
As can be seen, the input differential pair are working in linear region, that makes the loop open, and in turn LDO loses its control.

I rised the mirror load, and the new simulation results are:
This is it is still not working properly, the amplifier ran out of steam, so I should be aggressive and shrink the length of the mirror load even further.

Wednesday, November 18, 2015

Fourier Transform of Sampled Signal vs. Discrete Fourier Transform

Save All Terminal Currents Of A Subcircuit

Use the following statement to tell Spectre to save all terminal current flowing into I2
save I2:currents
To examine all subcircuits' terminal current:
save I0:currents
save I0.I202:currents
save I0.I305:currents
save I0.I11:currents
save I0.I198:currents
save I0.I199:currents
save I0.I200:currents


Save All Nets Within A Specified Cell in Spectre

First create save.scs and add the following line:
save I0.I305.*
Then, set save option as
saveOptions options save=selected

There are other variations in "save" statement, e.g.: the following example saves nets within all instances of subcircuit "osc" (use subckt)
save * subckt=osc
and the following example saves all nets up to level 2 (use depth)
save * depth=2





Monday, November 16, 2015

List All Layers in Schematic (Cadence)

Use the SKILL statement:
cv = geGetEditCellView()
foreach(
mapcar lpp cv~>lpps list(lpp~>layerName lpp~>purpose))
and the result is:
(
    ("device" "drawing")
    ("annotate" "drawing8")
    ("annotate" "drawing7")
    ("instance" "label")
    ("pin" "label")
    ("annotate" "drawing2")
    ("annotate" "drawing3")
    ("annotate" "drawing")
    ("pin" "drawing")
    ("instance" "drawing")
    ("text" "drawing")
    ("wire" "drawing")
    ("wire" "label")
    ("annotate" "drawing9")
)

Current Variation for Different Biasing Scheme

A simple circuit for different biasing scheme is simulated, and the results are shown below:

  • For series diode biasing scheme, current variation ranges from 8% to 400% (PVT)
  • For const-gm current biasing scheme, current variation ranges from 50% to 100% (PVT)

Sunday, November 15, 2015

Power::"indet" "Indeterminate expression 0^0 encountered

When using mathematica, the following error encountered:
Power::"indet" "Indeterminate expression 0^0 encountered
That is, Mathematica treats the expression 0^0 (that is Power[0,0]) as indeterminate.
There is an easy solution:
Unprotect[Power];
Power[0,0]=1;
Protect[Power];
After this, 0^0 will evaluate to 1. If you need this in numerical calculations, you should define Power[0 | 0., 0 | 0.] = 1;, which also includes the case 0.^0..

Specify Chart's Decomposition

You specify whether a superstate contains parallel (AND) states or exclusive (OR) states by setting its decomposition. A state whose substates are all active when it is active has parallel (AND) decomposition. A state in which only one substate is active when it is active has exclusive (OR) decomposition. An empty state's decomposition is exclusive.
To alter a state's decomposition, select the state, right-click to display the state's Decomposition context menu, and select OR (Exclusive) or AND (Parallel) from the menu.
You can also specify the state decomposition of a chart. In this case, the Stateflow chart treats its top-level states as substates. The chart creates states with exclusive decomposition. To specify a chart's decomposition, deselect any selected objects, right-click to display the chart's Decomposition context menu, and select OR (Exclusive) or AND (Parallel) from the menu.

The appearance of a superstate's substates indicates the superstate's decomposition. Exclusive substates have solid borders, parallel substates, dashed borders


A parallel substate also contains a number in its upper right corner. The number indicates the activation order of the substate relative to its sibling substates.

Friday, November 13, 2015

Relation Between Fourier Series and Fourier Transform

To see the relation between them, use dimensional analysis. Suppose the signal is dimensionless, then the dimension of its Fourier transform is [TIME], but the coefficient of Fourier series is by definition dimensionless, so it has to be multiplied by a quantity with dimension of [TIME] to get involved with Fourier Transform.
To match dimension,
where,

Centroid

The centroid or geometric center of a plane figure is the arithmetic mean ("average") position of all the points in the shape, mathematically speaking:

Wednesday, November 11, 2015

Final State Files Scrutinizing



Dimension of Fourier Transform of a unitless signal

[ T ]

Telling Spectre to Create a State File

You can instruct the Spectre simulator to create a state file from either the initial point or the final point in an analysis.
  • Write a state file from the initial point:  write
  • Write a state file from the final point:    writefinal

The following is an example of a state file:



Starting Analyses from Previous Solutions (Spectre)

A solution for one analysis can be an appropriate starting point for the next analysis. For example, if a DC analysis precedes a transient analysis, you can use the DC solution as the first guess for the initial point in the transient analysis solution. There are two Spectre analysis parameters that let you start analyses from previous solutions. They are available for most Spectre analyses.
  • The restart parameter
If you set this parameter to restart=no in an analysis statement, the Spectre simulator uses the DC solution of the previous analysis as an initial guess for the following analysis.
  • The prevoppoint parameter
If you set this parameter to prevoppoint=yes in an analysis statement, the Spectre simulator does not compute or recompute the operating point. Instead, it uses the operating point computed by the previous analysis.

Using Nodeset in Spectre Simulation

Nodesets are estimates of the solution you provide for the DC or transient analyses. Nodesets usually act only as aids in speeding convergence, but if a circuit has more than one solution, as with a latch, nodesets can bias the solution to the one closest to the nodeset values.


Sunday, November 8, 2015

Add User Properties to Instance Using SKILL code

sch=geGetEditCellView()
cn="APRIO5V_200"
dbid=car(setof( inst sch~>instances inst~>cellName == cn))
dbReplaceProp(dbid "gnd5vl" "netSet" "gnd5vl")
dbReplaceProp(dbid "gnd5vo" "netSet" "gnd5vo")
dbReplaceProp(dbid "gnd5vr" "netSet" "gnd5vr")
dbReplaceProp(dbid "sub" "netSet" "sub!")
dbReplaceProp(dbid "subc5v" "netSet" "subc")
dbReplaceProp(dbid "trig5v" "netSet" "trig5v")
dbReplaceProp(dbid "vdd5vl" "netSet" "vdd5vl")
dbReplaceProp(dbid "vdd5vo" "netSet" "vdd5vo")
dbReplaceProp(dbid "vdd5vr" "netSet" "vdd5vr")

Returns the Database Object ID for the Cellview Being Edited.

geGetEditCellView
This value is normally the same as that returned by geGetWindowCellView. Only when you are editing a cell in place do the two functions return different results. If you know what window you are interested in, a shorthand equivalent to this function may be used:
window(n)->editCellView

setof

setof
Returns a new list containing only those elements in a list or the keys in an association table that satisfy an expression. This is a syntax form.
setof(
        s_formalVar
        l_valueList
        g_predicateExpression
)
=> l_result 
setof(
        s_formalVar
        o_table
        g_predicateExpression
)
=> l_result

car

car returns the first element of a list. car was a machine language instruction on the first machine to run Lisp. car stands for contents of the address register.

Pin Instance Information in Cadence Schematic

The pin instance has a cellName of "iopin" and is inside "basic" library. (shown below)

ct and c

["x]c{motion}
Delete {motion} text [into register x] and start insert.  When  'cpoptions' includes the 'E' flag and there is no text to delete (e.g., with "cTx" when the cursor is just after an 'x'), an error occurs and insert mode does not start (this is Vi compatible). When  'cpoptions' does not include the 'E' flag, the "c" command always starts insert mode, even if there is no text to delete.


Add "underscore _" in Word Operation in VIM

use iskeyword to include a character as part of a word
        :set iskeyword+=_
use iskeyword to include a character as part of a word
        :set iskeyword-=_



Build a Pulse Generator

XOR with a simple delay element at one of its inputs creates a beautiful pulse generator. It turns a single edge into a pulse.

Thursday, November 5, 2015

Build DFF from TFF

To build DFF from TFF, we must emulate T terminal with input D and state variable Q/QB. (There is only one state, since Q and QB are complementary to each other.)
From the above truth table, we found the function T with respect to D and Q/QB:
So the circuit is: