|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--engine.Assignable
|
+--engine.DataHolder
|
+--engine.BitVector
The implementation of a 4-state (0,1,X,Z) bit array.
| Field Summary | |
protected static int[][] |
abgCond
used to combine the alternatives in the ambiguity case of ?: operator |
static int[] |
ands
|
private byte[] |
b0
each "elecrical" bit is represented as a 2 - bit value (see table) below |
private byte[] |
b1
each "elecrical" bit is represented as a 2 - bit value (see table) below |
(package private) int |
increment
Used in a for(.. |
(package private) int |
lsb
indexes of the MSB & the LSB |
(package private) int |
msb
indexes of the MSB & the LSB |
(package private) int |
n
the size ( |msb - lsb| + 1) |
static int[] |
nands
|
(package private) static int[][] |
negedge
|
static int[] |
nors
|
static int[] |
nots
|
static int[] |
ors
|
(package private) static int[][] |
posedge
|
(package private) boolean |
signed
true if this BitVector is signed (this is NOT the sign bit !!) |
(package private) static char[][] |
vtable16
4-bit expansions for hexa digits: |
static char[][] |
vtable8
|
static int |
X
|
static int[] |
xnors
|
static int[] |
xors
|
static int |
Z
|
| Fields inherited from class engine.DataHolder |
monitors |
| Fields inherited from class engine.Assignable |
data,
initValDefaults,
lookupTables,
lookupTableSupply0,
lookupTableSupply1,
lookupTableTri0,
lookupTableTri1,
lookupTableWand,
lookupTableWire,
lookupTableWor,
typeSupply0,
typeSupply1,
typeTri0,
typeTri1,
typeTrireg,
typeWand,
typeWire,
typeWor,
X,
Z |
| Constructor Summary | |
BitVector(java.math.BigInteger bi,
boolean signed)
|
|
BitVector(BitVector b)
copy constructor |
|
BitVector(BitVector b,
int start,
int end)
this <- b [start : end]; |
|
BitVector(byte bit,
int n)
Creates a new Bitvector filled with the 'bit' value |
|
BitVector(int msb,
int lsb)
Creates a new unsigned BitVector |
|
BitVector(int msb,
int lsb,
boolean signed)
|
|
BitVector(long l,
boolean signed)
|
|
BitVector(java.lang.String image,
int base,
int size)
creates an unsigned BitVector |
|
BitVector(java.lang.String image,
int base,
int size,
boolean signed,
boolean sign)
parses image, according to base & size |
|
| Method Summary | |
Result |
add(Result r)
this = this + b does NOT guarantees the integrity of b ! |
static int |
and(int a,
int b)
|
void |
attrib(BitVector b)
this <- b |
void |
attrib(BitVector b,
int start,
int end)
This[start:end] <- b |
(package private) void |
attrib(int from,
int to,
BitVector b,
int start,
int end)
This[from:to] <- b[start:end]; |
(package private) void |
attrib(long val)
this <- valPetru val can be < 0 ! |
static BitVector |
b0()
returns a new one - bit BitVector whose value is 0 |
static BitVector |
b1()
returns a new one - bit BitVector whose value is 1 |
void |
bAnd(Result r)
|
void |
bAndR()
|
long |
bitsToLong()
converts this BitVector to its binary representation into a long |
void |
bNAnd(Result r)
|
void |
bNAndR()
|
void |
bNOr(Result r)
|
void |
bNOrR()
|
void |
bNot()
|
void |
bNXor(Result r)
|
void |
bNXOrR()
|
void |
bOr(Result r)
|
void |
bOrR()
|
static BitVector |
bX()
returns a new une - bit BitVector whose value is X |
void |
bXor(Result r)
|
void |
bXOrR()
|
static BitVector |
bZ()
returns a new one - bit BitVector whose value is Z |
Result |
cEq(Result r)
|
protected java.lang.Object |
clone()
|
Result |
cNEq(Result r)
|
void |
combineFAbgCond(BitVector b)
combines this and b for the ambiguous case of ?: |
(package private) int |
compare(BitVector b)
Looks for a value change between this and b (used for edge detesction). |
(package private) java.lang.Object[] |
compute()
Computes the acutal value for each bit, considering the BitSelects assigned to it. |
Result |
div(Result r)
todo: implementation |
Result |
duplicate()
|
protected void |
ensureBitCapacity(int newLength)
checks that ths BitVector can hold enough bits |
protected void |
ensureCapacity(int newLength)
checks that ths BitVector can hold enough bytes |
boolean |
equals(BitVector b)
Check two BitVectors to be identical. |
(package private) void |
expand0(int newLength)
expands the bitvector to the new size, padding the new space with 0 the msb is adjusted accordingly |
(package private) void |
expandS(int newN)
performs arithmetic (Signed) expansion if signed is set (for Luke : i.e. |
Result |
ge(Result r)
|
void |
genericReduction(int[] table)
Reduces the BitVector according to the given given truth table |
void |
genericReduction1(int[] table)
Same as genericReduction, but the direction is reversed, because I don't want to transpose the truth tables from the Standard. |
protected int |
getb(int i)
returns both b[1:0] |
protected int |
getb0(int i)
Returns the i-th bit from b0. |
protected int |
getb1(int i)
returns the i-th bit from b1 |
int |
getBit(int i)
gets the i'th bit value (i is in the range lsb..msb !) |
BitVector |
getBits()
|
int |
getBool()
|
BitVector |
getInt()
|
long |
getLong()
|
Real |
getReal()
a combination of the $bitstoreal and the $itor system functions |
int |
getSign()
|
int |
getType()
|
Result |
gt(Result r)
|
boolean |
isDefined()
|
boolean |
isNull()
Tests if this bivector is 0 |
boolean |
isTrue()
|
boolean |
isX()
|
boolean |
isZ()
|
Result |
le(Result r)
|
int |
length()
|
Result |
lEq(Result r)
|
Result |
lNEq(Result r)
|
void |
lNot()
Reduces this BitVector to a single-bit one wich contains its logical truth value (0, 1, or X). |
Result |
lt(Result r)
|
Result |
mod(Result r)
The result is stored into this. |
Result |
mul(Result r)
Multiplies this BitVector and r. |
void |
neg()
This = -this (2's complement). |
static int |
not(int x)
|
static int |
or(int a,
int b)
|
void |
reduce(int value)
reduces the BitVector to a single bit vector |
(package private) byte[] |
reverse(byte[] original)
Whata' ... |
protected void |
setb(int i,
int v)
sets both b0 and b1 |
protected void |
setb0(int i,
int v)
sets the i-th bit from b0 |
protected void |
setb1(int i,
int v)
sets the i-th bit from b1 |
void |
setBit(int i,
int value)
sets the i'th bit to value (i is in the range lsb..msb !) |
(package private) void |
setLength(int length)
Modifies the length of this Bitvector, expanding or shrinking it as necessary. |
void |
shl(int i)
Shift this BitVector with i positions. |
void |
shl(Result count)
|
void |
shr(Result count)
|
Result |
sub(Result r)
this = this - r does NOT guarantee the integrity of parameter r implementation is: r = -r this = this+r |
java.lang.String |
toString()
|
java.lang.String |
toString(int base)
|
(package private) void |
trunc(int newLength)
cuts off the most significants bits, so the length remains newL... |
long |
value()
computes the value represented by this BitVector |
static int |
xor(int a,
int b)
|
| Methods inherited from class engine.DataHolder |
addMonitor,
getWatchMonitor,
hasMonitor,
notifyMonitors,
removeMonitor |
| Methods inherited from class engine.Assignable |
addAssignement,
removeAssignement |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int X
public static final int Z
private byte[] b0
private byte[] b1
int msb
int lsb
int increment
for(.. ; .. ; .. += increment) to traverse this BitVector from
LSB to MSB ( i guess.. yeah, I was right !)int n
boolean signed
public static final int[] ands
public static final int[] ors
public static final int[] xors
public static final int[] nands
public static final int[] nors
public static final int[] xnors
public static final int[] nots
public static final char[][] vtable8
static final char[][] vtable16
static final int[][] posedge
static final int[][] negedge
protected static final int[][] abgCond
| Constructor Detail |
public BitVector(long l,
boolean signed)
public BitVector(java.math.BigInteger bi,
boolean signed)
public BitVector(int msb,
int lsb)
public BitVector(int msb,
int lsb,
boolean signed)
public BitVector(byte bit,
int n)
public BitVector(BitVector b)
public BitVector(BitVector b,
int start,
int end)
throws InterpretTimeException
public BitVector(java.lang.String image,
int base,
int size)
public BitVector(java.lang.String image,
int base,
int size,
boolean signed,
boolean sign)
| Method Detail |
public static final int and(int a,
int b)
public static final int or(int a,
int b)
public static final int xor(int a,
int b)
public static final int not(int x)
public static final BitVector bX()
public static final BitVector bZ()
public static final BitVector b1()
public static final BitVector b0()
protected java.lang.Object clone()
public boolean equals(BitVector b)
public void attrib(BitVector b)
throws InterpretTimeException
public void attrib(BitVector b,
int start,
int end)
throws InterpretTimeException
void attrib(int from,
int to,
BitVector b,
int start,
int end)
throws InterpretTimeException
void attrib(long val)
throws InterpretTimeException
protected final void ensureCapacity(int newLength)
newLength - the number of bytes that this BitVector must holdprotected final void ensureBitCapacity(int newLength)
newLength - the number of bits that this BitVector must holdprotected final int getb0(int i)
i - the index of requested bit
protected final void setb0(int i,
int v)
protected final int getb1(int i)
protected final void setb1(int i,
int v)
protected final void setb(int i,
int v)
protected final int getb(int i)
public final void setBit(int i,
int value)
public final int getBit(int i)
public final void reduce(int value)
value - the value assigned to the bit
public void bAnd(Result r)
throws InterpretTimeException
public void bOr(Result r)
throws InterpretTimeException
public void bXor(Result r)
throws InterpretTimeException
public void bNAnd(Result r)
throws InterpretTimeException
public void bNOr(Result r)
throws InterpretTimeException
public void bNXor(Result r)
throws InterpretTimeException
public void bNot()
throws InterpretTimeException
public void lNot()
public void neg()
public void shl(Result count)
throws InterpretTimeException
public void shl(int i)
public void shr(Result count)
throws InterpretTimeException
public boolean isDefined()
public boolean isNull()
public boolean isZ()
public boolean isX()
public Result lEq(Result r)
public Result lNEq(Result r)
public Result cEq(Result r)
throws InterpretTimeException
public Result cNEq(Result r)
throws InterpretTimeException
public Result lt(Result r)
public Result ge(Result r)
public Result gt(Result r)
public Result le(Result r)
public void bAndR()
throws InterpretTimeException
public void bOrR()
throws InterpretTimeException
public void bXOrR()
throws InterpretTimeException
public void bNAndR()
throws InterpretTimeException
public void bNOrR()
throws InterpretTimeException
public void bNXOrR()
throws InterpretTimeException
public void genericReduction(int[] table)
throws InterpretTimeException
public void genericReduction1(int[] table)
throws InterpretTimeException
void expandS(int newN)
public int getSign()
public Result add(Result r)
public Result sub(Result r)
byte[] reverse(byte[] original)
public Result mul(Result r)
public Result mod(Result r)
throws InterpretTimeException
public Result div(Result r)
public long bitsToLong()
throws UndefinedValueException
public long value()
throws UndefinedValueException
public java.lang.String toString()
public java.lang.String toString(int base)
void expand0(int newLength)
void trunc(int newLength)
void setLength(int length)
int compare(BitVector b)
java.lang.Object[] compute()
throws InterpretTimeException
public final void combineFAbgCond(BitVector b)
public Real getReal()
Resultpublic BitVector getBits()
Resultpublic BitVector getInt()
Resultpublic int getBool()
Resultpublic long getLong()
public Result duplicate()
Resultpublic boolean isTrue()
public int getType()
public int length()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||