mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-02 17:55:19 +00:00
update ppaSynth.py with runCommand
This commit is contained in:
parent
a6bc69d73f
commit
5a115bc6f2
@ -1,16 +1,19 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
#
|
#
|
||||||
# Python analysis for regression test run by ppaSynth.py
|
# Python regression test for DC
|
||||||
# Madeleine Masser-Frye mmasserfrye@hmc.edu 5/22
|
# Madeleine Masser-Frye mmasserfrye@hmc.edu 5/22
|
||||||
# James Stine james.stine@okstate.edu 15 October 2023
|
# James Stine james.stine@okstate.edu 15 October 2023
|
||||||
#
|
#
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import re
|
import re
|
||||||
from multiprocessing import Pool
|
from multiprocessing import Pool
|
||||||
from ppaAnalyze import synthsfromcsv
|
from ppaAnalyze import synthsfromcsv
|
||||||
|
|
||||||
def runCommand(module, width, tech, freq):
|
def runCommand(module, width, tech, freq):
|
||||||
command = "make synth DESIGN=ppa_{}_{} TECH={} DRIVE=INV FREQ={} MAXOPT=1 MAXCORES=1".format(module, width, tech, freq)
|
command = "make synth DESIGN={} WIDTH={} TECH={} DRIVE=INV FREQ={} MAXOPT=1 MAXCORES=1".format(module, width, tech, freq)
|
||||||
|
print('here we go')
|
||||||
|
|
||||||
subprocess.Popen(command, shell=True)
|
subprocess.Popen(command, shell=True)
|
||||||
|
|
||||||
def deleteRedundant(synthsToRun):
|
def deleteRedundant(synthsToRun):
|
||||||
@ -23,7 +26,7 @@ def deleteRedundant(synthsToRun):
|
|||||||
def freqSweep(module, width, tech):
|
def freqSweep(module, width, tech):
|
||||||
synthsToRun = []
|
synthsToRun = []
|
||||||
arr = [-8, -6, -4, -2, 0, 2, 4, 6, 8]
|
arr = [-8, -6, -4, -2, 0, 2, 4, 6, 8]
|
||||||
allSynths = synthsfromcsv('bestSynths.csv')
|
allSynths = synthsfromcsv('ppa/bestSynths.csv')
|
||||||
for synth in allSynths:
|
for synth in allSynths:
|
||||||
if (synth.module == module) & (synth.tech == tech) & (synth.width == width):
|
if (synth.module == module) & (synth.tech == tech) & (synth.width == width):
|
||||||
f = 1000/synth.delay
|
f = 1000/synth.delay
|
||||||
@ -57,20 +60,20 @@ def allCombos(widths, modules, techs, freqs):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
##### Run specific syntheses
|
##### Run specific syntheses
|
||||||
widths = [8, 16, 32, 64, 128]
|
widths = [8, 16, 32, 64, 128]
|
||||||
modules = ['mult', 'add', 'shiftleft', 'flop', 'comparator', 'priorityencoder', 'add', 'csa', 'mux2', 'mux4', 'mux8']
|
modules = ['mult', 'add', 'shiftleft', 'flop', 'comparator', 'priorityencoder', 'add', 'csa', 'mux2', 'mux4', 'mux8']
|
||||||
techs = ['sky90', 'sky130', 'tsmc28', 'tsmc28psyn']
|
techs = ['sky90', 'tsmc28']
|
||||||
freqs = [5000]
|
freqs = [5000]
|
||||||
synthsToRun = allCombos(widths, modules, techs, freqs)
|
synthsToRun = allCombos(widths, modules, techs, freqs)
|
||||||
|
|
||||||
##### Run a sweep based on best delay found in existing syntheses
|
##### Run a sweep based on best delay found in existing syntheses
|
||||||
module = 'add'
|
module = 'add'
|
||||||
width = 32
|
width = 32
|
||||||
tech = 'sky90'
|
tech = 'sky90'
|
||||||
synthsToRun = freqSweep(module, width, tech)
|
synthsToRun = freqSweep(module, width, tech)
|
||||||
|
|
||||||
##### Only do syntheses for which a run doesn't already exist
|
##### Only do syntheses for which a run doesn't already exist
|
||||||
synthsToRun = filterRedundant(synthsToRun)
|
synthsToRun = filterRedundant(synthsToRun)
|
||||||
|
|
||||||
pool = Pool(processes=25)
|
pool = Pool(processes=25)
|
||||||
pool.starmap(print, synthsToRun)
|
pool.starmap(runCommand, synthsToRun)
|
||||||
|
Loading…
Reference in New Issue
Block a user