|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
byucc.jhdl.base.BV
byucc.jhdl.base.ConstBV
This class extends BV to provide a constant value. The value of a ConstBV can only be set during construction; after that it can only be read, not modified. This is the style that java.lang.Integer and other numeric classes follow. For more information about what is available, @see BV.
Field Summary |
Fields inherited from class byucc.jhdl.base.BV |
BYTE_MASK, DETERMINE_FROM_STRING, INT_MASK, is_signed, SHORT_MASK, SIGN_EXT, SIGNED, UNSIGNED, value, width, ZERO_PAD |
Constructor Summary | |
ConstBV()
Creates a ConstBV of width 1 and value 0. |
|
ConstBV(BV vector)
Creates a ConstBV of identical width (also short for (ConstBV)clone()). |
|
ConstBV(BV[] bv_array)
Creates a ConstBV by concatenating the given BVs, with the BV in slot 0 providing the least significant bits. |
|
ConstBV(BV bv1,
BV bv2)
Creates a ConstBV by concatenating the given BVs, with the first argument providing the least significant bits. |
|
ConstBV(BV bv1,
BV bv2,
BV bv3)
Creates a ConstBV by concatenating the given BVs, with the first argument providing the least significant bits. |
|
ConstBV(BV bv1,
BV bv2,
BV bv3,
BV bv4)
Creates a ConstBV by concatenating the given BVs, with the first argument providing the least significant bits. |
|
ConstBV(int width)
Creates a ConstBV of specified width and value 0. |
|
ConstBV(int width,
boolean value)
Creates a ConstBV of arbitrary width, set to true (1) or false (0). |
|
ConstBV(int width,
boolean value,
boolean sign_ext)
Creates a ConstBV of arbitrary width, set to true or false. |
|
ConstBV(int width,
BV vector)
Creates a ConstBV of arbitrary width, with zero-padding as necessary. |
|
ConstBV(int width,
BV vector,
boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary. |
|
ConstBV(int width,
byte value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary. |
|
ConstBV(int width,
byte value,
boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary. |
|
ConstBV(int width,
char value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary. |
|
ConstBV(int width,
char value,
boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary. |
|
ConstBV(int width,
int value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary. |
|
ConstBV(int width,
int[] value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary. |
|
ConstBV(int width,
int[] value,
boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary. |
|
ConstBV(int width,
int value,
boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary. |
|
ConstBV(int width,
long value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary. |
|
ConstBV(int width,
long value,
boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary. |
|
ConstBV(int width,
short value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary. |
|
ConstBV(int width,
short value,
boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary. |
|
ConstBV(int width,
java.lang.String value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary. |
|
ConstBV(int width,
java.lang.String value,
boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary. |
|
ConstBV(java.lang.String value)
Creates a ConstBV of width DETERMINE_FROM_STRING. |
|
ConstBV(Wire w)
Creates a ConstBV with value 0 and width of the wire argument. |
Method Summary | |
protected BV |
initFromString(int width,
java.lang.String value,
boolean sign_ext)
Overrides initFromString of BV: Can only be called within a constructor. |
protected boolean |
initWidth(int width)
Overrides initWidth of BV: Can only be called within a constructor. |
BV |
setValue(boolean value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(boolean value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(BV vector)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(BV[] bv_array)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(BV vector,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(BV bv1,
BV bv2)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(BV bv1,
BV bv2,
BV bv3)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(BV bv1,
BV bv2,
BV bv3,
BV bv4)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(byte value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(byte value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(char value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(char value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int[] value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int[] value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
boolean value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
BV vector)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
BV vector,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
byte value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
byte value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
char value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
char value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
int value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
int[] value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
int[] value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
int value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
long value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
long value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
short value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
short value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
java.lang.String value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(int width,
java.lang.String value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(long value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(long value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(short value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(short value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(java.lang.String value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setValue(java.lang.String value,
boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setWidth(int width)
Overrides setWidth of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setWidth(int width,
boolean sign_ext)
Overrides setWidth of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setWidth(Wire w)
Overrides setWidth of BV: throws BVException, since ConstBV cannot be modified after creation. |
BV |
setWidth(Wire w,
boolean sign_ext)
Overrides setWidth of BV: throws BVException, since ConstBV cannot be modified after creation. |
java.lang.String |
toString()
Displays a BV as "(width bits)0xvalue", where value is in hexadecimal, and separated by spaces every 8 characters for legibility. |
protected boolean |
verify()
Checks whether a method may modify a BV - in the case of ConstBV, the result is an exception |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ConstBV()
public ConstBV(int width)
width
- The width of the vector.public ConstBV(Wire w)
w
- The wire to determine width from.public ConstBV(int width, boolean value)
width
- The width of the vector.value
- The value of the vector.public ConstBV(int width, boolean value, boolean sign_ext)
width
- The width of the vector.value
- The value of the vector.sign_ext
- Either ZERO_PAD or SIGN_EXT.public ConstBV(int width, byte value)
width
- The width of the vector.value
- Up to 8 bits of the vector.public ConstBV(int width, byte value, boolean sign_ext)
width
- The width of the vector.value
- Up to 8 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.public ConstBV(int width, char value)
width
- The width of the vector.value
- Up to 16 bits of the value.public ConstBV(int width, char value, boolean sign_ext)
width
- The width of the vector.value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.public ConstBV(int width, short value)
width
- The width of the vector.value
- Up to 16 bits of the value.public ConstBV(int width, short value, boolean sign_ext)
width
- The width of the vector.value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.public ConstBV(int width, int value)
width
- The width of the vector.value
- Up to 32 bits of the value.public ConstBV(int width, int value, boolean sign_ext)
width
- The width of the vector.value
- Up to 32 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.public ConstBV(int width, long value)
width
- The width of the vector.value
- Up to 64 bits of the value.public ConstBV(int width, long value, boolean sign_ext)
width
- The width of the vector.value
- Up to 64 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.public ConstBV(int width, int[] value)
width
- The width of the vector.value
- An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).public ConstBV(int width, int[] value, boolean sign_ext)
width
- The width of the vector.value
- An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).sign_ext
- Either ZERO_PAD or SIGN_EXT.public ConstBV(BV vector)
vector
- The original BV.public ConstBV(BV bv1, BV bv2)
bv1
- The least significant bits.bv2
- The next bits.public ConstBV(BV bv1, BV bv2, BV bv3)
bv1
- The least significant bits.bv2
- The next bits.bv3
- The next bits.public ConstBV(BV bv1, BV bv2, BV bv3, BV bv4)
bv1
- The least significant bits.bv2
- The next bits.bv3
- The next bits.bv4
- The next bits.public ConstBV(BV[] bv_array)
bv_array
- The array of BVs, least significant bits in slot 0.
BVException
- if the array contains only null pointers.public ConstBV(int width, BV vector)
width
- The width of the new vector.vector
- Original BV.public ConstBV(int width, BV vector, boolean sign_ext)
width
- The width of the new vector.vector
- Original BV.sign_ext
- Either ZERO_PAD or SIGN_EXT.public ConstBV(java.lang.String value)
value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic ConstBV(int width, java.lang.String value)
width
- The width of the new vector.value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberpublic ConstBV(int width, java.lang.String value, boolean sign_ext)
width
- The width of the new vector.value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.sign_ext
- Either ZERO_PAD or SIGN_EXT.
java.lang.NumberFormatException
- if the string cannot be parsed as a valid numberMethod Detail |
public final BV setValue(boolean value)
setValue
in class BV
value
- The value of the vector.
BVException
- ConstBVs cannot be modified.public final BV setValue(boolean value, boolean sign_ext)
setValue
in class BV
value
- The value of the vector.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, boolean value, boolean sign_ext)
setValue
in class BV
width
- New width of BV.value
- The value of the vector.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(byte value)
setValue
in class BV
value
- Up to 8 bits of the vector.
BVException
- ConstBVs cannot be modified.public final BV setValue(byte value, boolean sign_ext)
setValue
in class BV
value
- Up to 8 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, byte value)
setValue
in class BV
width
- New width of BV.value
- Up to 8 bits of the value.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, byte value, boolean sign_ext)
setValue
in class BV
width
- New width of BV.value
- Up to 8 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(char value)
setValue
in class BV
value
- Up to 16 bits of the value.
BVException
- ConstBVs cannot be modified.public final BV setValue(char value, boolean sign_ext)
setValue
in class BV
value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, char value)
setValue
in class BV
width
- New width of BV.value
- Up to 16 bits of the value.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, char value, boolean sign_ext)
setValue
in class BV
width
- New width of BV.value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(short value)
setValue
in class BV
value
- Up to 16 bits of the value.
BVException
- ConstBVs cannot be modified.public final BV setValue(short value, boolean sign_ext)
setValue
in class BV
value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, short value)
setValue
in class BV
width
- New width of BV.value
- Up to 16 bits of the value.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, short value, boolean sign_ext)
setValue
in class BV
width
- New width of BV.value
- Up to 16 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int value)
setValue
in class BV
value
- Up to 32 bits of the value.
BVException
- ConstBVs cannot be modified.public final BV setValue(int value, boolean sign_ext)
setValue
in class BV
value
- Up to 32 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, int value)
setValue
in class BV
width
- New width of BV.value
- Up to 32 bits of the value.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, int value, boolean sign_ext)
setValue
in class BV
width
- New width of BV.value
- Up to 32 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(long value)
setValue
in class BV
value
- Up to 64 bits of the value.
BVException
- ConstBVs cannot be modified.public final BV setValue(long value, boolean sign_ext)
setValue
in class BV
value
- Up to 64 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, long value)
setValue
in class BV
width
- New width of BV.value
- Up to 64 bits of the value.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, long value, boolean sign_ext)
setValue
in class BV
width
- New width of BV.value
- Up to 64 bits of the value.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int[] value)
setValue
in class BV
value
- An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
BVException
- ConstBVs cannot be modified.public final BV setValue(int[] value, boolean sign_ext)
setValue
in class BV
value
- An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, int[] value)
setValue
in class BV
width
- New width of BV.value
- An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, int[] value, boolean sign_ext)
setValue
in class BV
width
- New width of BV.value
- An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(BV vector)
setValue
in class BV
vector
- Original BV.
BVException
- ConstBVs cannot be modified.public final BV setValue(BV bv1, BV bv2)
setValue
in class BV
bv1
- The least significant bits.bv2
- The next bits.
BVException
- ConstBVs cannot be modified.public final BV setValue(BV bv1, BV bv2, BV bv3)
setValue
in class BV
bv1
- The least significant bits.bv2
- The next bits.bv3
- The next bits.
BVException
- ConstBVs cannot be modified.public final BV setValue(BV bv1, BV bv2, BV bv3, BV bv4)
setValue
in class BV
bv1
- The least significant bits.bv2
- The next bits.bv3
- The next bits.bv4
- The next bits.
BVException
- ConstBVs cannot be modified.public final BV setValue(BV[] bv_array)
setValue
in class BV
bv_array
-
BVException
- ConstBVs cannot be modified.public final BV setValue(BV vector, boolean sign_ext)
setValue
in class BV
vector
- Original BV.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, BV vector)
setValue
in class BV
width
- New width of BV.vector
- Original BV.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, BV vector, boolean sign_ext)
setValue
in class BV
width
- New width of BV.vector
- Original BV.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(java.lang.String value)
setValue
in class BV
value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
BVException
- ConstBVs cannot be modified.public final BV setValue(java.lang.String value, boolean sign_ext)
setValue
in class BV
value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, java.lang.String value)
setValue
in class BV
width
- New width of BV.value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
BVException
- ConstBVs cannot be modified.public final BV setValue(int width, java.lang.String value, boolean sign_ext)
setValue
in class BV
width
- New width of BV.value
- The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setWidth(int width)
setWidth
in class BV
width
- The new width of the BV.
BVException
- ConstBVs cannot be modified.public final BV setWidth(int width, boolean sign_ext)
setWidth
in class BV
width
- The new width of the BV.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.public final BV setWidth(Wire w)
setWidth
in class BV
w
- The wire to determine width from.
BVException
- ConstBVs cannot be modified.public final BV setWidth(Wire w, boolean sign_ext)
setWidth
in class BV
w
- The wire to determine width from.sign_ext
- Either ZERO_PAD or SIGN_EXT.
BVException
- ConstBVs cannot be modified.protected final boolean initWidth(int width)
initWidth
in class BV
BVException
- ConstBVs cannot be modifiedprotected final BV initFromString(int width, java.lang.String value, boolean sign_ext)
initFromString
in class BV
BVException
- ConstBVs cannot be modifiedprotected final boolean verify()
verify
in class BV
public java.lang.String toString()
BV
toString
in class BV
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |