add performance improvement fixes
This commit is contained in:
parent
20824e75c1
commit
8b84f1341b
@ -24,8 +24,8 @@
|
||||
</compilerArguments>
|
||||
<!-- set verbose to be true if you want lots of uninteresting messages -->
|
||||
<!-- <verbose>true</verbose> -->
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -83,7 +83,7 @@ public class TextDbLoader implements IWaveformDbLoader{
|
||||
.make()
|
||||
// NPE here --->
|
||||
parseInput(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file))
|
||||
calculateConcurrencyIndicees()
|
||||
streams.each{ TxStream stream -> stream.getMaxConcurrency() }
|
||||
return true
|
||||
}
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
@ -136,7 +136,7 @@ public class TextDbLoader implements IWaveformDbLoader{
|
||||
case "ms":return 1000000000000L
|
||||
case "s": return 1000000000000000L
|
||||
}
|
||||
return "fs"
|
||||
return 1L
|
||||
}
|
||||
|
||||
private def parseInput(InputStream inputStream){
|
||||
@ -153,23 +153,29 @@ public class TextDbLoader implements IWaveformDbLoader{
|
||||
def tokens = line.split(/\s+/) as ArrayList
|
||||
switch(tokens[0]){
|
||||
case "scv_tr_stream":
|
||||
case "scv_tr_generator":
|
||||
case "begin_attribute":
|
||||
case "end_attribute":
|
||||
if ((matcher = line =~ /^scv_tr_stream\s+\(ID (\d+),\s+name\s+"([^"]+)",\s+kind\s+"([^"]+)"\)$/)) {
|
||||
def id = Integer.parseInt(matcher[0][1])
|
||||
def stream = new TxStream(this, id, matcher[0][2], matcher[0][3])
|
||||
streams<<stream
|
||||
streamsById[id]=stream
|
||||
} else if ((matcher = line =~ /^scv_tr_generator\s+\(ID\s+(\d+),\s+name\s+"([^"]+)",\s+scv_tr_stream\s+(\d+),$/)) {
|
||||
}
|
||||
break;
|
||||
case "scv_tr_generator":
|
||||
if ((matcher = line =~ /^scv_tr_generator\s+\(ID\s+(\d+),\s+name\s+"([^"]+)",\s+scv_tr_stream\s+(\d+),$/)) {
|
||||
def id = Integer.parseInt(matcher[0][1])
|
||||
ITxStream stream=streamsById[Integer.parseInt(matcher[0][3])]
|
||||
generator=new TxGenerator(id, stream, matcher[0][2])
|
||||
stream.generators<<generator
|
||||
generatorsById[id]=generator
|
||||
} else if ((matcher = line =~ /^begin_attribute \(ID (\d+), name "([^"]+)", type "([^"]+)"\)$/)) {
|
||||
}
|
||||
break;
|
||||
case "begin_attribute":
|
||||
if ((matcher = line =~ /^begin_attribute \(ID (\d+), name "([^"]+)", type "([^"]+)"\)$/)) {
|
||||
generator.begin_attrs << TxAttributeType.getAttrType(matcher[0][2], DataType.valueOf(matcher[0][3]), AssociationType.BEGIN)
|
||||
} else if ((matcher = line =~ /^end_attribute \(ID (\d+), name "([^"]+)", type "([^"]+)"\)$/)) {
|
||||
}
|
||||
break;
|
||||
case "end_attribute":
|
||||
if ((matcher = line =~ /^end_attribute \(ID (\d+), name "([^"]+)", type "([^"]+)"\)$/)) {
|
||||
generator.end_attrs << TxAttributeType.getAttrType(matcher[0][2], DataType.valueOf(matcher[0][3]), AssociationType.END)
|
||||
}
|
||||
break;
|
||||
@ -228,31 +234,6 @@ public class TextDbLoader implements IWaveformDbLoader{
|
||||
}
|
||||
}
|
||||
|
||||
private def toDataType(String str){
|
||||
switch (str)
|
||||
{
|
||||
case "BOOLEAN": return DataType. BOOLEAN
|
||||
case "ENUMERATION": return DataType. ENUMERATION
|
||||
case "INTEGER": return DataType. INTEGER
|
||||
case "UNSIGNED": return DataType. UNSIGNED
|
||||
case "FLOATING_POINT_NUMBER": return DataType. FLOATING_POINT_NUMBER
|
||||
case "BIT_VECTOR": return DataType. BIT_VECTOR
|
||||
case "LOGIC_VECTOR": return DataType. LOGIC_VECTOR
|
||||
case "FIXED_POINT_INTEGER": return DataType. FIXED_POINT_INTEGER
|
||||
case "UNSIGNED_FIXED_POINT_INTEGER": return DataType. UNSIGNED_FIXED_POINT_INTEGER
|
||||
case "RECORD": return DataType. RECORD
|
||||
case "POINTER": return DataType. POINTER
|
||||
case "ARRAY": return DataType. ARRAY
|
||||
case "STRING": return DataType. STRING
|
||||
default: return DataType.INTEGER
|
||||
}
|
||||
}
|
||||
|
||||
private def calculateConcurrencyIndicees(){
|
||||
streams.each{ TxStream stream -> stream.getMaxConcurrency() }
|
||||
}
|
||||
|
||||
|
||||
public Collection<RelationType> getAllRelationTypes(){
|
||||
return relationTypes.values();
|
||||
}
|
||||
|
@ -24,8 +24,8 @@
|
||||
|
||||
<properties>
|
||||
<tycho-version>1.5.0</tycho-version>
|
||||
<groovy-eclipse-compiler-version>3.5.0</groovy-eclipse-compiler-version>
|
||||
<groovy-eclipse-batch-version>2.5.8-03</groovy-eclipse-batch-version>
|
||||
<groovy-eclipse-compiler-version>3.6.0-03</groovy-eclipse-compiler-version>
|
||||
<groovy-eclipse-batch-version>3.0.3-01</groovy-eclipse-batch-version>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
|
Loading…
Reference in New Issue
Block a user