Fixed inconsitencies

This commit is contained in:
Eyck Jentzsch 2015-01-09 09:16:40 +01:00
parent 4062d24897
commit cb77a5da33
26 changed files with 174 additions and 73 deletions

View File

@ -24,6 +24,9 @@ The plugins are structured as follows:
outline of the DB and the properties of the transaction outline of the DB and the properties of the transaction
- com.minres.scviewer.feature - com.minres.scviewer.feature
the feature combining the plugins above into a somhow usable form the feature combining the plugins above into a somhow usable form
- scv_tr_sqlite
a C++ project containing the SQLite based SCV database implementation. A simple
example (scv_tr_recording_example.cpp) for testig purposes is provided.
To build the plugins the Eclipse SDK or PDE can be used. In both cases the Groovy To build the plugins the Eclipse SDK or PDE can be used. In both cases the Groovy
eclipse plugin (http://groovy.codehaus.org/Eclipse+Plugin or Market) has to be eclipse plugin (http://groovy.codehaus.org/Eclipse+Plugin or Market) has to be

View File

@ -96,7 +96,7 @@ public class SQLiteDb extends HierNode implements IWaveformDb {
@Override @Override
public IWaveform getStreamByName(String name) { public IWaveform getStreamByName(String name) {
for (IWaveform n : getAllWaves()) for (IWaveform n : getAllWaves())
if (n.getName().equals(name)) if (n.getFullName().equals(name))
return n; return n;
return null; return null;
} }
@ -110,7 +110,7 @@ public class SQLiteDb extends HierNode implements IWaveformDb {
private void buildHierarchyNodes() throws InputFormatException{ private void buildHierarchyNodes() throws InputFormatException{
for(IWaveform stream:getAllWaves()){ for(IWaveform stream:getAllWaves()){
String[] hier = stream.getFullName().split("\\./"); String[] hier = stream.getFullName().split("\\.");
IHierNode node = this; IHierNode node = this;
for(String name:hier){ for(String name:hier){
IHierNode n1 = null; IHierNode n1 = null;

View File

@ -151,4 +151,9 @@ public class Tx implements ITx {
return null; return null;
} }
@Override
public int compareTo(ITx o) {
return this.getBeginTime().compareTo(o.getBeginTime());
}
} }

View File

@ -6,6 +6,8 @@ import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.NavigableSet;
import java.util.TreeSet;
import com.minres.scviewer.database.HierNode; import com.minres.scviewer.database.HierNode;
import com.minres.scviewer.database.ITxGenerator; import com.minres.scviewer.database.ITxGenerator;
@ -26,7 +28,7 @@ public class TxStream extends HierNode implements ITxStream {
private HashMap<Integer, TxGenerator> generators; private HashMap<Integer, TxGenerator> generators;
private List<ITx> transactions; private NavigableSet<ITx> transactions;
public TxStream(SQLiteDb trSQLiteDb, ScvStream scvStream) { public TxStream(SQLiteDb trSQLiteDb, ScvStream scvStream) {
super(scvStream.getName()); super(scvStream.getName());
@ -74,7 +76,7 @@ public class TxStream extends HierNode implements ITxStream {
} }
@Override @Override
public List<ITx> getTransactions() { public NavigableSet<ITx> getTransactions() {
checkTransactions(); checkTransactions();
return transactions; return transactions;
} }
@ -94,7 +96,7 @@ public class TxStream extends HierNode implements ITxStream {
if(generators==null) getGenerators(); if(generators==null) getGenerators();
SQLiteDatabaseSelectHandler<ScvTx> handler = new SQLiteDatabaseSelectHandler<ScvTx>(ScvTx.class, db.getDb(), SQLiteDatabaseSelectHandler<ScvTx> handler = new SQLiteDatabaseSelectHandler<ScvTx>(ScvTx.class, db.getDb(),
"stream="+scvStream.getId()); "stream="+scvStream.getId());
transactions=new ArrayList<ITx>(); transactions=new TreeSet<ITx>();
try { try {
for(ScvTx scvTx:handler.selectObjects()){ for(ScvTx scvTx:handler.selectObjects()){
transactions.add(new Tx(this, generators.get(scvTx.getGenerator()), scvTx)); transactions.add(new Tx(this, generators.get(scvTx.getGenerator()), scvTx));

View File

@ -1,6 +1,6 @@
scv_tr_stream (ID 1, name "pipelined_stream", kind "transactor") scv_tr_stream (ID 1, name "tr.pipelined_stream", kind "transactor")
scv_tr_stream (ID 2, name "addr_stream", kind "transactor") scv_tr_stream (ID 2, name "tr.addr_stream", kind "transactor")
scv_tr_stream (ID 3, name "data_stream", kind "transactor") scv_tr_stream (ID 3, name "tr.data_stream", kind "transactor")
scv_tr_generator (ID 4, name "read", scv_tr_stream 1, scv_tr_generator (ID 4, name "read", scv_tr_stream 1,
begin_attribute (ID 0, name "addr", type "UNSIGNED") begin_attribute (ID 0, name "addr", type "UNSIGNED")
end_attribute (ID 1, name "data", type "UNSIGNED") end_attribute (ID 1, name "data", type "UNSIGNED")

View File

@ -1,5 +1,5 @@
$date $date
Jan 03, 2015 20:58:29 Jan 07, 2015 08:03:07
$end $end
$version $version

View File

@ -35,6 +35,7 @@ class Tx implements ITx {
Tx(int id, TxStream stream, TxGenerator generator, EventTime begin){ Tx(int id, TxStream stream, TxGenerator generator, EventTime begin){
this.id=id this.id=id
this.stream=stream
this.generator=generator this.generator=generator
this.beginTime=begin this.beginTime=begin
} }
@ -49,4 +50,9 @@ class Tx implements ITx {
return outgoingRelations; return outgoingRelations;
} }
@Override
public int compareTo(ITx o) {
return beginTime.compareTo(o.beginTime)
}
} }

View File

@ -33,7 +33,7 @@ class TxStream extends HierNode implements ITxStream {
def generators = []; def generators = [];
private allTransactions; private TreeSet<Tx> allTransactions;
TxStream(int id, TextDb db, String name, String kind){ TxStream(int id, TextDb db, String name, String kind){
super(name) super(name)
@ -68,9 +68,11 @@ class TxStream extends HierNode implements ITxStream {
} }
@Override @Override
public List<ITx> getTransactions() { public NavigableSet<ITx> getTransactions() {
if(!allTransactions) if(!allTransactions){
allTransactions=generators.transactions.flatten().sort{it.beginTime.value} allTransactions=new TreeSet<Tx>()
allTransactions.addAll(generators.transactions.flatten())
}
return allTransactions return allTransactions
} }

View File

@ -0,0 +1,56 @@
package com.minres.scviewer.database;
public class BitVector {
public static final char VALUE_X = 'X';
public static final char VALUE_Z = 'Z';
public static final char VALUE_1 = '1';
public static final char VALUE_0 = '0';
private final int width;
private char[] value;
public BitVector(int netWidth) {
this.width=netWidth;
value = new char[netWidth];
for(int i=0; i<netWidth; i++) value[i]='0';
}
public void setValue(int i, char value) {
this.value[i]=value;
}
public char[] getValue() {
return value;
}
public void setValue(char[] value) {
this.value = value;
}
public int getWidth() {
return width;
}
public String toString(){
return new String(value);
}
public String toHexString(){
int resWidth=(width-1)/4+1;
char[] res = new char[resWidth];
for(int i=resWidth-1; i>=0; i--){
int digit=0;
for(int j=3; j>=0; j--){
if(value[4*i+j]==VALUE_X ||value[4*i+j]==VALUE_Z ){
res[i]=VALUE_X;
}
if(value[4*i+j]==VALUE_1)
digit+=1<<(3-j);
res[i]=Character.forDigit(digit, 16); //((digit < 10) ? '0' + digit : 'a' + digit -10)
}
}
return new String(res);
}
}

View File

@ -1,7 +1,8 @@
package com.minres.scviewer.database; package com.minres.scviewer.database;
public interface ISignalChangeMulti extends ISignalChange { public interface ISignalChangeMulti extends ISignalChange {
public String getValue(); public BitVector getValue();
} }

View File

@ -13,7 +13,7 @@ package com.minres.scviewer.database;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
public interface ITx { public interface ITx extends Comparable<ITx>{
public Long getId(); public Long getId();

View File

@ -11,12 +11,13 @@
package com.minres.scviewer.database; package com.minres.scviewer.database;
import java.util.List; import java.util.List;
import java.util.NavigableSet;
public interface ITxStream extends IWaveform { public interface ITxStream extends IWaveform {
public List<ITxGenerator> getGenerators(); public List<ITxGenerator> getGenerators();
public List<ITx> getTransactions(); public NavigableSet<ITx> getTransactions();
public ITx getTransactionById(long id); public ITx getTransactionById(long id);

View File

@ -1,5 +1,7 @@
package com.minres.scviewer.database.vcd; package com.minres.scviewer.database.vcd;
import com.minres.scviewer.database.BitVector;
// TODO: Auto-generated Javadoc // TODO: Auto-generated Javadoc
/** /**
* The Interface ITraceBuilder. * The Interface ITraceBuilder.

View File

@ -7,6 +7,7 @@ import java.util.List;
import java.util.Stack; import java.util.Stack;
import java.util.Vector; import java.util.Vector;
import com.minres.scviewer.database.BitVector;
import com.minres.scviewer.database.EventTime; import com.minres.scviewer.database.EventTime;
import com.minres.scviewer.database.HierNode; import com.minres.scviewer.database.HierNode;
import com.minres.scviewer.database.ISignal; import com.minres.scviewer.database.ISignal;
@ -54,8 +55,8 @@ public class VCDDb extends HierNode implements IWaveformDb, IVCDDatabaseBuilder
* @see com.minres.scviewer.database.ITrDb#getStreamByName(java.lang.String) * @see com.minres.scviewer.database.ITrDb#getStreamByName(java.lang.String)
*/ */
@Override @Override
public ITxStream getStreamByName(String name) { public IWaveform getStreamByName(String name) {
return null; return waveformLookup.get(name);
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -163,7 +164,7 @@ public class VCDDb extends HierNode implements IWaveformDb, IVCDDatabaseBuilder
VCDSignalChangeSingle change = new VCDSignalChangeSingle(time, decodedValues.getValue()[0]); VCDSignalChangeSingle change = new VCDSignalChangeSingle(time, decodedValues.getValue()[0]);
((VCDSignal<ISignalChangeSingle>)signal).addSignalChange(change); ((VCDSignal<ISignalChangeSingle>)signal).addSignalChange(change);
} else { } else {
VCDSignalChangeMulti change = new VCDSignalChangeMulti(time, new String(decodedValues.getValue())); VCDSignalChangeMulti change = new VCDSignalChangeMulti(time, decodedValues);
((VCDSignal<VCDSignalChangeMulti>)signal).addSignalChange(change); ((VCDSignal<VCDSignalChangeMulti>)signal).addSignalChange(change);
} }
maxTime= Math.max(maxTime, fCurrentTime); maxTime= Math.max(maxTime, fCurrentTime);

View File

@ -3,6 +3,8 @@ package com.minres.scviewer.database.vcd;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import com.minres.scviewer.database.BitVector;
class VCDFileParser { class VCDFileParser {
private StreamTokenizer tokenizer; private StreamTokenizer tokenizer;
private IVCDDatabaseBuilder traceBuilder; private IVCDDatabaseBuilder traceBuilder;

View File

@ -1,27 +1,28 @@
package com.minres.scviewer.database.vcd; package com.minres.scviewer.database.vcd;
import com.minres.scviewer.database.BitVector;
import com.minres.scviewer.database.EventTime; import com.minres.scviewer.database.EventTime;
import com.minres.scviewer.database.ISignalChangeMulti; import com.minres.scviewer.database.ISignalChangeMulti;
import com.minres.scviewer.database.SignalChange; import com.minres.scviewer.database.SignalChange;
public class VCDSignalChangeMulti extends SignalChange implements ISignalChangeMulti, Cloneable { public class VCDSignalChangeMulti extends SignalChange implements ISignalChangeMulti, Cloneable {
private String value; private BitVector value;
public VCDSignalChangeMulti(EventTime time) { public VCDSignalChangeMulti(EventTime time) {
super(time); super(time);
} }
public VCDSignalChangeMulti(EventTime time, String value) { public VCDSignalChangeMulti(EventTime time, BitVector decodedValues) {
super(time); super(time);
this.value=value; this.value=decodedValues;
} }
public String getValue() { public BitVector getValue() {
return value; return value;
} }
public void setValue(String value) { public void setValue(BitVector value) {
this.value = value; this.value = value;
} }

View File

@ -67,7 +67,7 @@
id="com.minres.scviewer.ui.propertySectionAll" id="com.minres.scviewer.ui.propertySectionAll"
tab="com.minres.scviewer.ui.propertyTabTransaction"> tab="com.minres.scviewer.ui.propertyTabTransaction">
<input <input
type="com.minres.scviewer.database.ITransaction"> type="com.minres.scviewer.database.ITx">
</input> </input>
</propertySection> </propertySection>
<propertySection <propertySection
@ -76,7 +76,7 @@
id="com.minres.scviewer.ui.propertySectionAttributes" id="com.minres.scviewer.ui.propertySectionAttributes"
tab="com.minres.scviewer.ui.propertyTabAttributes"> tab="com.minres.scviewer.ui.propertyTabAttributes">
<input <input
type="com.minres.scviewer.database.ITransaction"> type="com.minres.scviewer.database.ITx">
</input> </input>
</propertySection> </propertySection>
<propertySection <propertySection
@ -85,7 +85,7 @@
id="com.minres.scviewer.ui.propertySectionRelated" id="com.minres.scviewer.ui.propertySectionRelated"
tab="com.minres.scviewer.ui.propertyTabRelated"> tab="com.minres.scviewer.ui.propertyTabRelated">
<input <input
type="com.minres.scviewer.database.ITransaction"> type="com.minres.scviewer.database.ITx">
</input> </input>
</propertySection> </propertySection>
</propertySections> </propertySections>
@ -93,8 +93,8 @@
<extension <extension
point="org.eclipse.core.runtime.adapters"> point="org.eclipse.core.runtime.adapters">
<factory <factory
adaptableType="com.minres.scviewer.database.ITransaction" adaptableType="com.minres.scviewer.database.ITx"
class="com.minres.scviewer.ui.adapter.AdapterFactory"> class="com.minres.scviewer.ui.adapter.TxAdapterFactory">
<adapter <adapter
type="org.eclipse.ui.views.properties.IPropertySource"> type="org.eclipse.ui.views.properties.IPropertySource">
</adapter> </adapter>

View File

@ -118,7 +118,8 @@ public class TxEditorPlugin extends AbstractUIPlugin {
case trackBgLightColor: case trackBgLightColor:
return SWTResourceManager.getColor(220, 220, 220); return SWTResourceManager.getColor(220, 220, 220);
case trackBgDarkColor: case trackBgDarkColor:
return SWTResourceManager.getColor(200, 200, 200); // return SWTResourceManager.getColor(200, 200, 200);
return SWTResourceManager.getColor(SWT.COLOR_BLACK);
case headerBgColor: case headerBgColor:
return SWTResourceManager.getColor(255, 255, 255); return SWTResourceManager.getColor(255, 255, 255);
case headerFgColor: case headerFgColor:

View File

@ -0,0 +1,24 @@
package com.minres.scviewer.ui.adapter;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.ui.views.properties.IPropertySource;
import com.minres.scviewer.database.ITx;
public class TxAdapterFactory implements IAdapterFactory {
@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType == IPropertySource.class)
return new ITransactionPropertySource((ITx) adaptableObject);
return null;
}
@SuppressWarnings("rawtypes")
@Override
public Class[] getAdapterList() {
return new Class[]{IPropertySource.class};
}
}

View File

@ -23,7 +23,7 @@ import com.minres.scviewer.ui.TxEditorPlugin;
public class SignalWidget extends Canvas implements IWaveformWidget{ public class SignalWidget extends Canvas implements IWaveformWidget{
static final int trackHeight = 50; static final int trackHeight = 50;
static final int trackInset = 2; static final int trackInset = 1;
static final int txHeight = trackHeight - 2 * trackInset; static final int txHeight = trackHeight - 2 * trackInset;
static double zoomFactor = EventTime.NS; static double zoomFactor = EventTime.NS;
@ -32,10 +32,8 @@ public class SignalWidget extends Canvas implements IWaveformWidget{
private Color color0; private Color color0;
private Color color1; private Color color1;
private Color colorZ; private Color colorZ;
private Color colorZdark;
private Color colorX; private Color colorX;
private Color colorXdark; private Color colorText;
private Color colorC;
private long length; private long length;
ISignal<ISignalChange> signal; ISignal<ISignalChange> signal;
@ -50,12 +48,10 @@ public class SignalWidget extends Canvas implements IWaveformWidget{
lineColor=plugin.getColor(TxEditorPlugin.lineColor); lineColor=plugin.getColor(TxEditorPlugin.lineColor);
trackBgColor=plugin.getColor(TxEditorPlugin.trackBgDarkColor); trackBgColor=plugin.getColor(TxEditorPlugin.trackBgDarkColor);
color0=SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN); color0=SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN);
color1=SWTResourceManager.getColor(SWT.COLOR_GREEN); color1=SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN);
colorZ=SWTResourceManager.getColor(SWT.COLOR_GRAY); colorZ=SWTResourceManager.getColor(SWT.COLOR_GRAY);
colorX=SWTResourceManager.getColor(SWT.COLOR_RED); colorX=SWTResourceManager.getColor(SWT.COLOR_RED);
colorZdark=SWTResourceManager.getColor(SWT.COLOR_DARK_GRAY); colorText=SWTResourceManager.getColor(SWT.COLOR_WHITE);
colorXdark=SWTResourceManager.getColor(SWT.COLOR_DARK_RED);
colorC=SWTResourceManager.getColor(SWT.COLOR_BLUE);
} }
public void setTransactions(ISignal<ISignalChange> signal) { public void setTransactions(ISignal<ISignalChange> signal) {
@ -97,11 +93,11 @@ public class SignalWidget extends Canvas implements IWaveformWidget{
switch(((ISignalChangeSingle) lastChange).getValue()){ switch(((ISignalChangeSingle) lastChange).getValue()){
case '1': case '1':
color=color1; color=color1;
yOffset = trackHeight/3; yOffset = trackHeight/5;
break; break;
case '0': case '0':
color=color0; color=color0;
yOffset = 2*trackHeight/3; yOffset = 4*trackHeight/5;
break; break;
case 'Z': case 'Z':
color=colorZ; color=colorZ;
@ -110,37 +106,33 @@ public class SignalWidget extends Canvas implements IWaveformWidget{
} }
gc.setForeground(color); gc.setForeground(color);
int endTime= (int)(actChange.getTime().getValue()/zoomFactor); int endTime= (int)(actChange.getTime().getValue()/zoomFactor);
gc.drawLine((int)(lastChange.getTime().getValue()/zoomFactor), yOffset, gc.drawLine((int)(lastChange.getTime().getValue()/zoomFactor), yOffset, endTime, yOffset);
endTime, yOffset);
int yNext = trackHeight/2; int yNext = trackHeight/2;
switch(((ISignalChangeSingle) actChange).getValue()){ switch(((ISignalChangeSingle) actChange).getValue()){
case '1': case '1':
yNext = trackHeight/3; yNext = trackHeight/5;
break; break;
case '0': case '0':
yNext = 2*trackHeight/3; yNext = 4*trackHeight/5;
break; break;
default: default:
} }
gc.setForeground(colorC); // gc.setForeground(colorC);
if(yOffset<yNext) if(yOffset<yNext)
gc.drawLine(endTime, yOffset, endTime, yNext); gc.drawLine(endTime, yOffset, endTime, yNext);
else else
gc.drawLine(endTime, yNext, endTime, yOffset); gc.drawLine(endTime, yNext, endTime, yOffset);
} else if(lastChange instanceof ISignalChangeMulti){ } else if(lastChange instanceof ISignalChangeMulti){
int yOffsetT = trackHeight/3; int yOffsetT = trackHeight/5;
int yOffsetM = trackHeight/2; int yOffsetM = trackHeight/2;
int yOffsetB = 2*trackHeight/3; int yOffsetB = 4*trackHeight/5;
Color color = color1;
Color colorBorder = color0; Color colorBorder = color0;
ISignalChangeMulti last = (ISignalChangeMulti) lastChange; ISignalChangeMulti last = (ISignalChangeMulti) lastChange;
if(last.getValue().contains("X")){ if(last.getValue().toString().contains("X")){
color=colorX; colorBorder=colorX;
colorBorder=colorXdark; }else if(last.getValue().toString().contains("Z")){
}else if(last.getValue().contains("Z")){ colorBorder=colorZ;
color=colorZ;
colorBorder=colorZdark;
} }
int beginTime= (int)(lastChange.getTime().getValue()/zoomFactor); int beginTime= (int)(lastChange.getTime().getValue()/zoomFactor);
int endTime= (int)(actChange.getTime().getValue()/zoomFactor); int endTime= (int)(actChange.getTime().getValue()/zoomFactor);
@ -152,11 +144,12 @@ public class SignalWidget extends Canvas implements IWaveformWidget{
endTime-1,yOffsetB, endTime-1,yOffsetB,
beginTime+1,yOffsetB beginTime+1,yOffsetB
}; };
gc.setBackground(color);
gc.fillPolygon(points);
gc.setForeground(colorBorder); gc.setForeground(colorBorder);
gc.drawPolygon(points); gc.drawPolygon(points);
gc.drawText(last.getValue(), beginTime+1, yOffsetT+1); gc.setForeground(colorText);
int size = gc.getDevice().getDPI().y * gc.getFont().getFontData()[0].getHeight()/72;
// gc.setClipping(beginTime+3,yOffsetM-size/2-1,endTime-beginTime-4, yOffsetM+size/2+1);
gc.drawText("h'"+last.getValue().toHexString(), beginTime+3, yOffsetM-size/2-1);
} }
} }

View File

@ -2,6 +2,7 @@ package com.minres.scviewer.ui.swt;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.NavigableSet;
import java.util.Vector; import java.util.Vector;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
@ -27,7 +28,7 @@ import com.minres.scviewer.ui.TxEditorPlugin;
public class Track extends Composite implements IWaveformWidget, MouseListener { public class Track extends Composite implements IWaveformWidget, MouseListener {
static final int trackHeight = 50; static final int trackHeight = 50;
static final int trackInset = 2; static final int trackInset = 1;
static final int txHeight = trackHeight - 2 * trackInset; static final int txHeight = trackHeight - 2 * trackInset;
static double zoomFactor = EventTime.NS; static double zoomFactor = EventTime.NS;
@ -101,7 +102,7 @@ public class Track extends Composite implements IWaveformWidget, MouseListener {
}); });
TxEditorPlugin plugin=TxEditorPlugin.getDefault(); TxEditorPlugin plugin=TxEditorPlugin.getDefault();
lineColor=plugin.getColor(TxEditorPlugin.lineColor); lineColor=plugin.getColor(TxEditorPlugin.lineColor);
trackBgColor=plugin.getColor(TxEditorPlugin.trackBgLightColor); trackBgColor=plugin.getColor(TxEditorPlugin.trackBgDarkColor);
} }
@ -121,7 +122,7 @@ public class Track extends Composite implements IWaveformWidget, MouseListener {
} }
public void setTransactions(List<ITx> transactions) { public void setTransactions(NavigableSet<ITx> transactions) {
Vector<ITx> rowendtime = new Vector<ITx>(); Vector<ITx> rowendtime = new Vector<ITx>();
for (ITx tx : transactions) { for (ITx tx : transactions) {
int rowIdx = 0; int rowIdx = 0;
@ -188,7 +189,7 @@ public class Track extends Composite implements IWaveformWidget, MouseListener {
} }
public Transaction highlight(Object obj){ public Transaction highlight(Object obj){
if(obj instanceof ITx){ if(obj==null || obj instanceof ITx){
ITx tx = (ITx) obj; ITx tx = (ITx) obj;
if(highlightedTx!=null){ if(highlightedTx!=null){
transactionMap.get(highlightedTx).highlight(false); transactionMap.get(highlightedTx).highlight(false);

View File

@ -24,7 +24,7 @@ public class Transaction extends Composite {
private boolean highlighted=false; private boolean highlighted=false;
Transaction(Composite parent, int style, int lenght) { Transaction(Composite parent, int style, int lenght) {
super(parent, style); super(parent, style|SWT.NO_BACKGROUND);
this.length=lenght; this.length=lenght;
addDisposeListener(new DisposeListener() { addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) { public void widgetDisposed(DisposeEvent e) {
@ -53,7 +53,7 @@ public class Transaction extends Composite {
gc.setBackground(highlighted?txHighliteBgColor:txBgColor); gc.setBackground(highlighted?txHighliteBgColor:txBgColor);
gc.setLineWidth(1); gc.setLineWidth(1);
gc.setLineStyle(SWT.LINE_SOLID); gc.setLineStyle(SWT.LINE_SOLID);
Rectangle bb = new Rectangle(0, 0, length-1, height-1); Rectangle bb = new Rectangle(0, height/5, length-1, 3*height/5);
if(bb.width<8){ if(bb.width<8){
gc.fillRectangle(bb); gc.fillRectangle(bb);
gc.drawRectangle(bb); gc.drawRectangle(bb);

View File

@ -174,7 +174,7 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo
protected RowLayout createScrolledLayoutData(boolean center) { protected RowLayout createScrolledLayoutData(boolean center) {
RowLayout nameListLayout = new RowLayout(SWT.VERTICAL); RowLayout nameListLayout = new RowLayout(SWT.VERTICAL);
nameListLayout.spacing = 4; nameListLayout.spacing = 2;
nameListLayout.marginTop = 0; nameListLayout.marginTop = 0;
nameListLayout.marginRight = 0; nameListLayout.marginRight = 0;
nameListLayout.marginLeft = 0; nameListLayout.marginLeft = 0;
@ -337,11 +337,11 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo
Object sel =((IStructuredSelection)selection).getFirstElement(); Object sel =((IStructuredSelection)selection).getFirstElement();
if(sel instanceof ITx && currentSelection!=sel){ if(sel instanceof ITx && currentSelection!=sel){
if(currentSelection!=null){ if(currentSelection!=null){
ITxStream stream = currentSelection.getGenerator().getStream(); ITxStream stream = currentSelection.getStream();
if(trackMap.containsKey(stream)) trackMap.get(stream).highlight(null); if(trackMap.containsKey(stream)) trackMap.get(stream).highlight(null);
} }
currentSelection=(ITx) sel; currentSelection=(ITx) sel;
ITxStream stream = currentSelection.getGenerator().getStream(); ITxStream stream = currentSelection.getStream();
if(trackMap.containsKey(stream)){ if(trackMap.containsKey(stream)){
Transaction trans = trackMap.get(stream).highlight(sel); Transaction trans = trackMap.get(stream).highlight(sel);
trackListScrolled.showControl(trans); trackListScrolled.showControl(trans);

View File

@ -221,7 +221,7 @@ public class AttributeProperty extends AbstractPropertySection implements ISelec
public void menuAboutToShow(IMenuManager mgr) { public void menuAboutToShow(IMenuManager mgr) {
ISelection selection = treeViewer.getSelection(); ISelection selection = treeViewer.getSelection();
if (selection instanceof IStructuredSelection) { if (selection instanceof IStructuredSelection) {
System.out.println(((IStructuredSelection)selection).getFirstElement().toString()); // System.out.println(((IStructuredSelection)selection).getFirstElement().toString());
} }
} }
}); });

View File

@ -90,9 +90,9 @@ public:
: pipelined_bus_ports(nm) : pipelined_bus_ports(nm)
, addr_phase("addr_phase") , addr_phase("addr_phase")
, data_phase("data_phase") , data_phase("data_phase")
, pipelined_stream("pipelined_stream", "transactor") , pipelined_stream((std::string(name()) +".pipelined_stream").c_str(), "transactor")
, addr_stream( "addr_stream", "transactor") , addr_stream( (std::string(name()) +".addr_stream").c_str(), "transactor")
, data_stream("data_stream", "transactor") , data_stream((std::string(name()) +".data_stream").c_str(), "transactor")
, read_gen("read", pipelined_stream, "addr", "data") , read_gen("read", pipelined_stream, "addr", "data")
, write_gen("write", pipelined_stream, "addr", "data") , write_gen("write", pipelined_stream, "addr", "data")
, addr_gen("addr", addr_stream, "addr") , addr_gen("addr", addr_stream, "addr")
@ -327,9 +327,9 @@ extern void scv_tr_sqlite_init();
int sc_main(int argc, char *argv[]) { int sc_main(int argc, char *argv[]) {
scv_startup(); scv_startup();
#if 0 #if 1
scv_tr_text_init(); scv_tr_text_init();
const char* fileName = "my_db.log"; const char* fileName = "my_db.txlog";
#else #else
scv_tr_sqlite_init(); scv_tr_sqlite_init();
const char* fileName = "my_db"; const char* fileName = "my_db";