byucc.jhdl.base
Class ConstBV

java.lang.Object
  extended byjava.lang.Number
      extended bybyucc.jhdl.base.BV
          extended bybyucc.jhdl.base.ConstBV
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class ConstBV
extends BV

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.

Author:
Eric Blake
See Also:
Serialized Form

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 byucc.jhdl.base.BV
abs, abs, abs, abs, add, add, add, add, add, add, add, add, add, add, add, add, and, and, and, and, and, and, and, and, and, and, and, and, barrelShiftLeft, barrelShiftLeft, barrelShiftRight, barrelShiftRight, byteValue, clearBit, clearBits, clone, compare, compare, compare, compare, compare, decr, decr, decr, decr, decr, decr, decr, decr, div, div, div, div, div, div, div, div, div, div, div, div, doubleValue, eq, eq, eq, eq, eq, equals, floatValue, getBit, getIsSigned, getLSBOff, getLSBOff, getLSBOn, getLSBOn, getMSBOff, getMSBOff, getMSBOn, getMSBOn, getOffCount, getOffCount, getOnCount, getOnCount, getWidth, gt, gt, gt, gt, gt, gteq, gteq, gteq, gteq, gteq, hashCode, incr, incr, incr, incr, incr, incr, incr, incr, intValue, longValue, lowerBits, lowerBits, lt, lt, lt, lt, lt, lteq, lteq, lteq, lteq, lteq, main, max, max, max, max, max, max, max, max, max, max, max, max, min, min, min, min, min, min, min, min, min, min, min, min, mod, mod, mod, mod, mod, mod, mod, mod, mod, mod, mod, mod, mult, mult, mult, mult, mult, mult, mult, mult, mult, mult, mult, mult, multUpper, multUpper, multUpper, multUpper, multUpper, multUpper, multUpper, multUpper, multUpper, multUpper, multUpper, multUpper, nand, nand, nand, nand, nand, nand, nand, nand, nand, nand, nand, nand, negate, negate, negate, negate, negate, negate, negate, negate, negative, negative, negative, neq, neq, neq, neq, neq, nor, nor, nor, nor, nor, nor, nor, nor, nor, nor, nor, nor, not, not, not, not, not, not, not, not, or, or, or, or, or, or, or, or, or, or, or, or, positive, positive, positive, pow, pow, pow, pow, pow, pow, pow, pow, range, range, reverse, reverse, setBit, setBit, setBits, setBits, setIsSigned, setRange, setRange, setRange, setValue, setValue, setValue, setValue, shiftLeft, shiftLeft, shiftLeft, shiftLeft, shiftLeft, shiftLeft, shiftLeft, shiftLeft, shiftRight, shiftRight, shiftRight, shiftRight, shiftRight, shiftRight, shiftRight, shiftRight, shortValue, signum, signum, stringBitWidth, stringBitWidth, sub, sub, sub, sub, sub, sub, sub, sub, sub, sub, sub, sub, toArray, toArray, toBigInteger, toBigInteger, toBinaryString, toBinaryString, toBoolean, toBVArray, toBVArray, toByte, toByte, toChar, toChar, toDecimalString, toDecimalString, toggleBit, toggleBits, toHexString, toHexString, toInt, toInt, toLong, toLong, toShort, toShort, toString, upperBits, upperBits, xnor, xnor, xnor, xnor, xnor, xnor, xnor, xnor, xnor, xnor, xnor, xnor, xor, xor, xor, xor, xor, xor, xor, xor, xor, xor, xor, xor, zero, zero
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstBV

public ConstBV()
Creates a ConstBV of width 1 and value 0.


ConstBV

public ConstBV(int width)
Creates a ConstBV of specified width and value 0.

Parameters:
width - The width of the vector.

ConstBV

public ConstBV(Wire w)
Creates a ConstBV with value 0 and width of the wire argument.

Parameters:
w - The wire to determine width from.

ConstBV

public ConstBV(int width,
               boolean value)
Creates a ConstBV of arbitrary width, set to true (1) or false (0).

Parameters:
width - The width of the vector.
value - The value of the vector.

ConstBV

public ConstBV(int width,
               boolean value,
               boolean sign_ext)
Creates a ConstBV of arbitrary width, set to true or false. When value is true, ZERO_PAD sets only the least significant bit, SIGN_EXT sets all bits.

Parameters:
width - The width of the vector.
value - The value of the vector.
sign_ext - Either ZERO_PAD or SIGN_EXT.

ConstBV

public ConstBV(int width,
               byte value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - Up to 8 bits of the vector.

ConstBV

public ConstBV(int width,
               byte value,
               boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary.

Parameters:
width - The width of the vector.
value - Up to 8 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.

ConstBV

public ConstBV(int width,
               char value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - Up to 16 bits of the value.

ConstBV

public ConstBV(int width,
               char value,
               boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary.

Parameters:
width - The width of the vector.
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.

ConstBV

public ConstBV(int width,
               short value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - Up to 16 bits of the value.

ConstBV

public ConstBV(int width,
               short value,
               boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary.

Parameters:
width - The width of the vector.
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.

ConstBV

public ConstBV(int width,
               int value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - Up to 32 bits of the value.

ConstBV

public ConstBV(int width,
               int value,
               boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary.

Parameters:
width - The width of the vector.
value - Up to 32 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.

ConstBV

public ConstBV(int width,
               long value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - Up to 64 bits of the value.

ConstBV

public ConstBV(int width,
               long value,
               boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary.

Parameters:
width - The width of the vector.
value - Up to 64 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.

ConstBV

public ConstBV(int width,
               int[] value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the vector.
value - An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).

ConstBV

public ConstBV(int width,
               int[] value,
               boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary.

Parameters:
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.

ConstBV

public ConstBV(BV vector)
Creates a ConstBV of identical width (also short for (ConstBV)clone()).

Parameters:
vector - The original BV.

ConstBV

public ConstBV(BV bv1,
               BV bv2)
Creates a ConstBV by concatenating the given BVs, with the first argument providing the least significant bits.

Parameters:
bv1 - The least significant bits.
bv2 - The next bits.

ConstBV

public ConstBV(BV bv1,
               BV bv2,
               BV bv3)
Creates a ConstBV by concatenating the given BVs, with the first argument providing the least significant bits.

Parameters:
bv1 - The least significant bits.
bv2 - The next bits.
bv3 - The next bits.

ConstBV

public 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.

Parameters:
bv1 - The least significant bits.
bv2 - The next bits.
bv3 - The next bits.
bv4 - The next bits.

ConstBV

public ConstBV(BV[] bv_array)
Creates a ConstBV by concatenating the given BVs, with the BV in slot 0 providing the least significant bits.

Parameters:
bv_array - The array of BVs, least significant bits in slot 0.
Throws:
BVException - if the array contains only null pointers.

ConstBV

public ConstBV(int width,
               BV vector)
Creates a ConstBV of arbitrary width, with zero-padding as necessary.

Parameters:
width - The width of the new vector.
vector - Original BV.

ConstBV

public ConstBV(int width,
               BV vector,
               boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary.

Parameters:
width - The width of the new vector.
vector - Original BV.
sign_ext - Either ZERO_PAD or SIGN_EXT.

ConstBV

public ConstBV(java.lang.String value)
Creates a ConstBV of width DETERMINE_FROM_STRING.

Parameters:
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

ConstBV

public ConstBV(int width,
               java.lang.String value)
Creates a ConstBV of arbitrary width, with zero-padding as necessary. For width of DETERMINE_FROM_STRING, if the string is binary, octal, or hexadecimal, the vector is (bits per digit)*(digits) wide, and if the string is decimal, the vector is the minimum number of bits for a 2's-complement representation, given by ceil(log2(this < 0 ? -this : this + 1)) + 1.

Parameters:
width - The width of the new vector.
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number

ConstBV

public ConstBV(int width,
               java.lang.String value,
               boolean sign_ext)
Creates a ConstBV of arbitrary width, with appropriate sign extension as necessary. For width of DETERMINE_FROM_STRING, if the string is binary, octal, or hexadecimal, the vector is (bits per digit)*(digits) wide, and if the string is decimal, the vector is the minimum number of bits for a 2's-complement representation, given by ceil(log2(this < 0 ? -this : this + 1)) + 1.

Parameters:
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.
Throws:
java.lang.NumberFormatException - if the string cannot be parsed as a valid number
Method Detail

setValue

public final BV setValue(boolean value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - The value of the vector.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(boolean value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - The value of the vector.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         boolean value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - The value of the vector.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(byte value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - Up to 8 bits of the vector.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(byte value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - Up to 8 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         byte value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - Up to 8 bits of the value.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         byte value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - Up to 8 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(char value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - Up to 16 bits of the value.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(char value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         char value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - Up to 16 bits of the value.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         char value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(short value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - Up to 16 bits of the value.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(short value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         short value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - Up to 16 bits of the value.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         short value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - Up to 16 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - Up to 32 bits of the value.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - Up to 32 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         int value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - Up to 32 bits of the value.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         int value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - Up to 32 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(long value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - Up to 64 bits of the value.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(long value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - Up to 64 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         long value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - Up to 64 bits of the value.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         long value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - Up to 64 bits of the value.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int[] value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int[] value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
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.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         int[] value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - An arbitrary amount of bits, in low-endian order (ie. bits 0-31 are in value[0]).
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         int[] value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
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.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(BV vector)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
vector - Original BV.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(BV bv1,
                         BV bv2)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
bv1 - The least significant bits.
bv2 - The next bits.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(BV bv1,
                         BV bv2,
                         BV bv3)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
bv1 - The least significant bits.
bv2 - The next bits.
bv3 - The next bits.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(BV bv1,
                         BV bv2,
                         BV bv3,
                         BV bv4)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
bv1 - The least significant bits.
bv2 - The next bits.
bv3 - The next bits.
bv4 - The next bits.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(BV[] bv_array)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
bv_array -
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(BV vector,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
vector - Original BV.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         BV vector)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
vector - Original BV.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         BV vector,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
vector - Original BV.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(java.lang.String value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(java.lang.String value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         java.lang.String value)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
width - New width of BV.
value - The String to parse. In decimal, unless prefixed with 0b, 0o, or 0x.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setValue

public final BV setValue(int width,
                         java.lang.String value,
                         boolean sign_ext)
Overrides setValue of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setValue in class BV
Parameters:
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.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setWidth

public final BV setWidth(int width)
Overrides setWidth of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setWidth in class BV
Parameters:
width - The new width of the BV.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setWidth

public final BV setWidth(int width,
                         boolean sign_ext)
Overrides setWidth of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setWidth in class BV
Parameters:
width - The new width of the BV.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setWidth

public final BV setWidth(Wire w)
Overrides setWidth of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setWidth in class BV
Parameters:
w - The wire to determine width from.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

setWidth

public final BV setWidth(Wire w,
                         boolean sign_ext)
Overrides setWidth of BV: throws BVException, since ConstBV cannot be modified after creation.

Overrides:
setWidth in class BV
Parameters:
w - The wire to determine width from.
sign_ext - Either ZERO_PAD or SIGN_EXT.
Returns:
this, to allow chaining or nesting of operations.
Throws:
BVException - ConstBVs cannot be modified.

initWidth

protected final boolean initWidth(int width)
Overrides initWidth of BV: Can only be called within a constructor.

Overrides:
initWidth in class BV
Throws:
BVException - ConstBVs cannot be modified

initFromString

protected final BV initFromString(int width,
                                  java.lang.String value,
                                  boolean sign_ext)
Overrides initFromString of BV: Can only be called within a constructor.

Overrides:
initFromString in class BV
Throws:
BVException - ConstBVs cannot be modified

verify

protected final boolean verify()
Checks whether a method may modify a BV - in the case of ConstBV, the result is an exception

Overrides:
verify in class BV

toString

public java.lang.String toString()
Description copied from class: BV
Displays a BV as "(width bits)0xvalue", where value is in hexadecimal, and separated by spaces every 8 characters for legibility. Useful in debugging.

Overrides:
toString in class BV
Returns:
a String representing the BV.


Copyright ? 2006 Brigham Young University, Configurable Computing Laboratory. All Rights Reserved.