mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
added combined process regression line
This commit is contained in:
parent
b1571f7ee9
commit
92d9687ded
@ -169,8 +169,8 @@ def genLegend(fits, coefs, r2, spec):
|
|||||||
|
|
||||||
eq = eq[3:]
|
eq = eq[3:]
|
||||||
|
|
||||||
legend_elements = [lines.Line2D([0], [0], color=spec.color, label=eq),
|
legend_elements = [lines.Line2D([0], [0], color=spec.color, label=eq)]
|
||||||
lines.Line2D([0], [0], color=spec.color, ls='', marker=spec.shape, label=spec.tech +' $R^2$='+ str(round(r2, 4)))]
|
if spec.shape: legend_elements += [lines.Line2D([0], [0], color=spec.color, ls='', marker=spec.shape, label=spec.tech +' $R^2$='+ str(round(r2, 4)))]
|
||||||
return legend_elements
|
return legend_elements
|
||||||
|
|
||||||
def oneMetricPlot(module, var, freq=None, ax=None, fits='clsgn', norm=True, color=None):
|
def oneMetricPlot(module, var, freq=None, ax=None, fits='clsgn', norm=True, color=None):
|
||||||
@ -193,6 +193,9 @@ def oneMetricPlot(module, var, freq=None, ax=None, fits='clsgn', norm=True, colo
|
|||||||
|
|
||||||
global norms
|
global norms
|
||||||
|
|
||||||
|
allWidths = []
|
||||||
|
allMetrics = []
|
||||||
|
|
||||||
for spec in techSpecs:
|
for spec in techSpecs:
|
||||||
metric = getVals(spec.tech, module, var, freq=freq)
|
metric = getVals(spec.tech, module, var, freq=freq)
|
||||||
|
|
||||||
@ -202,12 +205,19 @@ def oneMetricPlot(module, var, freq=None, ax=None, fits='clsgn', norm=True, colo
|
|||||||
metric = [m/norm for m in metric] # comment out to not normalize
|
metric = [m/norm for m in metric] # comment out to not normalize
|
||||||
|
|
||||||
if len(metric) == 5:
|
if len(metric) == 5:
|
||||||
|
allWidths += widths
|
||||||
|
allMetrics += metric
|
||||||
xp, pred, leg = regress(widths, metric, spec, fits)
|
xp, pred, leg = regress(widths, metric, spec, fits)
|
||||||
fullLeg += leg
|
fullLeg += leg
|
||||||
c = color if color else spec.color
|
c = color if color else spec.color
|
||||||
ax.scatter(widths, metric, color=c, marker=spec.shape)
|
ax.scatter(widths, metric, color=c, marker=spec.shape)
|
||||||
ax.plot(xp, pred, color=c)
|
ax.plot(xp, pred, color=c)
|
||||||
|
|
||||||
|
combined = TechSpec('combined', 'red', 0, 0, 0, 0, 0)
|
||||||
|
xp, pred, leg = regress(allWidths, allMetrics, combined, fits)
|
||||||
|
fullLeg += leg
|
||||||
|
ax.plot(xp, pred, color='red')
|
||||||
|
|
||||||
ax.legend(handles=fullLeg)
|
ax.legend(handles=fullLeg)
|
||||||
|
|
||||||
ax.set_xticks(widths)
|
ax.set_xticks(widths)
|
||||||
@ -508,24 +518,23 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
|
|
||||||
# cleanup()
|
# cleanup()
|
||||||
synthsintocsv() # slow, run only when new synth runs to add to csv
|
# synthsintocsv() # slow, run only when new synth runs to add to csv
|
||||||
|
|
||||||
allSynths = synthsfromcsv('ppaData.csv') # your csv here!
|
allSynths = synthsfromcsv('ppaData.csv') # your csv here!
|
||||||
|
|
||||||
# # ### examples
|
# # ### examples
|
||||||
|
|
||||||
# # squareAreaDelay('sky90', 'add', 32)
|
# squareAreaDelay('sky90', 'add', 32)
|
||||||
# # plotBestAreas('add')
|
# plotBestAreas('add')
|
||||||
# oneMetricPlot('mux2', 'delay', norm=False)
|
# oneMetricPlot('add', 'delay')
|
||||||
# print(len(freqsL[0]))
|
|
||||||
# freqPlot('sky90', 'mux4', 16)
|
# freqPlot('sky90', 'mux4', 16)
|
||||||
|
|
||||||
for mod in modules:
|
for mod in modules:
|
||||||
plotPPA(mod, norm=False)
|
plotPPA(mod, norm=False)
|
||||||
plotPPA(mod)
|
plotPPA(mod)
|
||||||
for w in [8, 16, 32, 64, 128]:
|
# for w in [8, 16, 32, 64, 128]:
|
||||||
freqPlot('sky90', mod, w)
|
# freqPlot('sky90', mod, w)
|
||||||
freqPlot('tsmc28', mod, w)
|
# freqPlot('tsmc28', mod, w)
|
||||||
plt.close('all')
|
plt.close('all')
|
||||||
|
|
||||||
csvOfBest()
|
# csvOfBest()
|
Loading…
Reference in New Issue
Block a user