From 92d9687ded2b142399f7d71fc84e1f89a6ab7dce Mon Sep 17 00:00:00 2001 From: Madeleine Masser-Frye <51804758+mmasserfrye@users.noreply.github.com> Date: Fri, 3 Jun 2022 22:53:03 +0000 Subject: [PATCH] added combined process regression line --- synthDC/ppaAnalyze.py | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/synthDC/ppaAnalyze.py b/synthDC/ppaAnalyze.py index 9c2bb6e8e..f59859569 100755 --- a/synthDC/ppaAnalyze.py +++ b/synthDC/ppaAnalyze.py @@ -169,8 +169,8 @@ def genLegend(fits, coefs, r2, spec): eq = eq[3:] - 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)))] + legend_elements = [lines.Line2D([0], [0], color=spec.color, label=eq)] + 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 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 + allWidths = [] + allMetrics = [] + for spec in techSpecs: 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 if len(metric) == 5: + allWidths += widths + allMetrics += metric xp, pred, leg = regress(widths, metric, spec, fits) fullLeg += leg c = color if color else spec.color ax.scatter(widths, metric, color=c, marker=spec.shape) 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.set_xticks(widths) @@ -508,24 +518,23 @@ if __name__ == '__main__': # 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! # # ### examples - # # squareAreaDelay('sky90', 'add', 32) - # # plotBestAreas('add') - # oneMetricPlot('mux2', 'delay', norm=False) - # print(len(freqsL[0])) + # squareAreaDelay('sky90', 'add', 32) + # plotBestAreas('add') + # oneMetricPlot('add', 'delay') # freqPlot('sky90', 'mux4', 16) for mod in modules: plotPPA(mod, norm=False) plotPPA(mod) - for w in [8, 16, 32, 64, 128]: - freqPlot('sky90', mod, w) - freqPlot('tsmc28', mod, w) + # for w in [8, 16, 32, 64, 128]: + # freqPlot('sky90', mod, w) + # freqPlot('tsmc28', mod, w) plt.close('all') - csvOfBest() \ No newline at end of file + # csvOfBest() \ No newline at end of file