uadds and pdates some graphics and menu items
This commit is contained in:
@@ -131,11 +131,11 @@ public class FstDbLoader implements IWaveformDbLoader, IFstDatabaseBuilder {
|
||||
* @see com.minres.scviewer.database.vcd.ITraceBuilder#newNet(java.lang.String, int, int)
|
||||
*/
|
||||
@Override
|
||||
public void newNet(String name, int handle, int width, boolean alias) {
|
||||
public void newNet(String name, int handle, int width, int direction, boolean alias) {
|
||||
String netName = moduleStack.isEmpty()? name: moduleStack.peek()+"."+name;
|
||||
IWaveform signal = width==0?
|
||||
new FstSignal<DoubleVal>(this, handle, netName, width):
|
||||
new FstSignal<BitVector>(this, handle, netName, width);
|
||||
new FstSignal<DoubleVal>(this, handle, netName, width, direction):
|
||||
new FstSignal<BitVector>(this, handle, netName, direction, width);
|
||||
signals.add(signal);
|
||||
pcs.firePropertyChange(IWaveformDbLoader.SIGNAL_ADDED, null, Iterables.getLast(signals));
|
||||
}
|
||||
@@ -150,6 +150,7 @@ public class FstDbLoader implements IWaveformDbLoader, IFstDatabaseBuilder {
|
||||
}
|
||||
|
||||
public void setMaxTime(long maxTime, int timeScale) {
|
||||
if(timeScale>0) timeScale=-timeScale;
|
||||
long eff_time_scale=timeScale-IWaveformDb.databaseTimeScale;
|
||||
this.timeScaleFactor = calculateTimescaleMultipierPower(eff_time_scale);
|
||||
this.maxTime = maxTime*timeScaleFactor;
|
||||
|
||||
@@ -54,7 +54,7 @@ class FstFileParser {
|
||||
case HT_VAR:
|
||||
HierVar v = new HierVar();
|
||||
FstLibrary.getHierVar(p, v);
|
||||
builder.newNet(v.name, v.handle, v.length, v.is_alias!=0);
|
||||
builder.newNet(v.name, v.handle, v.length, v.direction, v.is_alias!=0);
|
||||
break;
|
||||
case HT_ATTRBEGIN:
|
||||
HierAttr attr = new HierAttr();
|
||||
|
||||
@@ -95,6 +95,19 @@ public class FstLibrary {
|
||||
this.varType = varType;
|
||||
}
|
||||
};
|
||||
|
||||
public static enum VarDir {
|
||||
FST_VD_IMPLICIT (0),
|
||||
FST_VD_INPUT (1),
|
||||
FST_VD_OUTPUT (2),
|
||||
FST_VD_INOUT (3),
|
||||
FST_VD_BUFFER (4),
|
||||
FST_VD_LINKAGE (5);
|
||||
public final int varDir;
|
||||
private VarDir(int varDir) {
|
||||
this.varDir = varDir;
|
||||
}
|
||||
};
|
||||
|
||||
public static enum AttrType {
|
||||
FST_AT_MISC ( 0), /* self-contained: does not need matching FST_HT_ATTREND */
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.fst;
|
||||
|
||||
import com.minres.scviewer.database.DirectionType;
|
||||
import com.minres.scviewer.database.EventEntry;
|
||||
import com.minres.scviewer.database.EventList;
|
||||
import com.minres.scviewer.database.HierNode;
|
||||
@@ -21,7 +22,9 @@ import com.minres.scviewer.database.WaveformType;
|
||||
public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
||||
|
||||
private final FstDbLoader loader;
|
||||
|
||||
|
||||
private final int direction;
|
||||
|
||||
private final int id;
|
||||
|
||||
private final String fullName;
|
||||
@@ -29,20 +32,21 @@ public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
||||
private final int width;
|
||||
|
||||
private final IEventList values;
|
||||
|
||||
|
||||
public FstSignal(FstDbLoader loader, String name) {
|
||||
this(loader, 0, name, 1);
|
||||
this(loader, 0, name, 0, 1);
|
||||
}
|
||||
|
||||
public FstSignal(FstDbLoader loader, int id, String name) {
|
||||
this(loader, id,name,1);
|
||||
this(loader, id,name, 0,1);
|
||||
}
|
||||
|
||||
public FstSignal(FstDbLoader loader, int id, String name, int width) {
|
||||
public FstSignal(FstDbLoader loader, int id, String name, int direction, int width) {
|
||||
super(name);
|
||||
fullName=name;
|
||||
this.loader=loader;
|
||||
this.id=id;
|
||||
this.direction = direction;
|
||||
this.width=width;
|
||||
this.values=new EventList();
|
||||
}
|
||||
@@ -52,6 +56,7 @@ public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
||||
fullName=name;
|
||||
this.loader=o.loader;
|
||||
this.id=id;
|
||||
this.direction = 0;
|
||||
this.width=o.width;
|
||||
this.values=o.values;
|
||||
}
|
||||
@@ -78,14 +83,14 @@ public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
||||
return getEvents().get(time);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEvent[] getEventsBeforeTime(long time) {
|
||||
EventEntry e = getEvents().floorEntry(time);
|
||||
if(e==null)
|
||||
return new IEvent[] {};
|
||||
else
|
||||
return getEvents().floorEntry(time).events;
|
||||
}
|
||||
@Override
|
||||
public IEvent[] getEventsBeforeTime(long time) {
|
||||
EventEntry e = getEvents().floorEntry(time);
|
||||
if(e==null)
|
||||
return new IEvent[] {};
|
||||
else
|
||||
return getEvents().floorEntry(time).events;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSame(IWaveform other) {
|
||||
@@ -112,4 +117,15 @@ public class FstSignal<T extends IEvent> extends HierNode implements IWaveform {
|
||||
return "signal";
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirectionType getDirection() {
|
||||
switch(direction) {
|
||||
case 1: return DirectionType.INPUT;
|
||||
case 2: return DirectionType.OUTPUT;
|
||||
case 3: return DirectionType.INOUT;
|
||||
case 4: return DirectionType.BUFFER;
|
||||
case 5: return DirectionType.LINKAGE;
|
||||
}
|
||||
return DirectionType.IMPLICIT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public interface IFstDatabaseBuilder {
|
||||
* @param width the width, -1 equals real, 0... is a bit vector
|
||||
* @return the net id
|
||||
*/
|
||||
public void newNet(String netName, int handle, int width, boolean alias) ;
|
||||
public void newNet(String netName, int handle, int width, int direction, boolean alias) ;
|
||||
|
||||
/**
|
||||
* Gets the net width.
|
||||
|
||||
Reference in New Issue
Block a user