public class DLUnit
extends java.lang.Object
DLUnit
interface: Use these methods to drive the underlying simulator and query its final
state.Modifier and Type | Method and Description |
---|---|
static long |
readMemorySigned(java.lang.String name,
long address)
Get the value in the memory as a signed long integer
|
static long[] |
readMemorySigned(java.lang.String name,
long start,
int length)
Get the values in the memory as signed long integers
|
static long |
readMemoryUnsigned(java.lang.String name,
long address)
Get the value in the memory as a signed long integer
|
static long[] |
readMemoryUnsigned(java.lang.String name,
long start,
int length)
Get the values in the memory as unsigned long integers
|
static boolean |
readPin(java.lang.String name)
Get the value of a single output pin
|
static long |
readPinSigned(java.lang.String name)
Get the value on pin
name as a signed integer (i.e., interpret the most significant bit as a sign bit). |
static long |
readPinUnsigned(java.lang.String name)
Get the value on pin
name as an unsigned integer. |
static boolean |
readRegister(java.lang.String name)
Get the value of a one-bit register
|
static long |
readRegisterSigned(java.lang.String name)
Get the value in register
name as a signed integer (i.e., interpret the most significant bit as a sign
bit). |
static long |
readRegisterUnsigned(java.lang.String name)
Get the value in register
name as an unsigned integer. |
static void |
reset()
Reset the simulator.
|
static void |
run()
Execute the simulator
|
static void |
setMemorySigned(java.lang.String name,
int beginningWordAddress,
int value)
Sets memory
|
static void |
setMemorySigned(java.lang.String name,
int beginningWordAddress,
int[] values)
Sets memory
|
static void |
setMemoryUnsigned(java.lang.String name,
int beginningWordAddress,
int value)
Sets memory as unsigned (positive) integers
|
static void |
setMemoryUnsigned(java.lang.String name,
int beginningWordAddress,
int[] values)
Sets memory as unsigned (positive) integers
|
static void |
setPin(java.lang.String name,
boolean value)
Set a one-bit input pin.
|
static void |
setPinSigned(java.lang.String name,
long value)
Set an input bus (multiple pins bundled together as a single unit).
|
static void |
setPinUnsigned(java.lang.String name,
long value)
Set an input bus (multiple pins bundled together as a single unit).
|
static void |
setRegister(java.lang.String name,
boolean value)
Set a one-bit register.
|
static void |
setRegisterSigned(java.lang.String name,
long value)
Set a register.
|
static void |
setRegisterUnsigned(java.lang.String name,
long value)
Set a register.
|
static java.util.List<java.lang.String> |
testParameters()
Get the test parameters.
|
public static void reset()
public static java.util.List<java.lang.String> testParameters()
List
of parameters for the testpublic static void setPin(java.lang.String name, boolean value) throws NoSuchElementException, InvalidElementException, InvalidWidthException
name
- the name of the input pinvalue
- the value to be set (true
or false
).NoSuchElementException
- If there is no input pin named name
InvalidElementException
- If name
is not an input pinInvalidWidthException
- If the input pin does not have width 1.public static void setPinSigned(java.lang.String name, long value) throws NoSuchElementException, InvalidElementException, InvalidWidthException
name
- the name of the input pinvalue
- the value to be setNoSuchElementException
- if there is no input pin named (key
)InvalidElementException
- If name
is not an input pinInvalidWidthException
- if the input pin is not wide enough (i.e., does not have enough bits) to represent
value
public static void setPinUnsigned(java.lang.String name, long value) throws NoSuchElementException, InvalidElementException, InvalidWidthException, IllegalValueException
name
- the name of the input pinvalue
- the value to be setNoSuchElementException
- if there is no input pin named (key
)InvalidElementException
- If name
is not an input pinInvalidWidthException
- if the input pin is not wide enough (i.e., does not have enough bits) to represent
value
IllegalValueException
- if value
is negativepublic static boolean readPin(java.lang.String name) throws NoSuchElementException, InvalidElementException, InvalidWidthException
name
- the name of the output pintrue
if the pin is set, false
otherwiseNoSuchElementException
- if there is no output pin named (name
)InvalidElementException
- If name
is not an output pinInvalidWidthException
- if name
is not one bit wide.public static long readPinSigned(java.lang.String name) throws NoSuchElementException, InvalidElementException
name
as a signed integer (i.e., interpret the most significant bit as a sign bit).name
- the name of the output pinname
as a signed integerNoSuchElementException
- if there is no output pin named (name
)InvalidElementException
- If name
is not an output pinpublic static long readPinUnsigned(java.lang.String name) throws NoSuchElementException, InvalidElementException
name
as an unsigned integer.name
- the name of the output pinname
as an unsigned integerNoSuchElementException
- if there is no output pin named (name
)InvalidElementException
- If name
is not an output pinpublic static void setRegister(java.lang.String name, boolean value) throws NoSuchElementException, InvalidElementException, InvalidWidthException
name
- the name of the registervalue
- the value to be set (true
or false
).NoSuchElementException
- If there is no register named name
InvalidElementException
- If name
is not a registerInvalidWidthException
- If the register does not have width 1.public static void setRegisterSigned(java.lang.String name, long value) throws NoSuchElementException, InvalidElementException, InvalidWidthException
name
- the name of the registervalue
- the value to be setNoSuchElementException
- if there is no register named (key
)InvalidElementException
- If name
is not a registerInvalidWidthException
- if the register is not wide enough (i.e., does not have enough bits) to represent
value
public static void setRegisterUnsigned(java.lang.String name, long value) throws NoSuchElementException, InvalidElementException, InvalidWidthException, IllegalValueException
name
- the name of the registervalue
- the value to be setNoSuchElementException
- if there is no register named (key
)InvalidElementException
- If name
is not a registerInvalidWidthException
- if the register is not wide enough (i.e., does not have enough bits) to represent
value
IllegalValueException
- if value
is negativepublic static boolean readRegister(java.lang.String name) throws NoSuchElementException, InvalidElementException, InvalidWidthException
name
- the name of the registertrue
if the register, false
otherwiseNoSuchElementException
- if there is no register named (name
)InvalidElementException
- if name
is not a registerInvalidWidthException
- if name
is not one bit widepublic static long readRegisterSigned(java.lang.String name) throws NoSuchElementException, InvalidElementException
name
as a signed integer (i.e., interpret the most significant bit as a sign
bit).name
- the name of the registername
as a signed integerNoSuchElementException
- if there is no register named (name
)InvalidElementException
- if name
is not a registerpublic static long readRegisterUnsigned(java.lang.String name) throws NoSuchElementException, InvalidElementException
name
as an unsigned integer.name
- the name of the registername
as an unsigned integerNoSuchElementException
- if there is no register named (name
)InvalidElementException
- if name
is not a registerpublic static void setMemorySigned(java.lang.String name, int beginningWordAddress, int[] values) throws NoSuchElementException, InvalidElementException
name
- the name of the memory.beginningWordAddress
- word address of the first word to be setvalues
- an array of word values to be set. (The entire array will be set.)NoSuchElementException
- If there is no memory named name
InvalidElementException
- If name
is not a memorypublic static void setMemorySigned(java.lang.String name, int beginningWordAddress, int value) throws NoSuchElementException, InvalidElementException
name
- the name of the memory.beginningWordAddress
- word address of the first word to be setvalue
- the word value to be setNoSuchElementException
- If there is no memory named name
InvalidElementException
- If name
is not a memorypublic static void setMemoryUnsigned(java.lang.String name, int beginningWordAddress, int[] values) throws NoSuchElementException, InvalidElementException
name
- the name of the memory.beginningWordAddress
- word address of the first word to be setvalues
- an array of word values to be set. (The entire array will be set.)NoSuchElementException
- If there is no memory named name
InvalidElementException
- If name
is not a memorypublic static void setMemoryUnsigned(java.lang.String name, int beginningWordAddress, int value) throws NoSuchElementException, InvalidElementException
name
- the name of the memory.beginningWordAddress
- word address of the first word to be setvalue
- the value to be setNoSuchElementException
- If there is no memory named name
InvalidElementException
- If name
is not a memorypublic static long[] readMemorySigned(java.lang.String name, long start, int length) throws NoSuchElementException, InvalidElementException
name
- the memory namestart
- the first word address to retrievelength
- the number of word addresses to retrieveNoSuchElementException
- if a memory named name
can't be foundInvalidElementException
- if name
is not the correct type of elementpublic static long readMemorySigned(java.lang.String name, long address) throws NoSuchElementException, InvalidElementException
name
- the memory nameaddress
- the word address to retreiveNoSuchElementException
- if a memory named name
can't be foundInvalidElementException
- if name
is not the correct type of elementpublic static long[] readMemoryUnsigned(java.lang.String name, long start, int length) throws NoSuchElementException, InvalidElementException
name
- the memory namestart
- the first word address to retrievelength
- the number of word addresses to retrieveNoSuchElementException
- if a memory named name
can't be foundInvalidElementException
- if name
is not the correct type of elementpublic static long readMemoryUnsigned(java.lang.String name, long address) throws NoSuchElementException, InvalidElementException
name
- the memory nameaddress
- the word address to retrieveNoSuchElementException
- if a memory named name
can't be foundInvalidElementException
- if name
is not the correct type of elementpublic static void run()