mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
improved command line synth functionality
This commit is contained in:
parent
b196b6b504
commit
0dc3c9462b
@ -22,7 +22,7 @@ export DRIVE ?= FLOP
|
|||||||
|
|
||||||
time := $(shell date +%F-%H-%M)
|
time := $(shell date +%F-%H-%M)
|
||||||
hash := $(shell git rev-parse --short HEAD)
|
hash := $(shell git rev-parse --short HEAD)
|
||||||
export OUTPUTDIR := newRuns/$(DESIGN)_$(CONFIG)_$(TECH)nm_$(FREQ)_MHz_$(time)_$(TITLE)_$(hash)
|
export OUTPUTDIR := runs/$(DESIGN)_$(CONFIG)_$(TECH)nm_$(FREQ)_MHz_$(time)_$(TITLE)_$(hash)
|
||||||
export SAIFPOWER ?= 0
|
export SAIFPOWER ?= 0
|
||||||
|
|
||||||
CONFIGDIR ?= ${WALLY}/pipelined/config
|
CONFIGDIR ?= ${WALLY}/pipelined/config
|
||||||
|
@ -7,10 +7,10 @@ import subprocess
|
|||||||
from matplotlib.cbook import flatten
|
from matplotlib.cbook import flatten
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import matplotlib.lines as lines
|
import matplotlib.lines as lines
|
||||||
from wallySynth import testFreq
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from ppa.ppaAnalyze import noOutliers
|
from ppa.ppaAnalyze import noOutliers
|
||||||
from matplotlib import ticker
|
from matplotlib import ticker
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
|
||||||
def synthsintocsv():
|
def synthsintocsv():
|
||||||
@ -74,14 +74,13 @@ def synthsfromcsv(filename):
|
|||||||
allSynths[i] = Synth(*allSynths[i])
|
allSynths[i] = Synth(*allSynths[i])
|
||||||
return allSynths
|
return allSynths
|
||||||
|
|
||||||
|
|
||||||
def freqPlot(tech, width, config):
|
def freqPlot(tech, width, config):
|
||||||
''' plots delay, area for syntheses with specified tech, module, width
|
''' plots delay, area for syntheses with specified tech, module, width
|
||||||
'''
|
'''
|
||||||
|
|
||||||
freqsL, delaysL, areasL = ([[], []] for i in range(3))
|
freqsL, delaysL, areasL = ([[], []] for i in range(3))
|
||||||
for oneSynth in allSynths:
|
for oneSynth in allSynths:
|
||||||
if (width == oneSynth.width) & (config == oneSynth.config) & (tech == oneSynth.tech) & (oneSynth.special == ''):
|
if (width == oneSynth.width) & (config == oneSynth.config) & (tech == oneSynth.tech) & ('' == oneSynth.special):
|
||||||
ind = (1000/oneSynth.delay < oneSynth.freq) # when delay is within target clock period
|
ind = (1000/oneSynth.delay < oneSynth.freq) # when delay is within target clock period
|
||||||
freqsL[ind] += [oneSynth.freq]
|
freqsL[ind] += [oneSynth.freq]
|
||||||
delaysL[ind] += [oneSynth.delay]
|
delaysL[ind] += [oneSynth.delay]
|
||||||
@ -124,74 +123,93 @@ def freqPlot(tech, width, config):
|
|||||||
addFO4axis(fig, ax1, tech)
|
addFO4axis(fig, ax1, tech)
|
||||||
|
|
||||||
plt.savefig('./plots/wally/freqSweep_' + tech + '_' + width + config + '.png')
|
plt.savefig('./plots/wally/freqSweep_' + tech + '_' + width + config + '.png')
|
||||||
# plt.show()
|
|
||||||
|
|
||||||
|
|
||||||
|
def areaDelay(tech, delays, areas, labels, fig, ax, norm=False):
|
||||||
|
|
||||||
def areaDelay(tech, fig=None, ax=None, freq=None, width=None, config=None, norm=False):
|
plt.subplots_adjust(left=0.18)
|
||||||
delays, areas, labels = ([] for i in range(3))
|
|
||||||
|
|
||||||
for oneSynth in allSynths:
|
fo4 = techdict[tech].fo4
|
||||||
if (width==None) or (width == oneSynth.width):
|
add32area = techdict[tech].add32area
|
||||||
if (tech == oneSynth.tech) & (freq == oneSynth.freq):
|
marker = techdict[tech].shape
|
||||||
if (config == None) & (oneSynth.special == 'FPUoff'): #fix
|
color = techdict[tech].color
|
||||||
delays += [oneSynth.delay]
|
|
||||||
areas += [oneSynth.area]
|
|
||||||
labels += [oneSynth.width + oneSynth.config]
|
|
||||||
elif (config != None) & (oneSynth.config == config):
|
|
||||||
delays += [oneSynth.delay]
|
|
||||||
areas += [oneSynth.area]
|
|
||||||
labels += [oneSynth.special]
|
|
||||||
if width == None:
|
|
||||||
width = ''
|
|
||||||
if (fig == None) or (ax == None):
|
|
||||||
fig, (ax) = plt.subplots(1, 1)
|
|
||||||
ax.ticklabel_format(useOffset=False, style='plain')
|
|
||||||
plt.subplots_adjust(left=0.18)
|
|
||||||
|
|
||||||
if norm:
|
if norm:
|
||||||
delays = [d/techdict[tech][0] for d in delays]
|
delays = [d/fo4 for d in delays]
|
||||||
areas = [a/techdict[tech][1] for a in areas]
|
areas = [a/add32area for a in areas]
|
||||||
|
|
||||||
plt.scatter(delays, areas)
|
plt.scatter(delays, areas, marker=marker, color=color)
|
||||||
plt.xlabel('Cycle time (ns)')
|
plt.xlabel('Cycle time (ns)')
|
||||||
plt.ylabel('Area (sq microns)')
|
plt.ylabel('Area (sq microns)')
|
||||||
ytop = ax.get_ylim()[1]
|
ytop = ax.get_ylim()[1]
|
||||||
plt.ylim(ymin=0, ymax=1.1*ytop)
|
plt.ylim(ymin=0, ymax=1.1*ytop)
|
||||||
titleStr = tech + ' ' + width
|
|
||||||
saveStr = tech + '_' + width
|
|
||||||
if config:
|
|
||||||
titleStr += config
|
|
||||||
saveStr = saveStr + config + '_versions_'
|
|
||||||
if (config == None):
|
|
||||||
saveStr = saveStr + '_origConfigs_'
|
|
||||||
saveStr += str(freq)
|
|
||||||
titleStr = titleStr
|
|
||||||
plt.title(titleStr)
|
|
||||||
|
|
||||||
ax.yaxis.set_major_formatter(ticker.StrMethodFormatter('{x:,.0f}'))
|
ax.yaxis.set_major_formatter(ticker.StrMethodFormatter('{x:,.0f}'))
|
||||||
|
|
||||||
for i in range(len(labels)):
|
for i in range(len(labels)):
|
||||||
plt.annotate(labels[i], (delays[i], areas[i]), textcoords="offset points", xytext=(0,10), ha='center')
|
plt.annotate(labels[i], (delays[i], areas[i]), textcoords="offset points", xytext=(0,10), ha='center')
|
||||||
|
|
||||||
# addFO4axis(fig, ax1, tech)
|
return fig
|
||||||
|
|
||||||
plt.savefig('./plots/wally/areaDelay_' + saveStr + '.png')
|
def plotFeatures(tech, width, config):
|
||||||
|
delays, areas, labels = ([] for i in range(3))
|
||||||
|
freq = techdict[tech].targfreq
|
||||||
|
for oneSynth in allSynths:
|
||||||
|
if (tech == oneSynth.tech) & (freq == oneSynth.freq):
|
||||||
|
if (oneSynth.config == config) & (width == oneSynth.width):
|
||||||
|
delays += [oneSynth.delay]
|
||||||
|
areas += [oneSynth.area]
|
||||||
|
labels += [oneSynth.special]
|
||||||
|
|
||||||
|
fig, (ax) = plt.subplots(1, 1)
|
||||||
|
|
||||||
|
fig = areaDelay(tech, delays, areas, labels, fig, ax)
|
||||||
|
|
||||||
|
titlestr = tech+'_'+width+config
|
||||||
|
plt.title(titlestr)
|
||||||
|
plt.savefig('./plots/wally/features_'+titlestr+'.png')
|
||||||
|
|
||||||
|
def plotConfigs(tech, special=''):
|
||||||
|
delays, areas, labels = ([] for i in range(3))
|
||||||
|
freq = techdict[tech].targfreq
|
||||||
|
for oneSynth in allSynths:
|
||||||
|
if (tech == oneSynth.tech) & (freq == oneSynth.freq) & (oneSynth.special == special):
|
||||||
|
delays += [oneSynth.delay]
|
||||||
|
areas += [oneSynth.area]
|
||||||
|
labels += [oneSynth.width + oneSynth.config]
|
||||||
|
|
||||||
|
fig, (ax) = plt.subplots(1, 1)
|
||||||
|
|
||||||
|
fig = areaDelay(tech, delays, areas, labels, fig, ax)
|
||||||
|
|
||||||
|
titleStr = tech+'_'+special
|
||||||
|
plt.title(titleStr)
|
||||||
|
plt.savefig('./plots/wally/configs_' + titleStr + '.png')
|
||||||
|
|
||||||
|
|
||||||
|
def normAreaDelay(special=''):
|
||||||
|
fig, (ax) = plt.subplots(1, 1)
|
||||||
|
fullLeg = []
|
||||||
|
for tech in list(techdict.keys()):
|
||||||
|
delays, areas, labels = ([] for i in range(3))
|
||||||
|
spec = techdict[tech]
|
||||||
|
freq = spec.targfreq
|
||||||
|
for oneSynth in allSynths:
|
||||||
|
if (tech == oneSynth.tech) & (freq == oneSynth.freq) & (oneSynth.special == special):
|
||||||
|
delays += [oneSynth.delay]
|
||||||
|
areas += [oneSynth.area]
|
||||||
|
labels += [oneSynth.width + oneSynth.config]
|
||||||
|
areaDelay(tech, delays, areas, labels, fig, ax, norm=True)
|
||||||
|
fullLeg += [lines.Line2D([0], [0], markerfacecolor=spec.color, label=tech, marker=spec.shape, markersize=10, color='w')]
|
||||||
|
|
||||||
def normAreaDelay():
|
|
||||||
fig2, (ax) = plt.subplots(1, 1)
|
|
||||||
areaDelay('sky90', fig=fig2, ax=ax, freq=testFreq[0], norm=True)
|
|
||||||
areaDelay('tsmc28', fig=fig2, ax=ax, freq=testFreq[1], norm=True)
|
|
||||||
ax.set_title('Normalized Area & Cycle Time by Configuration')
|
ax.set_title('Normalized Area & Cycle Time by Configuration')
|
||||||
ax.set_xlabel('Cycle Time (FO4)')
|
ax.set_xlabel('Cycle Time (FO4)')
|
||||||
ax.set_ylabel('Area (add32)')
|
ax.set_ylabel('Area (add32)')
|
||||||
fullLeg = [lines.Line2D([0], [0], color='royalblue', label='tsmc28')]
|
|
||||||
fullLeg += [lines.Line2D([0], [0], color='orange', label='sky90')]
|
|
||||||
ax.legend(handles = fullLeg, loc='upper left')
|
ax.legend(handles = fullLeg, loc='upper left')
|
||||||
plt.savefig('./plots/wally/normAreaDelay.png')
|
plt.savefig('./plots/wally/normAreaDelay.png')
|
||||||
|
|
||||||
def addFO4axis(fig, ax, tech):
|
def addFO4axis(fig, ax, tech):
|
||||||
fo4 = techdict[tech][0]
|
fo4 = techdict[tech].fo4
|
||||||
|
|
||||||
ax3 = fig.add_axes((0.125,0.14,0.775,0.0))
|
ax3 = fig.add_axes((0.125,0.14,0.775,0.0))
|
||||||
ax3.yaxis.set_visible(False) # hide the yaxis
|
ax3.yaxis.set_visible(False) # hide the yaxis
|
||||||
@ -215,15 +233,22 @@ def addFO4axis(fig, ax, tech):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
techdict = {'sky90': [43.2e-3, 1440.600027], 'tsmc28': [12.2e-3, 209.286002]}
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument("-s", "--skyfreq", type=int, default=3000, help = "Target frequency used for sky90 syntheses")
|
||||||
|
parser.add_argument("-t", "--tsmcfreq", type=int, default=10000, help = "Target frequency used for tsmc28 syntheses")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
# synthsintocsv()
|
TechSpec = namedtuple("TechSpec", "color shape targfreq fo4 add32area add32lpower add32denergy")
|
||||||
|
techdict = {}
|
||||||
|
techdict['sky90'] = TechSpec('green', 'o', args.skyfreq, 43.2e-3, 1440.600027, 714.057, 0.658023)
|
||||||
|
techdict['tsmc28'] = TechSpec('blue', 's', args.tsmcfreq, 12.2e-3, 209.286002, 1060.0, .081533)
|
||||||
|
|
||||||
|
synthsintocsv()
|
||||||
synthsfromcsv('Summary.csv')
|
synthsfromcsv('Summary.csv')
|
||||||
freqPlot('tsmc28', 'rv32', 'e')
|
freqPlot('tsmc28', 'rv32', 'e')
|
||||||
freqPlot('sky90', 'rv32', 'e')
|
freqPlot('sky90', 'rv32', 'e')
|
||||||
areaDelay('tsmc28', freq=testFreq[1], width= 'rv64', config='gc')
|
plotFeatures('sky90', 'rv64', 'gc')
|
||||||
areaDelay('sky90', freq=testFreq[0], width='rv64', config='gc')
|
plotFeatures('tsmc28', 'rv64', 'gc')
|
||||||
areaDelay('tsmc28', freq=testFreq[1])
|
plotConfigs('sky90', special='orig')
|
||||||
areaDelay('sky90', freq=testFreq[0])
|
plotConfigs('tsmc28', special='orig')
|
||||||
|
normAreaDelay(special='orig')
|
||||||
# normAreaDelay()
|
|
||||||
|
@ -14,7 +14,7 @@ def mask(command):
|
|||||||
subprocess.Popen(command, shell=True)
|
subprocess.Popen(command, shell=True)
|
||||||
|
|
||||||
def freshStart():
|
def freshStart():
|
||||||
out = subprocess.check_output(['bash','-c', 'make clean'])
|
out = subprocess.check_output(['bash','-c', 'make fresh'])
|
||||||
for x in out.decode("utf-8").split('\n')[:-1]:
|
for x in out.decode("utf-8").split('\n')[:-1]:
|
||||||
print(x)
|
print(x)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user