public class ChainControl extends Logger
ChipNode
->ChainNode
->
SubchainNode
->SubchainNode
..., where there
can be multiple ChainNode
entries per ChipNode
and multiple SubchainNode
entries per ChainNode
or SubchainNode
. The system node is a TestNode
object. The division of a scan chain into sub chains is for convenience in
accessing particular scan chain elements, and does not necessarily correspond
to any physical hierarchy on the chip.
To program a scan chain, one uses a setInBits(java.lang.String, com.sun.electric.tool.simulation.test.BitVector)
method to specify new values for the chain elements. Scan chain values
can be set using BitVector
objects or strings. Strings are
appropriate for simple set commands, but the BitVector
class
supports more sophisticated manipulations. As a starting point for
BitVector
manipulations, one may wish to use the method
getInBits(java.lang.String)
to retrieve the current value of the bit
sequence to scan in to the chips.
By convention, the first bit in a BitVector
or character in a
string always represents the last bit scanned into or out of the chip. Thus
1) the bit and character indices match the position of the corresponding scan
chain element along the s_in chain, 2) the strings match the left-to-right
order in which scan chain elements appear in most schematics, and 3) the
order is consistent with the order of scan chain nodes in the XML file.
Also by convention, the node path names used in this class start at the chip node (e.g., "miniHeater.pScan.row "). I.e., they exclude the system node.
The class also provides convenience methods like
getChips()
, which returns an array of the chips in the
system, and getChainPaths(java.lang.String)
, which returns an array of
the chains in a single chip or in the entire system.
Here is an example of how to create a ChainControl
object:
JtagTester jtag = new Netscan4(JTAG_IP_ADDRESS, JTAG_TAP_NUMBER);The JTAG_TAP_NUMBER parameter must be omitted when using the
ChainControl control = new ChainControl(XML_PATH, jtag, DEFAULT_VDD, DEFAULT_TCK_KHZ);
Netscan
or MockJtag
  constructors.
