Fixed VCD parsing error

This commit is contained in:
Eyck Jentzsch 2018-07-16 13:17:58 +02:00 committed by Brita Keller
parent 1cf00ec882
commit 0833bca1bd
2 changed files with 7 additions and 6 deletions

View File

@ -92,8 +92,8 @@ public class DatabaseServicesTest {
assertTrue(f.exists());
waveformDb.load(f);
assertNotNull(waveformDb);
assertEquals(718, waveformDb.getAllWaves().size());
assertEquals(33, waveformDb.getChildNodes().size());
assertEquals(778, waveformDb.getAllWaves().size());
assertEquals(1, waveformDb.getChildNodes().size());
}

View File

@ -124,9 +124,9 @@ public class VCDDbLoader implements IWaveformDbLoader, IVCDDatabaseBuilder {
*/
@Override
public void enterModule(String tokenString) {
if(moduleStack.isEmpty())
moduleStack.push(tokenString);
else
if(moduleStack.isEmpty()) {
if("SystemC".compareTo(tokenString)!=0) moduleStack.push(tokenString);
} else
moduleStack.push(moduleStack.peek()+"."+tokenString);
}
@ -144,7 +144,8 @@ public class VCDDbLoader implements IWaveformDbLoader, IVCDDatabaseBuilder {
*/
@SuppressWarnings("unchecked")
@Override
public Integer newNet(String netName, int i, int width) {
public Integer newNet(String name, int i, int width) {
String netName = moduleStack.empty()? name: moduleStack.lastElement()+"."+name;
int id = signals.size();
VCDSignal<? extends IWaveformEvent> signal;
if(width==1){