-
Notifications
You must be signed in to change notification settings - Fork 0
/
Network2x2.py
76 lines (60 loc) · 3.26 KB
/
Network2x2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from collections import OrderedDict
from Config.Mappings import charOutToHumanReadableAnnotation
from LogSamplePlot import Plotter as pltr
from LogSamplePlot import Filter as fltr
from Config import Mappings as mappingConfig
from Config import Input as inputConfig
if __name__ == "__main__":
dataFilter = fltr.Filter(inputConfig.logFile, mappingConfig.wireToFloatValueMapping)
dataPlotter = pltr.Plotter()
numRows = 2
numColumns = 2
nodesTotal = numRows * numColumns
filter = fltr.SampleFilter(domain="WIRE", name="tx-south", nodeId=0)
dataFilter.filter(filter)
xData, yData, annotations = dataFilter.getData(filter)
dataPlotter.addPlot(xData, yData, annotations, "[%s] %s" % (filter.nodeId, filter.name))
filter = fltr.SampleFilter(domain="WIRE", name="tx-north", nodeId=1)
dataFilter.filter(filter)
xData, yData, annotations = dataFilter.getData(filter)
dataPlotter.addPlot(xData, yData, annotations, "[%s] %s" % (filter.nodeId, filter.name))
filter = fltr.SampleFilter(domain="WIRE", name="tx-east", nodeId=0)
dataFilter.filter(filter)
xData, yData, annotations = dataFilter.getData(filter)
dataPlotter.addPlot(xData, yData, annotations, "[%s] %s" % (filter.nodeId, filter.name))
filter = fltr.SampleFilter(domain="WIRE", name="tx-north", nodeId=2)
dataFilter.filter(filter)
xData, yData, annotations = dataFilter.getData(filter)
dataPlotter.addPlot(xData, yData, annotations, "[%s] %s" % (filter.nodeId, filter.name))
filter = fltr.SampleFilter(domain="WIRE", name="tx-south", nodeId=2)
dataFilter.filter(filter)
xData, yData, annotations = dataFilter.getData(filter)
dataPlotter.addPlot(xData, yData, annotations, "[%s] %s" % (filter.nodeId, filter.name))
filter = fltr.SampleFilter(domain="WIRE", name="tx-north", nodeId=3)
dataFilter.filter(filter)
xData, yData, annotations = dataFilter.getData(filter)
dataPlotter.addPlot(xData, yData, annotations, "[%s] %s" % (filter.nodeId, filter.name))
# char out plots
for id in range(0, nodesTotal):
filter = fltr.SampleFilter(domain="SRAM", name="char-out", nodeId=id)
dataFilter.removeSamples(filter)
dataFilter.filter(filter)
xData, yData, annotations = dataFilter.getData(filter)
annotations = pltr.reMapAnnotation(annotations, charOutToHumanReadableAnnotation)
dataPlotter.addPlot(xData, yData, annotations, "[%s] %s" % (filter.nodeId, filter.name))
# int16 out plots
for id in range(0, nodesTotal):
filter = fltr.SampleFilter(domain="SRAM", name="int16-out", nodeId=id)
dataFilter.removeSamples(filter)
dataFilter.filter(filter)
xData, yData, annotations = dataFilter.getData(filter)
dataPlotter.addPlot(xData, yData, annotations, "[%s] %s" % (filter.nodeId, filter.name))
# node state plots
for id in range(0, nodesTotal):
filter = fltr.SampleFilter(domain="SRAM", name="Particle.node.state", nodeId=id)
dataFilter.filter(filter)
xData, yData, annotations = dataFilter.getData(filter)
dataPlotter.addPlot(xData, yData, annotations, "[%s] %s" % (filter.nodeId, filter.name))
dataPlotter.setWindowTitle("Network %sx%s Simulation" % (numRows, numColumns))
dataFilter.printValues()
dataPlotter.plot()