The user can then call setInBits(java.lang.String, com.sun.electric.tool.simulation.test.BitVector)
and shift(java.lang.String, boolean, boolean, int, int, int)
to
program scan chains.Modifier and Type | Field and Description |
---|---|
int |
errTestSeverity
Default action when the bits shifted out of the data register are
inconsistent with expectation, see
getExpectedBits(java.lang.String) . |
int |
irBadSeverity
Default action when the bits shifted out of the IR register are bad.
|
int |
noTestSeverity
Default action when no consistency check is possible on bits shifted out
of the data register.
|
protected com.sun.electric.tool.simulation.test.TestNode |
system
The root of the scan chain hierarchy.
|
java.lang.String |
xmlFile
XML file read in
|
Constructor and Description |
---|
ChainControl(java.lang.String fileName,
JtagTester jtagTester,
float jtagVolts,
int jtagKhz)
Creates an object to program scan chains using the boundary scan
controller
jtagTester and assuming the scan chain
hierarchy specified in the XML file fileName . |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize()
Finalizer.
|
MyTreeNode |
findNode(java.lang.String path)
Find a node using its full path, excluding the name of the system node.
|
MyTreeNode |
findNode(java.lang.String path,
java.lang.Class expected)
Find a node using its full path, excluding the name of the system node.
|
MyTreeNode |
findNode(java.lang.String path,
MyTreeNode root)
Find a node using the path relative to a specified root node.
|
java.lang.String[] |
getChainPaths()
Returns path strings to all of the root scan chains in the system.
|
java.lang.String[] |
getChainPaths(java.lang.String chipName)
Returns path strings to all of the root scan chains for the specified
chip.
|
java.lang.String[] |
getChips()
Returns path strings to all of the chips in the system
|
java.lang.String[] |
getDescendents(java.lang.String path)
Returns path strings to all of the nodes below the specified node in the
scan chain hierarchy.
|
BitVector |
getExpectedBits(java.lang.String path)
Return a copy of the scan chain bit pattern that the library expected to
be shifted out of the specified node during the previous call
to
shift(java.lang.String, boolean, boolean, int, int, int) for the parent chain. |
BitVector |
getInBits(java.lang.String path)
Return a copy of the scan chain bit pattern that will be written to
specified node on chip during the next
shift(java.lang.String, boolean, boolean, int, int, int)
call. |
JtagTester |
getJtag()
Returns device-independent JTAG tester object
|
int |
getJtagKhz()
Returns nominal frequency for JTAG TCK, in kHz
|
float |
getJtagVolts()
Returns nominal voltage for JTAG TAP and chip power, in Volts
|
int |
getLength(java.lang.String path)
Return the number of scan chain elements within a given (subchain) node
in the scan chain.
|
int |
getLenIR()
Return the sum of the instruction register lengths for all of the chips
in the test system.
|
int |
getLenIR(java.lang.String chip)
Return the length of a single chip's instruction register
|
java.lang.String |
getOpcode(java.lang.String chainRoot)
Return the opcode of a root scan chain, with little endian bit ordering.
|
BitVector |
getOutBits(java.lang.String path)
Return a copy of the scan chain bit pattern that was written to specified
node on chip after the last
shift(java.lang.String, boolean, boolean, int, int, int) call. |
java.lang.String |
getParentChain(java.lang.String path)
Return the path to the scan chain that specified node is a sub-chain of
|
java.lang.String |
getSubchainPin(java.lang.String path)
Get the pin name for the selected
SubchainNode object. |
MyTreeNode |
getSystem()
Get the system node
|
java.lang.String |
getXmlFile()
Returns the xml file read by this chain control
|
void |
invalidate(java.lang.String chipName)
Invalidate expected scan chain element values for every scan chain on the
chip.
|
static void |
main(java.lang.String[] args)
Unit test
|
void |
processMasterClear(java.lang.String chipName)
Inform the test library about a change in the state of the master clear
signal on the specified chip.
|
void |
resetInBits()
For each scan chain in the system (on every chip), set the bit pattern
that will be written during the next shift() call to zero, or to
the clears state if clearable.
|
void |
resetInBits(boolean useMasterClearState)
For each scan chain in the system (on every chip), set the bit pattern
that will be written during the next shift() call to zero.
|
void |
setInBits(java.lang.String path,
BitVector newBits)
Set scan chain bit pattern that will be written to specified node on chip
after the next shift() call.
|
void |
setInBits(java.lang.String chainPath,
boolean newValue)
Set scan chain bit pattern that will be written to specified node on chip
after the next shift() call.
|
void |
setInBits(java.lang.String path,
java.lang.String newBits)
Set scan chain bit pattern that will be written to specified node on chip
after the next shift() call.
|
void |
setJtagKhz(int defaultKHz)
Configures the JTAG tester to use the requested TCK frequency.
|
void |
setJtagVolts(float defaultVdd)
Configures the JTAG tester to use the requested TAP voltage.
|
void |
setSubchainPin(java.lang.String path,
java.lang.String pin)
Set the pin name for the selected
SubchainNode object. |
boolean |
shift(java.lang.String chainRoot,
boolean readEnable,
boolean writeEnable)
Shift
inBits (cf. |
boolean |
shift(java.lang.String chainRoot,
boolean readEnable,
boolean writeEnable,
int irBadSeverity,
int noTestSeverity,
int errTestSeverity)
Shift
inBits (cf. |
boolean |
shiftOneBit(java.lang.String chainRoot,
boolean readEnable,
boolean writeEnable,
int irBadSeverity)
Experts only: shift one bit of data from
inBits (cf. |
isLogInits, isLogOthers, isLogSets, logInit, logOther, logSet, setAllLogging, setLogInits, setLogOthers, setLogSets, toString
protected com.sun.electric.tool.simulation.test.TestNode system
public int irBadSeverity
Infrastructure.SEVERITY_FATAL
.public int noTestSeverity
Infrastructure.SEVERITY_WARNING
.public int errTestSeverity
getExpectedBits(java.lang.String)
. Initial
value is Infrastructure.SEVERITY_FATAL
.public java.lang.String xmlFile
public ChainControl(java.lang.String fileName, JtagTester jtagTester, float jtagVolts, int jtagKhz)
jtagTester
and assuming the scan chain
hierarchy specified in the XML file fileName
. For more
information on the XML file, see ChainG.dtd and "The Scan Chain XML File
Format" .
Configures the provided JTAG tester to the TAP voltage
jtagVolts
, frequency jtagKhz
, and the
default stop state NetscanGeneric.DEFAULT_STOP_STATE
. The
TRSTbar signal is also set LO briefly to reset the JTAG
controller for each chip on this JTAG tester.
The jtagVolts
and jtagKhz
parameters are
also used sometimes as the default Vdd and JTAG frequency values. E.g.,
after generating a Schmoo plot, ChainTest
leaves Vdd at
jtagVolts
and the JTAG tester at jtagKhz
.
Nevertheless, this constructor does not itself modify Vdd.
fileName
- Name of XML file containing scan chain descriptionjtagTester
- JTAG tester object to usejtagVolts
- Nominal JTAG TAP voltage and default value of Vdd, in Volts.jtagKhz
- Nominal frequency for JTAG TCK, in kHz.public MyTreeNode getSystem()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public JtagTester getJtag()
public float getJtagVolts()
public void setJtagVolts(float defaultVdd)
defaultVdd
- JTAG tester TAP voltage/nominal chip power, in Voltspublic int getJtagKhz()
public java.lang.String getXmlFile()
public void setJtagKhz(int defaultKHz)
defaultKHz
- Nominal frequency for JTAG TCK, in kHzpublic java.lang.String getSubchainPin(java.lang.String path)
SubchainNode
object.
Currently the pin name is only used by SamplerControl
.path
- path name to the desired SubchainNode
objectpublic void setSubchainPin(java.lang.String path, java.lang.String pin)
SubchainNode
object.
Currently the pin name is only used by SamplerControl
.path
- path name to the desired SubchainNode
objectpin
- name of I/O pad associated with the selected subchainpublic int getLength(java.lang.String path)
path
- path name to the desired node, starting at the chip nodepublic BitVector getInBits(java.lang.String path)
shift(java.lang.String, boolean, boolean, int, int, int)
call. The first element of the bit vector represents the scan chain
element that is scanned in last.path
- path name to the desired node, starting at the chip nodepublic BitVector getOutBits(java.lang.String path)
shift(java.lang.String, boolean, boolean, int, int, int)
call. The
first element of the bit vector represents the scan chain element that is
scanned out last.path
- path name to the desired node, starting at the chip nodepublic BitVector getExpectedBits(java.lang.String path)
shift(java.lang.String, boolean, boolean, int, int, int)
for the parent chain. This is useful for tracking
down problems when the scanned out bits don't equal the expectation. Bits
that are in the invalid state correspond to chain elements for which no
prediction was possible.
(Expert users: the method returns an archival copy of the state of
outBitsExpected
during the previous consistency check.)
path
- path name to the desired node, starting at the chip nodepublic void setInBits(java.lang.String path, BitVector newBits)
path
- path name to the desired node, starting at the chip nodenewBits
- Bit array containing new settingspublic void setInBits(java.lang.String path, java.lang.String newBits)
path
- path name to the desired node, starting at the chip nodenewBits
- Character string containing new settings (e.g., "111001")public void setInBits(java.lang.String chainPath, boolean newValue)
chainPath
- path name to the desired node, starting at the chip nodenewValue
- new bit value to set each scan chain element topublic void resetInBits()
public void resetInBits(boolean useMasterClearState)
useMasterClearState
- sets the bit to the clears state instead of
zero if clearable.public void processMasterClear(java.lang.String chipName)
getExpectedBits(java.lang.String)
) bit for any
scan chain element that has a clears value of "H", "
L", or "?" in the scan chain XML file. For more
information on the clears parameter, see "The Scan Chain XML File
Format" . Call this method on any change in the master clear state,
or you may get false complaints about data shifted out not equalling
expected results.chipName
- chip namepublic void invalidate(java.lang.String chipName)
chipName
- chip namepublic boolean shift(java.lang.String chainRoot, boolean readEnable, boolean writeEnable, int irBadSeverity, int noTestSeverity, int errTestSeverity)
inBits
(cf. setInBits(java.lang.String, com.sun.electric.tool.simulation.test.BitVector)
) into a root scan
chain on the chip. Like shift(String, boolean, boolean)
, except
that the response to the possible error conditions are specified
explicitly using the Infrastructure.SEVERITY_* constants. The bits that
are shifted out (see getOutBits(java.lang.String)
) are compared with expectation
(see getExpectedBits(java.lang.String)
).chainRoot
- path name to the root scan chain, starting at the chip nodereadEnable
- true to enable reading from the scan chain latches.writeEnable
- true to enable writing to the scan chain latches.irBadSeverity
- action when bits scanned out of the instruction register are
wrongnoTestSeverity
- action when no consistency check is possibleerrTestSeverity
- action when consistency check on scan chain functioning failsInfrastructure.SEVERITY_NOMESSAGE
,
Infrastructure.SEVERITY_WARNING
,
Infrastructure.SEVERITY_NONFATAL
,
Infrastructure.SEVERITY_FATAL
public boolean shift(java.lang.String chainRoot, boolean readEnable, boolean writeEnable)
inBits
(cf. setInBits(java.lang.String, com.sun.electric.tool.simulation.test.BitVector)
) into a root scan
chain on the chip. Like
shift(String, boolean, boolean, int, int, int)
, except the
response to the possible error conditions are specified the member
variables irBadSeverity
,noTestSeverity
, and
errTestSeverity
. The bits that are shifted out (see
getOutBits(java.lang.String)
) are compared with expectation (see
getExpectedBits(java.lang.String)
).chainRoot
- path name to the root scan chain, starting at the chip nodereadEnable
- true to enable reading from the scan chain latches.writeEnable
- true to enable writing to the scan chain latches.public boolean shiftOneBit(java.lang.String chainRoot, boolean readEnable, boolean writeEnable, int irBadSeverity)
inBits
(cf.
setInBits(java.lang.String, com.sun.electric.tool.simulation.test.BitVector)
) into a root scan chain on the chip. When this method
is used, the library does not attempt to keep track of the on-chip scan
chain states. Thus no consistency check is performed on the bit that is
shifted out, nor on the next shift.chainRoot
- path name to the root scan chain, starting at the chip nodereadEnable
- true to enable reading from the scan chain latches.writeEnable
- true to enable writing to the scan chain latches.irBadSeverity
- action when bits scanned out of the instruction register are
wrongInfrastructure.SEVERITY_NOMESSAGE
,
Infrastructure.SEVERITY_WARNING
,
Infrastructure.SEVERITY_NONFATAL
,
Infrastructure.SEVERITY_FATAL
public java.lang.String[] getChips()
public java.lang.String[] getChainPaths(java.lang.String chipName)
chipName
- name of the chippublic java.lang.String[] getChainPaths()
public java.lang.String[] getDescendents(java.lang.String path)
path
- name of the node to find descendents ofpublic java.lang.String getParentChain(java.lang.String path)
path
- path of sub-chain to find parent ofpublic int getLenIR(java.lang.String chip)
chip
- name of chippublic int getLenIR()
public java.lang.String getOpcode(java.lang.String chainRoot)
chainRoot
- name of the root scan chain to querypublic MyTreeNode findNode(java.lang.String path, MyTreeNode root)
path
- path name, starting below rootroot
- root an ancestor to the node being looked uppublic MyTreeNode findNode(java.lang.String path)
path
- path name, starting at the chip nodepublic MyTreeNode findNode(java.lang.String path, java.lang.Class expected)
expected
.path
- path name, starting at the chip nodeexpected
- class of node that is expectedpublic static void main(java.lang.String[] args)