cleans interfaces up
This commit is contained in:
@ -33,6 +33,37 @@ public class BitVector implements IEvent {
|
||||
packedValues[i] = 0;
|
||||
}
|
||||
|
||||
public static BitVector fromString(int netWidth, String value){
|
||||
BitVector bv = new BitVector(netWidth);
|
||||
int stringIndex = 0;
|
||||
for (int convertedIndex = netWidth -1; convertedIndex >=0; convertedIndex--) {
|
||||
if(convertedIndex<value.length()) {
|
||||
switch (value.charAt(stringIndex++)) {
|
||||
case 'z':
|
||||
bv.setValue(convertedIndex, BitValue.Z);
|
||||
break;
|
||||
|
||||
case '1':
|
||||
bv.setValue(convertedIndex, BitValue.ONE);
|
||||
break;
|
||||
|
||||
case '0':
|
||||
bv.setValue(convertedIndex, BitValue.ZERO);
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
bv.setValue(convertedIndex, BitValue.X);
|
||||
break;
|
||||
|
||||
default:
|
||||
bv.setValue(convertedIndex, BitValue.X);
|
||||
}
|
||||
} else {
|
||||
bv.setValue(convertedIndex, BitValue.ZERO);
|
||||
}
|
||||
}
|
||||
return bv;
|
||||
}
|
||||
/**
|
||||
* Sets the value.
|
||||
*
|
||||
|
@ -78,4 +78,11 @@ public interface IWaveform extends IHierNode {
|
||||
*/
|
||||
public int getRowCount();
|
||||
|
||||
/**
|
||||
* Gets the width.
|
||||
*
|
||||
* @return the width
|
||||
*/
|
||||
public int getWidth();
|
||||
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public interface IWaveformDbLoader {
|
||||
* @param inputFile the input file
|
||||
* @throws InputFormatException the input format exception
|
||||
*/
|
||||
public void load(IWaveformDb db, File inputFile) throws InputFormatException;
|
||||
public void load(File inputFile) throws InputFormatException;
|
||||
|
||||
/**
|
||||
* Gets the max time.
|
||||
|
@ -135,7 +135,7 @@ public class WaveformDb extends HierNode implements IWaveformDb, PropertyChangeL
|
||||
IWaveformDbLoader loader = loaderFactory.getLoader();
|
||||
loader.addPropertyChangeListener(this);
|
||||
try {
|
||||
loader.load(this, inp);
|
||||
loader.load(inp);
|
||||
} catch (Exception e) {
|
||||
LOG.error("error loading file "+inp.getName(), e);
|
||||
retval=false;
|
||||
|
Reference in New Issue
Block a user