From d34f4a7c3c42e4938d900e6bef05edb4ee8f1ed5 Mon Sep 17 00:00:00 2001 From: mmasserfrye Date: Thu, 19 May 2022 20:24:47 +0000 Subject: [PATCH] updated synth plotting and regression --- pipelined/src/ppa/ppa.sv | 3 +- synthDC/ppaAnalyze.py | 230 +++++++++++++++++++++++----------- synthDC/ppaData.csv | 264 +++++++++++++++++++++++++++++---------- synthDC/ppaFitting.csv | 26 ++-- synthDC/ppaSynth.py | 10 +- 5 files changed, 375 insertions(+), 158 deletions(-) diff --git a/pipelined/src/ppa/ppa.sv b/pipelined/src/ppa/ppa.sv index 0207c99f7..32fc45e29 100644 --- a/pipelined/src/ppa/ppa.sv +++ b/pipelined/src/ppa/ppa.sv @@ -313,6 +313,7 @@ module ppa_shifter #(parameter WIDTH=32) ( assign Y = zshift[WIDTH-1:0]; endmodule +// just report one hot module ppa_prioritythermometer #(parameter N = 8) ( input logic [N-1:0] a, output logic [N-1:0] y); @@ -338,7 +339,7 @@ module ppa_priorityonehot #(parameter N = 8) ( assign y = a & nolower; endmodule -module ppa_prioriyencoder #(parameter N = 8) ( +module ppa_priorityencoder #(parameter N = 8) ( input logic [N-1:0] a, output logic [$clog2(N)-1:0] y); // Carefully crafted so design compiler will synthesize into a fast tree structure diff --git a/synthDC/ppaAnalyze.py b/synthDC/ppaAnalyze.py index edad94dd4..56e8b2f83 100755 --- a/synthDC/ppaAnalyze.py +++ b/synthDC/ppaAnalyze.py @@ -1,6 +1,8 @@ #!/usr/bin/python3 from distutils.log import error +from statistics import median import subprocess +import statistics import csv import re import matplotlib.pyplot as plt @@ -32,13 +34,17 @@ def getData(): for i in range(len(linesCPL)): line = linesCPL[i] mwm = wm.findall(line)[0][4:-4].split('_') + freq = int(f.findall(line)[0][1:-4]) + delay = float(cpl.findall(line)[0]) + area = float(da.findall(linesDA[i])[0]) + mod = mwm[0] + width = int(mwm[1]) + power = p.findall(linesP[i]) - oneSynth = [mwm[0], int(mwm[1])] - oneSynth += [int(f.findall(line)[0][1:-4])] - oneSynth += [float(cpl.findall(line)[0])] - oneSynth += [float(da.findall(linesDA[i])[0])] - oneSynth += [float(power[1])] - oneSynth += [float(power[2])] + lpower = float(power[2]) + denergy = float(power[1])/freq + + oneSynth = [mod, width, freq, delay, area, lpower, denergy] allSynths += [oneSynth] return allSynths @@ -47,133 +53,209 @@ def getVals(module, freq, var): global allSynths if (var == 'delay'): ind = 3 - units = " (ps)" + units = " (ns)" elif (var == 'area'): ind = 4 units = " (sq microns)" - elif (var == 'dpower'): - ind = 5 - units = " (mW)" elif (var == 'lpower'): - ind = 6 + ind = 5 units = " (nW)" + elif (var == 'denergy'): + ind = 6 + units = " (uJ)" #fix check math else: error widths = [] - ivar = [] + metric = [] for oneSynth in allSynths: if (oneSynth[0] == module) & (oneSynth[2] == freq): widths += [oneSynth[1]] - ivar += [oneSynth[ind]] - return widths, ivar, units + m = oneSynth[ind] + if (ind==6): m*=1000 + metric += [m] + return widths, metric, units def writeCSV(allSynths): file = open("ppaData.csv", "w") writer = csv.writer(file) - writer.writerow(['Module', 'Width', 'Target Freq', 'Delay', 'Area', 'D Power (mW)', 'L Power (nW)']) + writer.writerow(['Module', 'Width', 'Target Freq', 'Delay', 'Area', 'L Power (nW)', 'D energy (mJ)']) for one in allSynths: writer.writerow(one) file.close() -def polyfitR2(x, y, deg): - ''' from internet, check math''' - z = np.polyfit(x, y, deg) - p = np.poly1d(z) - yhat = p(x) # or [p(z) for z in x] - ybar = np.sum(y)/len(y) # or sum(y)/len(y) - ssreg = np.sum((yhat-ybar)**2) # or sum([ (yihat - ybar)**2 for yihat in yhat]) - sstot = np.sum((y - ybar)**2) # or sum([ (yi - ybar)**2 for yi in y]) - r2 = ssreg / sstot - return p, r2 +def genLegend(fits, coefs, module, r2): -def plotPPA(module, freq, var): + coefsr = [str(round(c, 3)) for c in coefs] + + eq = '' + ind = 0 + if 'c' in fits: + eq += coefsr[ind] + ind += 1 + if 'l' in fits: + eq += " + " + coefsr[ind] + "*N" + ind += 1 + if 's' in fits: + eq += " + " + coefsr[ind] + "*N^2" + ind += 1 + if 'g' in fits: + eq += " + " + coefsr[ind] + "*log2(N)" + ind += 1 + if 'n' in fits: + eq += " + " + coefsr[ind] + "*Nlog2(N)" + ind += 1 + + legend_elements = [lines.Line2D([0], [0], color='orange', label=eq), + lines.Line2D([0], [0], color='steelblue', ls='', marker='o', label=' R^2='+ str(round(r2, 4)))] + return legend_elements + +def plotPPA(module, freq, var, ax=None, fits='clsgn'): ''' module: string module name - freq: int freq (GHz) - var: string 'delay' or 'area' + freq: int freq (MHz) + var: string delay, area, lpower, or denergy + fits: constant, linear, square, log2, Nlog2 plots chosen variable vs width for all matching syntheses with regression ''' - - # A = np.vstack([x, np.ones(len(x))]).T - # mcresid = np.linalg.lstsq(A, y, rcond=None) - # m, c = mcresid[0] - # resid = mcresid[1] - # r2 = 1 - resid / (y.size * y.var()) - # p, r2p = polyfitR2(x, y, 2) - # zlog = np.polyfit(np.log(x), y, 1) - # plog = np.poly1d(zlog) - # xplog = np.log(xp) - # _ = plt.plot(x, m*x + c, 'r', label='Linear fit R^2='+ str(r2)[1:7]) - # _ = plt.plot(xp, p(xp), label='Quadratic fit R^2='+ str(r2p)[:6]) - # _ = plt.plot(xp, plog(xplog), label = 'Log fit') - - widths, ivar, units = getVals(module, freq, var) - coefs, r2 = regress(widths, ivar) + widths, metric, units = getVals(module, freq, var) + coefs, r2, funcArr = regress(widths, metric, fits) xp = np.linspace(8, 140, 200) - pred = [coefs[0] + x*coefs[1] + np.log(x)*coefs[2] + x*np.log(x)*coefs[3] for x in xp] + pred = [] + for x in xp: + y = [func(x) for func in funcArr] + pred += [sum(np.multiply(coefs, y))] - r2p = round(r2[0], 4) - rcoefs = [round(c, 3) for c in coefs] + if ax is None: + singlePlot = True + ax = plt.gca() + else: + singlePlot = False - l = "{} + {}*N + {}*log(N) + {}*Nlog(N)".format(*rcoefs) - legend_elements = [lines.Line2D([0], [0], color='steelblue', label=module), - lines.Line2D([0], [0], color='orange', label=l), - lines.Line2D([0], [0], ls='', label=' R^2='+ str(r2p))] + ax.scatter(widths, metric) + ax.plot(xp, pred, color='orange') - _ = plt.plot(widths, ivar, 'o', label=module, markersize=10) - _ = plt.plot(xp, pred) - _ = plt.legend(handles=legend_elements) - _ = plt.xlabel("Width (bits)") - _ = plt.ylabel(str.title(var) + units) - _ = plt.title("Target frequency " + str(freq) + "MHz") + legend_elements = genLegend(fits, coefs, module, r2) + ax.legend(handles=legend_elements) + + ax.set_xticks(widths) + ax.set_xlabel("Width (bits)") + ax.set_ylabel(str.title(var) + units) + + if singlePlot: + ax.set_title(module + " (target " + str(freq) + "MHz)") + plt.show() + +def makePlots(mod, freq): + fig, axs = plt.subplots(2, 2) + plotPPA(mod, freq, 'delay', ax=axs[0,0], fits='cgl') + plotPPA(mod, freq, 'area', ax=axs[0,1], fits='clg') + plotPPA(mod, freq, 'lpower', ax=axs[1,0], fits='c') + plotPPA(mod, freq, 'denergy', ax=axs[1,1], fits='glc') + plt.suptitle(mod + " (target " + str(freq) + "MHz)") plt.show() -def makePlots(mod): - plotPPA(mod, 5000, 'delay') - plotPPA(mod, 5000, 'area') - plotPPA(mod, 10, 'area') - plotPPA(mod, 5000, 'lpower') - plotPPA(mod, 5000, 'dpower') +def regress(widths, var, fits='clsgn'): -def regress(widths, var): + funcArr = genFuncs(fits) mat = [] for w in widths: - row = [1, w, np.log(w), w*np.log(w)] + row = [] + for func in funcArr: + row += [func(w)] mat += [row] y = np.array(var, dtype=np.float) coefsResid = np.linalg.lstsq(mat, y, rcond=None) coefs = coefsResid[0] - resid = coefsResid[1] + try: + resid = coefsResid[1][0] + except: + resid = 0 r2 = 1 - resid / (y.size * y.var()) - return coefs, r2 + return coefs, r2, funcArr def makeCoefTable(): file = open("ppaFitting.csv", "w") writer = csv.writer(file) - writer.writerow(['Module', 'Metric', 'Freq', '1', 'N', 'log(N)', 'Nlog(N)', 'R^2']) + writer.writerow(['Module', 'Metric', 'Freq', '1', 'N', 'N^2', 'log2(N)', 'Nlog2(N)', 'R^2']) for mod in ['add', 'mult', 'comparator', 'shifter']: for comb in [['delay', 5000], ['area', 5000], ['area', 10]]: var = comb[0] freq = comb[1] - widths, ivar, units = getVals(mod, freq, var) - coefs, r2 = regress(widths, ivar) - row = [mod] + comb + np.ndarray.tolist(coefs) + [r2[0]] + widths, metric, units = getVals(mod, freq, var) + coefs, r2, funcArr = regress(widths, metric) + row = [mod] + comb + np.ndarray.tolist(coefs) + [r2] writer.writerow(row) file.close() +def genFuncs(fits='clsgn'): + funcArr = [] + if 'c' in fits: + funcArr += [lambda x: 1] + if 'l' in fits: + funcArr += [lambda x: x] + if 's' in fits: + funcArr += [lambda x: x**2] + if 'g' in fits: + funcArr += [lambda x: np.log2(x)] + if 'n' in fits: + funcArr += [lambda x: x*np.log2(x)] + return funcArr + +def noOutliers(freqs, delays, areas): + med = statistics.median(freqs) + f=[] + d=[] + a=[] + for i in range(len(freqs)): + norm = freqs[i]/med + if (norm > 0.25) & (norm<1.75): + f += [freqs[i]] + d += [delays[i]] + a += [areas[i]] + return f, d, a + +def freqPlot(mod, width): + freqs = [] + delays = [] + areas = [] + for oneSynth in allSynths: + if (mod == oneSynth[0]) & (width == oneSynth[1]): + freqs += [oneSynth[2]] + delays += [oneSynth[3]] + areas += [oneSynth[4]] + + freqs, delays, areas = noOutliers(freqs, delays, areas) + + adprod = np.multiply(areas, delays) + adsq = np.multiply(adprod, delays) + + f, (ax1, ax2, ax3, ax4) = plt.subplots(4, 1, sharex=True) + ax1.scatter(freqs, delays) + ax2.scatter(freqs, areas) + ax3.scatter(freqs, adprod) + ax4.scatter(freqs, adsq) + ax4.set_xlabel("Freq (MHz)") + ax1.set_ylabel('Delay (ns)') + ax2.set_ylabel('Area (sq microns)') + ax3.set_ylabel('Area * Delay') + ax4.set_ylabel('Area * Delay^2') + ax1.set_title(mod + '_' + str(width)) + plt.show() + allSynths = getData() - writeCSV(allSynths) +# makeCoefTable() -makePlots('shifter') +freqPlot('comparator', 8) -makeCoefTable() +# makePlots('shifter', 5000) +# plotPPA('comparator', 5000, 'delay', fits='cls') \ No newline at end of file diff --git a/synthDC/ppaData.csv b/synthDC/ppaData.csv index 3ea5648b6..9e09c3403 100644 --- a/synthDC/ppaData.csv +++ b/synthDC/ppaData.csv @@ -1,67 +1,197 @@ -Module,Width,Target Freq,Delay,Area,D Power (mW),L Power (nW) -add,128,10,7.100851,1867.879976,0.00501,465.925 -add,128,5000,0.389771,7007.980119,3.309,2.77 -add,16,10,2.032906,221.479998,0.000575,55.29 -add,16,4000,0.249839,551.74001,0.239,302.479 -add,16,5000,0.228259,924.140017,0.519,641.631 -add,16,6000,0.225754,1120.140018,0.739,1.01 -add,32,10,4.160501,456.679995,0.00118,112.161 -add,32,4000,0.280842,1730.680031,0.735,849.828 -add,32,5000,0.2505,1933.540033,1.049,1.03 -add,32,6000,0.271774,1746.36003,1.138,955.901 -add,64,10,8.474034,927.079988,0.00246,230.083 -add,64,4000,0.323267,3758.300065,1.523,1.75 -add,64,5000,0.334061,3798.480071,1.917,2.18 -add,64,6000,0.328457,3749.480066,2.346,1.77 -add,8,10,0.940062,103.879999,0.000241,24.765 -add,8,5000,0.199689,197.960003,0.113,83.576 -comparator,128,10,0.842074,1997.240039,0.00087,243.506 -comparator,128,5000,0.260142,5215.56005,3.708,6.0 -comparator,16,10,0.576329,252.840005,0.000144,31.402 -comparator,16,4000,0.249312,280.280005,0.0581,55.248 -comparator,16,5000,0.199026,313.600006,0.0859,78.893 -comparator,16,6000,0.166568,422.380007,0.255,301.506 -comparator,32,10,0.765874,495.88001,0.000226,66.41 -comparator,32,4000,0.24995,608.580012,0.168,130.613 -comparator,32,5000,0.205372,919.240014,0.43,840.47 -comparator,32,6000,0.2012,1248.520016,0.928,1.48 -comparator,64,10,0.561562,1008.42002,0.000449,127.626 -comparator,64,4000,0.249905,1437.660027,0.462,558.66 -comparator,64,5000,0.219296,2738.120023,1.989,2.95 -comparator,64,6000,0.221138,2341.220025,1.343,2.59 -comparator,8,10,0.29577,118.580002,6.83e-05,16.053 -comparator,8,5000,0.195502,129.360003,0.0358,21.443 -mult,128,10,9.334627,180734.540854,0.428,1.8 -mult,128,5000,1.78322,314617.244472,997.34,1.63 -mult,16,10,4.730546,3869.040009,0.0107,641.517 -mult,16,4000,0.821111,9132.620147,14.407,8.03 -mult,16,5000,0.820059,9583.420143,20.175,8.5 -mult,16,6000,0.831308,8594.600132,21.106,7.15 -mult,32,10,7.575772,12412.680067,0.0229,1.18 -mult,32,4000,1.091389,31262.980534,65.471,2.49 -mult,32,5000,1.092153,31497.200524,79.554,2.58 -mult,32,6000,1.084816,33519.920555,103.798,2.91 -mult,64,10,4.7933,46798.920227,0.103,5.46 -mult,64,4000,1.411752,93087.261425,227.876,6.05 -mult,64,5000,1.404875,94040.801492,298.667,6.16 -mult,64,6000,1.415466,89931.661403,337.302,5.63 -mult,8,10,2.076433,1009.399998,0.00206,211.637 -mult,8,5000,0.552339,4261.040075,5.543,5.05 -mux2,1,10,0.060639,6.86,5.15e-06,1.19 -mux2,1,10,0.060639,6.86,5.15e-06,1.19 -shifter,128,10,2.758726,9722.580189,0.00789,720.698 -shifter,128,5000,0.401118,19106.080347,6.94,1.23 -shifter,16,10,1.237745,681.100013,0.000441,52.029 -shifter,16,5000,0.209586,2120.720031,1.025,2.15 -shifter,32,10,1.906335,1656.200032,0.00115,118.773 -shifter,32,4000,0.260606,3490.760054,1.282,2.57 -shifter,32,4000,0.260606,3490.760054,1.282,2.57 -shifter,32,4000,0.260606,3490.760054,1.282,2.57 -shifter,32,5000,0.238962,4985.260077,2.489,4.9 -shifter,32,6000,0.241742,4312.000069,2.411,3.71 -shifter,32,6000,0.241742,4312.000069,2.411,3.71 -shifter,32,6000,0.241742,4312.000069,2.411,3.71 -shifter,64,10,2.919486,4346.300085,0.00297,210.734 -shifter,64,5000,0.358993,9471.700156,4.518,6.94 -shifter,8,10,0.622998,244.020005,0.00019,26.943 -shifter,8,5000,0.198885,495.88001,0.285,300.128 +Module,Width,Target Freq,Delay,Area,L Power (nW),D energy (mJ) +add,128,10,7.100851,1867.879976,465.925,0.0005009999999999999 +add,128,1538,0.633294,4623.64009,632.254,0.00027958387516254874 +add,128,2051,0.486762,4951.940095,885.884,0.0003568990736226231 +add,128,2359,0.423881,5520.340104,1.49,0.00045146248410343363 +add,128,2410,0.414767,5600.700103,1.57,0.00045684647302904563 +add,128,2462,0.406101,5721.240105,1.77,0.0004780666125101544 +add,128,2513,0.397913,6085.800112,2.14,0.0005161161957819339 +add,128,2564,0.436395,6456.240111,2.27,0.0005503120124804992 +add,128,2615,0.390136,6662.040117,2.45,0.0006137667304015296 +add,128,2667,0.394304,7494.060127,3.58,0.00072928383952006 +add,128,2718,0.407908,7287.280117,3.35,0.0006938925680647534 +add,128,2769,0.431383,6941.340124,2.86,0.0006218851570964247 +add,128,3077,0.387515,7712.60013,2.93,0.0007572310692232694 +add,128,3590,0.386891,6860.000114,2.62,0.0006579387186629527 +add,128,5000,0.389771,7007.980119,2.77,0.0006618 +add,16,10,2.032906,221.479998,55.29,5.75e-05 +add,16,2609,0.375085,405.720008,52.28,2.9359908010732082e-05 +add,16,3478,0.287131,443.940009,126.253,4.1978148361127085e-05 +add,16,4000,0.249839,551.74001,302.479,5.9749999999999995e-05 +add,16,4087,0.243761,503.720009,183.936,5.113775385368241e-05 +add,16,4174,0.239287,549.780011,304.811,6.013416387158601e-05 +add,16,4261,0.234402,607.60001,368.742,6.688570758038019e-05 +add,16,4348,0.22992,610.540011,364.173,6.577736890524379e-05 +add,16,4435,0.22545,666.400011,419.709,7.891770011273957e-05 +add,16,4522,0.222724,820.260016,626.379,9.022556390977442e-05 +add,16,4609,0.221986,815.360013,735.998,8.960729008461705e-05 +add,16,4696,0.227412,866.320016,645.684,9.731686541737649e-05 +add,16,5000,0.228259,924.140017,641.631,0.0001038 +add,16,5217,0.22222,824.180016,601.276,8.778991757715163e-05 +add,16,6000,0.225754,1120.140018,1.01,0.00012316666666666666 +add,16,6087,0.226225,857.500013,678.287,0.00010284212255626745 +add,32,10,4.160501,456.679995,112.161,0.00011800000000000001 +add,32,2400,0.41509,958.440019,151.083,6.875e-05 +add,32,3200,0.312424,1121.120021,296.836,0.000105625 +add,32,3680,0.271527,1465.100024,591.825,0.00015000000000000001 +add,32,3760,0.278449,1689.520028,834.387,0.00017898936170212767 +add,32,3840,0.291206,1547.420027,784.112,0.00015859375 +add,32,3920,0.273454,2044.280039,1.33,0.00022066326530612246 +add,32,4000,0.280842,1730.680031,849.828,0.00018375 +add,32,4080,0.256294,1991.360031,1.24,0.00021397058823529412 +add,32,4160,0.253175,2031.540036,1.24,0.00021995192307692308 +add,32,4240,0.268332,1829.660028,1.09,0.00019245283018867924 +add,32,4320,0.254861,1716.960028,866.723,0.0001814814814814815 +add,32,4800,0.258491,1955.100033,1.07,0.00022458333333333334 +add,32,5000,0.2505,1933.540033,1.03,0.00020979999999999998 +add,32,5600,0.254525,1871.800028,877.446,0.0001967857142857143 +add,32,6000,0.271774,1746.36003,955.901,0.00018966666666666665 +add,64,10,8.474034,927.079988,230.083,0.000246 +add,64,1818,0.538894,2114.840041,250.049,0.0001375137513751375 +add,64,2424,0.412474,2298.100044,453.413,0.00017574257425742574 +add,64,2788,0.358537,2637.180048,758.693,0.00023565279770444765 +add,64,2848,0.351091,2625.420049,698.362,0.00023525280898876406 +add,64,2909,0.343753,2800.840049,852.781,0.0002536954279821244 +add,64,2970,0.337807,3412.360059,1.37,0.00032895622895622896 +add,64,3030,0.331556,3202.640054,1.28,0.0003099009900990099 +add,64,3091,0.349251,3284.960053,1.35,0.00031802005823358134 +add,64,3152,0.328164,3804.360061,1.89,0.00038229695431472085 +add,64,3212,0.336436,3593.660062,1.72,0.00035523038605230384 +add,64,3273,0.311119,3816.120062,1.96,0.0003923006416131989 +add,64,3636,0.330032,3266.340054,1.22,0.00033938393839383937 +add,64,4000,0.323267,3758.300065,1.75,0.00038074999999999996 +add,64,4242,0.328234,3507.420063,1.57,0.00033757661480433756 +add,64,5000,0.334061,3798.480071,2.18,0.0003834 +add,64,6000,0.328457,3749.480066,1.77,0.000391 +add,8,10,0.940062,103.879999,24.765,2.41e-05 +add,8,5000,0.199689,197.960003,83.576,2.26e-05 +comparator,128,10,0.842074,1997.240039,243.506,8.7e-05 +comparator,128,5000,0.260142,5215.56005,6.0,0.0007416 +comparator,16,10000,0.146177,1065.260009,1.61,0.00012470000000000002 +comparator,16,10,0.576329,252.840005,31.402,1.4400000000000001e-05 +comparator,16,5000,0.199026,313.600006,78.893,1.718e-05 +comparator,16,6000,0.166568,422.380007,301.506,4.25e-05 +comparator,32,10000,0.194087,1451.380013,1.85,0.00024430000000000003 +comparator,32,10,0.765874,495.88001,66.41,2.26e-05 +comparator,32,4000,0.24995,608.580012,130.613,4.2000000000000004e-05 +comparator,32,5000,0.205372,919.240014,840.47,8.6e-05 +comparator,32,6000,0.2012,1248.520016,1.48,0.00015466666666666667 +comparator,64,10,0.561562,1008.42002,127.626,4.49e-05 +comparator,64,4000,0.249905,1437.660027,558.66,0.0001155 +comparator,64,5000,0.219296,2738.120023,2.95,0.0003978 +comparator,64,6000,0.221138,2341.220025,2.59,0.00022383333333333332 +comparator,8,10000,0.1136,496.86,810.074,6.46e-05 +comparator,8,10909,0.11361,387.1,565.114,5.885049042075351e-05 +comparator,8,10,0.29577,118.580002,16.053,6.830000000000001e-06 +comparator,8,12727,0.113615,488.039998,768.445,6.364422094759174e-05 +comparator,8,5000,0.195502,129.360003,21.443,7.16e-06 +comparator,8,5455,0.182936,130.340003,22.567,7.259395050412466e-06 +comparator,8,7273,0.13643,147.980003,61.898,1.4711948301938677e-05 +comparator,8,8364,0.119528,210.700003,172.337,2.654232424677188e-05 +comparator,8,8545,0.116724,205.800003,165.947,2.7969572849619658e-05 +comparator,8,8727,0.124671,264.600002,278.768,3.55219433940644e-05 +comparator,8,8909,0.11208,261.660004,251.629,3.5694241777977326e-05 +comparator,8,9091,0.10991,297.920001,343.785,3.882961170388296e-05 +comparator,8,9273,0.107742,309.680003,356.05,4.162622667960746e-05 +comparator,8,9455,0.106411,345.94,438.668,4.569011105235325e-05 +comparator,8,9636,0.111488,397.88,589.556,5.645496056454961e-05 +comparator,8,9818,0.11361,381.219999,573.131,5.265838256264005e-05 +mult,128,10,9.334627,180734.540854,1.8,0.0428 +mult,128,337,2.963253,201889.800086,2.67,0.045112759643916915 +mult,128,449,2.227145,212055.340673,3.27,0.04989086859688196 +mult,128,5000,1.78322,314617.244472,1.63,0.199468 +mult,128,517,1.934229,243417.302347,5.67,0.08774468085106382 +mult,128,528,1.893939,255011.682875,6.65,0.10337878787878789 +mult,128,539,1.855281,259737.242949,7.18,0.10912615955473098 +mult,128,551,1.814879,274624.423573,8.73,0.12750816696914702 +mult,128,562,1.779353,284850.723775,1.03,0.1501779359430605 +mult,128,573,1.745187,296812.604204,1.08,0.14241186736474695 +mult,128,584,1.712328,298800.044147,1.15,0.14923630136986302 +mult,128,596,1.71139,312992.404301,1.44,0.16681040268456376 +mult,128,607,1.707473,305974.624156,1.38,0.1625996705107084 +mult,128,674,1.727276,311582.184447,1.52,0.18965133531157272 +mult,128,787,1.735561,317542.544465,1.66,0.19689453621346886 +mult,16,10,4.730546,3869.040009,641.517,0.00107 +mult,16,1122,0.891172,6478.780105,3.54,0.002767379679144385 +mult,16,1146,0.87258,7193.200125,4.57,0.003224258289703316 +mult,16,1171,0.853963,7258.860127,4.57,0.0031195559350982068 +mult,16,1195,0.836814,7685.16012,5.33,0.0032225941422594144 +mult,16,1220,0.81966,8829.800131,6.95,0.0035008196721311477 +mult,16,1244,0.822616,8780.800145,7.15,0.0033842443729903537 +mult,16,1268,0.802449,9789.220166,8.8,0.0038998422712933755 +mult,16,1293,0.813903,9702.000166,8.74,0.0036071152358855374 +mult,16,1317,0.805748,10366.440177,1.01,0.003979498861047836 +mult,16,1463,0.83466,8521.100128,6.71,0.0035974025974025974 +mult,16,1707,0.829615,8563.24013,6.78,0.003674282366725249 +mult,16,4000,0.821111,9132.620147,8.03,0.00360175 +mult,16,5000,0.820059,9583.420143,8.5,0.004035 +mult,16,6000,0.831308,8594.600132,7.15,0.0035176666666666668 +mult,16,732,1.36399,4043.480026,624.48,0.0006612021857923497 +mult,16,976,1.024406,4960.760064,1.32,0.0011854508196721312 +mult,32,1000,1.099618,29507.800463,2.24,0.015257 +mult,32,10,7.575772,12412.680067,1.18,0.00229 +mult,32,1111,1.092041,31649.100517,2.53,0.01587128712871287 +mult,32,1296,1.097292,30544.640517,2.37,0.015766203703703702 +mult,32,4000,1.091389,31262.980534,2.49,0.01636775 +mult,32,5000,1.092153,31497.200524,2.58,0.0159108 +mult,32,556,1.796075,14371.700056,2.21,0.002714028776978417 +mult,32,6000,1.084816,33519.920555,2.91,0.017299666666666668 +mult,32,741,1.349466,17389.120212,4.65,0.005995951417004048 +mult,32,852,1.173643,23514.120391,1.27,0.012269953051643193 +mult,32,870,1.149401,25198.740416,1.5,0.013455172413793104 +mult,32,889,1.124838,26822.600434,1.8,0.01463217097862767 +mult,32,907,1.102529,29124.620481,2.08,0.014771775082690187 +mult,32,926,1.101021,31000.340484,2.46,0.014745140388768898 +mult,32,944,1.085045,32407.620517,2.68,0.01608262711864407 +mult,32,963,1.089271,32490.92054,2.7,0.016202492211838004 +mult,32,981,1.091413,33127.920535,2.84,0.017559633027522933 +mult,64,1000,1.350119,103523.281624,7.3,0.05962 +mult,64,10,4.7933,46798.920227,5.46,0.0103 +mult,64,4000,1.411752,93087.261425,6.05,0.056969 +mult,64,429,2.326205,53642.260108,7.4,0.011111888111888112 +mult,64,5000,1.404875,94040.801492,6.16,0.05973339999999999 +mult,64,571,1.751186,58587.340388,1.1,0.01569352014010508 +mult,64,6000,1.415466,89931.661403,5.63,0.056217 +mult,64,657,1.52205,69763.260863,2.39,0.03356773211567732 +mult,64,671,1.490298,74604.461058,2.89,0.039280178837555885 +mult,64,686,1.457722,78293.181181,3.18,0.04122594752186589 +mult,64,700,1.428547,82949.161302,3.92,0.04733428571428572 +mult,64,714,1.400528,87215.101373,4.39,0.04964425770308123 +mult,64,729,1.371734,93726.221523,5.35,0.05337037037037037 +mult,64,743,1.345895,95943.961579,5.62,0.05491924629878869 +mult,64,757,1.341232,106627.921626,7.73,0.058137384412153235 +mult,64,771,1.341474,98844.761554,6.33,0.05606225680933852 +mult,64,857,1.336163,107976.401664,7.95,0.059478413068844806 +mult,8,1091,0.915221,1167.180013,211.892,0.00017048579285059578 +mult,8,10,2.076433,1009.399998,211.637,0.00020600000000000002 +mult,8,1455,0.687251,1615.04003,680.207,0.0004233676975945017 +mult,8,1673,0.611485,2094.260033,1.39,0.000639569635385535 +mult,8,1709,0.599356,2453.920037,2.01,0.0008338209479227619 +mult,8,1745,0.589521,2771.440043,2.58,0.0008406876790830946 +mult,8,1782,0.582418,2549.960043,2.14,0.0008759820426487093 +mult,8,1818,0.581954,2672.460046,2.2,0.0008663366336633663 +mult,8,1855,0.605444,2332.40004,1.74,0.0007547169811320754 +mult,8,1891,0.605341,2405.90004,1.93,0.0007599153886832364 +mult,8,1927,0.574177,3273.200051,3.43,0.0009600415153087702 +mult,8,1964,0.585681,2746.940044,2.48,0.0008778004073319755 +mult,8,2182,0.550085,4360.02008,5.2,0.0011608615948670944 +mult,8,2545,0.564127,4034.66007,4.58,0.0011772102161100196 +mult,8,5000,0.552339,4261.040075,5.05,0.0011086 +mux2,1,10,0.060639,6.86,1.19,5.149999999999999e-07 +mux2,1,10,0.060639,6.86,1.19,5.149999999999999e-07 +shifter,128,10,2.758726,9722.580189,720.698,0.000789 +shifter,128,5000,0.401118,19106.080347,1.23,0.0013880000000000001 +shifter,16,10,1.237745,681.100013,52.029,4.41e-05 +shifter,16,5000,0.209586,2120.720031,2.15,0.000205 +shifter,32,10,1.906335,1656.200032,118.773,0.000115 +shifter,32,4000,0.260606,3490.760054,2.57,0.0003205 +shifter,32,4000,0.260606,3490.760054,2.57,0.0003205 +shifter,32,4000,0.260606,3490.760054,2.57,0.0003205 +shifter,32,5000,0.238962,4985.260077,4.9,0.0004978 +shifter,32,6000,0.241742,4312.000069,3.71,0.00040183333333333336 +shifter,32,6000,0.241742,4312.000069,3.71,0.00040183333333333336 +shifter,32,6000,0.241742,4312.000069,3.71,0.00040183333333333336 +shifter,64,10,2.919486,4346.300085,210.734,0.000297 +shifter,64,5000,0.358993,9471.700156,6.94,0.0009036 +shifter,8,10,0.622998,244.020005,26.943,1.9e-05 +shifter,8,5000,0.198885,495.88001,300.128,5.6999999999999996e-05 diff --git a/synthDC/ppaFitting.csv b/synthDC/ppaFitting.csv index 882977245..6b88ead61 100644 --- a/synthDC/ppaFitting.csv +++ b/synthDC/ppaFitting.csv @@ -1,13 +1,13 @@ -Module,Metric,Freq,1,N,log(N),Nlog(N),R^2 -add,delay,5000,0.23935453005464438,0.015973094945355207,-0.058207695467226296,-0.002593789781151714,0.9902532112478974 -add,area,5000,-1032.1274349672115,64.4386855922132,374.6678949053879,-3.2579193244904823,0.9999180068922152 -add,area,10,-13.720004131149423,14.699999256147343,3.6067390521177815e-06,9.312480709428003e-08,1.0 -mult,delay,5000,-0.21755360109289562,-0.00033127390710363004,0.36865114245083547,0.0004100845872014472,0.9999815499619515 -mult,area,5000,-29928.193338752997,-11370.538120558254,39122.3984379376,2592.313970431163,0.9998454828501703 -mult,area,10,-24112.991162714883,-8735.874000034026,30452.017533199683,1892.3032427172166,0.9999575675635335 -comparator,delay,5000,0.18302939890710385,-0.001793523907103751,0.00950014684425352,0.0004195522734073458,0.9999387049502957 -comparator,area,5000,1831.2076391201958,303.59984869227907,-1617.4342555852443,-44.475154143873425,0.9990603962758624 -comparator,area,10,-0.23027509289593326,18.299023530396347,-8.48304611908023,-0.4881808064440773,0.9999674500675539 -shifter,delay,5000,0.4107033934426204,0.03923479405737683,-0.19848886911558317,-0.006549393512462493,0.989283342171845 -shifter,area,5000,-3612.7138133224103,-65.6549821150965,1929.186263038338,35.02443853718661,0.9998392000511572 -shifter,area,10,806.0687632950834,120.52125970491868,-682.1783666753405,-5.1440062238735225,0.9998176364985187 +Module,Metric,Freq,1,N,N^2,log2(N),Nlog2(N),R^2 +add,delay,5000,-0.038978555556527635,-0.08911531250030817,-0.00012953428819478948,0.2083593333340971,0.013950093750045424,1.0 +add,area,5000,-1913.1778463362505,-268.21377075092175,-0.4100347526051751,1046.9667200022955,47.59125331263557,1.0 +add,area,10,-13.720001333167332,14.700000312552621,1.3021426840869221e-09,-1.3062278840780171e-10,-9.375775472819561e-08,1.0 +mult,delay,5000,-0.2915958888891911,-0.02828693750009581,-3.445876736121953e-05,0.32169033333357117,0.0044735312500140964,1.0 +mult,area,5000,27780.605184113756,10418.196477973508,26.857274703166343,-24448.387256089416,-1468.2850310678027,1.0 +mult,area,10,-6472.791005245042,-2075.5787013197305,8.20962684330778,5345.246556351299,313.5693677823146,1.0 +comparator,delay,5000,0.1903951111111219,0.000987500000002994,3.427951388890516e-06,3.333333324460974e-06,-0.00012593750000039925,1.0 +comparator,area,5000,-508.51109056188875,-579.7924890645068,-1.0888888741341944,969.5466443383111,101.5524983752957,1.0 +comparator,area,10,-155.6022268893253,-40.3637507501383,-0.07230902908001494,132.9533363336765,8.452500156270371,1.0 +shifter,delay,5000,0.06953233333235516,-0.08957893750031035,-0.00015877864583368578,0.16727300000076853,0.014763625000045773,1.0 +shifter,area,5000,-237.48663487568587,1208.7075255666841,1.5708073263938906,-1678.7400476770383,-166.69187856311666,1.0 +shifter,area,10,-1079.4155736731122,-591.3687615645423,-0.877491337241916,1211.9333560050677,103.11437703155087,1.0 diff --git a/synthDC/ppaSynth.py b/synthDC/ppaSynth.py index cf7e430b5..691b796c8 100755 --- a/synthDC/ppaSynth.py +++ b/synthDC/ppaSynth.py @@ -14,9 +14,13 @@ def deleteRedundant(LoT): bashCommand = synthStr.format(*synth) outputCPL = subprocess.check_output(['bash','-c', bashCommand]) -widths = ['1'] -modules = ['mux2'] -freqs = ['10'] +d = 0.26 +f = 1/d * 1000 +arr = [-40, -20, -8, -6, -4, -2, 0, 2, 4, 6, 8, 20, 40] + +widths = ['128'] +modules = ['comparator'] +freqs = [str(round(f+f*x/100)) for x in arr] tech = 'sky90'