public class NanosimModel extends SimulationModel
Modifier and Type | Field and Description |
---|---|
protected boolean |
assuraRCXNetlist |
protected static boolean |
DEBUG |
protected static java.util.regex.Pattern |
getSimTime_tres |
protected java.util.List |
jtagTesters
list of jtag testers
|
protected java.util.List |
logicSettables
list of logic settables
|
protected java.util.HashMap |
nodesToSet |
protected static java.util.regex.Pattern |
patNodeInfo |
protected static java.util.regex.Pattern |
patNodeInfo2 |
protected static java.util.regex.Pattern |
patSimTime |
protected double |
simTime |
protected boolean |
starRCXTNetlist |
protected double |
timeStep |
protected double |
vdd |
errorFlag, quitCommand, simulatorName
Constructor and Description |
---|
NanosimModel()
Create a new NanosimModel to simulate the behavior of the real chip
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyVoltages()
This is used to apply all voltages at the same time for the current time step.
|
JtagTester |
createJtagSubchainTester(java.lang.String jtagInBus,
java.lang.String jtagOutBus)
Create a subchain tester based on the 8- or 9-wire jtag interface.
|
JtagTester |
createJtagSubchainTester(java.lang.String phi2,
java.lang.String phi1,
java.lang.String write,
java.lang.String read,
java.lang.String sin,
java.lang.String sout)
Create a subchain tester based on the 5-wire jtag interface.
|
JtagTester |
createJtagTester(java.lang.String tckName,
java.lang.String tmsName,
java.lang.String trstbName,
java.lang.String tdiName,
java.lang.String tdobName)
Create a
JtagTester that can be used to drive the JtagController on the
Software model of the chip. |
LogicSettable |
createLogicSettable(java.util.List portNames)
Create a
LogicSettable that can be used to control a set of ports on
the Software model of the chip. |
LogicSettable |
createLogicSettable(java.lang.String portName)
Create a
LogicSettable that can be used to control a port on
the Software model of the chip. |
void |
disableNode(java.lang.String node)
If supported, disable a node (forces it to 0)
|
void |
enableNode(java.lang.String node)
If supported, enable a node (allows it to be driven)
|
protected java.util.List |
getNodeInfo(java.util.List nodes,
boolean returnState)
Gets the voltages on the nodes, unless returnState is true, in
which case it returns a list of 1's and 0's representing the logic state,
rather than the actual voltages.
|
int |
getNodeState(java.lang.String node)
Get the state of a node.
|
double |
getNodeVoltage(java.lang.String node)
Get the voltage on a node.
|
protected double |
getSimTres()
Get the simulation's time step
|
double |
getSimulationTime()
Get the current simulation time, used for error reporting
|
double |
getTimeNS()
Return the current simulation time in nanoseconds
|
double |
getVdd()
Get the voltage of VDD for the simulation.
|
static void |
main(java.lang.String[] args)
Unit Test
This test requires the file sim.spi in your working dir
|
void |
releaseNodes(java.util.List nodes)
Release any nodes being forced to a value using set node state
|
void |
reportNodeIC()
Saves the state of all nodes at the current time to an external .ic file,
using the report_node_ic command.
|
void |
reportNodeIC(double time)
Saves the state of all nodes at the given time to an external .ic file,
using the report_node_ic command.
|
void |
setNodeState(java.lang.String node,
int state)
Force node to a state.
|
void |
setNodeVoltage(java.lang.String node,
double voltage)
Set a node in the nanosim simulation to the specified voltage.
|
void |
wait(float seconds)
Tell the Chip Model simulation to continue simulating for the
time specified
|
void |
waitNS(double nanoseconds)
Wait the specified number of nano-seconds.
|
protected void |
waitNS(double nanoseconds,
boolean applyVoltages) |
void |
waitPS(double ps)
Wait for the specified number of picoseconds.
|
assertNodeState, assertNodeState, createJtagTester, finish, finishAll, getElapsedTime, getNodeState, getOptimizedDirectReadsWrites, isBypassScanning, isProcessRunning, issueCommand, issueCommand, setAdditionalCommandLineArgs, setBypassScanning, setNodeState, setOptimizedDirectReadsWrites, setPrompt, start, start, startProcess, waitSeconds
protected static final boolean DEBUG
protected final java.util.List jtagTesters
protected final java.util.List logicSettables
protected double simTime
protected double vdd
protected double timeStep
protected final java.util.HashMap nodesToSet
protected boolean assuraRCXNetlist
protected boolean starRCXTNetlist
protected static final java.util.regex.Pattern patSimTime
protected static final java.util.regex.Pattern getSimTime_tres
protected static final java.util.regex.Pattern patNodeInfo
protected static final java.util.regex.Pattern patNodeInfo2
public NanosimModel()
public JtagTester createJtagTester(java.lang.String tckName, java.lang.String tmsName, java.lang.String trstbName, java.lang.String tdiName, java.lang.String tdobName)
SimulationModel
JtagTester
that can be used to drive the JtagController on the
Software model of the chip. The arguments specify the port names specific
to the software model that correspond to the Jtag Controller ports.createJtagTester
in class SimulationModel
tckName
- name of the input port for TCKtmsName
- name of the input port for TMStrstbName
- name of the input port for TRSTbtdiName
- name of the input port for TDItdobName
- name of the input port for TDObpublic JtagTester createJtagSubchainTester(java.lang.String jtagInBus, java.lang.String jtagOutBus)
createJtagSubchainTester
in class SimulationModel
jtagInBus
- the name of the 9-bit wide input bus, i.e. "jtagIn" or "jtagIn[8:0]"jtagOutBus
- the name of the 9-bit wide output bus, i.e. "jtagOut" or "jtagOut[8:0]"public JtagTester createJtagSubchainTester(java.lang.String phi2, java.lang.String phi1, java.lang.String write, java.lang.String read, java.lang.String sin, java.lang.String sout)
createJtagSubchainTester
in class SimulationModel
phi2
- name of the phi2 signalphi1
- name of the phi1 signalwrite
- name of the write signalread
- name of the read signalsin
- name of the scan data in signalsout
- name of the scan data out signalpublic LogicSettable createLogicSettable(java.lang.String portName)
SimulationModel
LogicSettable
that can be used to control a port on
the Software model of the chip.createLogicSettable
in class SimulationModel
portName
- the name of the port to control.public LogicSettable createLogicSettable(java.util.List portNames)
SimulationModel
LogicSettable
that can be used to control a set of ports on
the Software model of the chip. The ports then act as if they have
been tied together.createLogicSettable
in class SimulationModel
portNames
- a list of Strings of port names to be controlled.public void disableNode(java.lang.String node)
SimulationModel
disableNode
in class SimulationModel
node
- the name of the nodepublic void enableNode(java.lang.String node)
SimulationModel
enableNode
in class SimulationModel
node
- the name of the nodepublic double getSimulationTime()
SimulationModel
getSimulationTime
in class SimulationModel
public double getVdd()
getVdd
in class SimulationModel
public void wait(float seconds)
SimulationModel
wait
in interface ChipModel
wait
in class SimulationModel
seconds
- number of seconds to continue simulatingpublic void waitNS(double nanoseconds)
waitNS
in interface ChipModel
waitNS
in class SimulationModel
nanoseconds
- the time to wait (simulate) in nanosecondsprotected void waitNS(double nanoseconds, boolean applyVoltages)
public void waitPS(double ps)
ChipModel
waitPS
in interface ChipModel
waitPS
in class SimulationModel
ps
- the number of picoseconds to wait.public double getTimeNS()
SimulationModel
getTimeNS
in class SimulationModel
protected double getSimTres()
public void setNodeState(java.lang.String node, int state)
setNodeState
in class SimulationModel
node
- the hierarchical spice node namestate
- the state to set to, must be 1 or 0.public void setNodeVoltage(java.lang.String node, double voltage)
node
- the hierarchical spice node namevoltage
- the voltage to set the node toprotected void applyVoltages()
public void releaseNodes(java.util.List nodes)
SimulationModel
releaseNodes
in class SimulationModel
nodes
- a list of node names (strings)public int getNodeState(java.lang.String node)
getNodeState
in class SimulationModel
node
- the hierarchical spice node namepublic double getNodeVoltage(java.lang.String node)
node
- the hierarchical spice node nameprotected java.util.List getNodeInfo(java.util.List nodes, boolean returnState)
nodes
- the nodes to queryreturnState
- true to convert voltages to 1 or 0 logic statespublic void reportNodeIC(double time)
time
- time in nanosecondspublic void reportNodeIC()
public static void main(java.lang.String[] args)