From 5a115bc6f2201ff1b752782410efcffa50c734e0 Mon Sep 17 00:00:00 2001 From: "James E. Stine" Date: Thu, 9 Nov 2023 00:52:40 -0600 Subject: [PATCH] update ppaSynth.py with runCommand --- synthDC/ppa/ppaSynth.py | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/synthDC/ppa/ppaSynth.py b/synthDC/ppa/ppaSynth.py index 6b45e2c4c..d9d07c10d 100755 --- a/synthDC/ppa/ppaSynth.py +++ b/synthDC/ppa/ppaSynth.py @@ -1,16 +1,19 @@ #!/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 # James Stine james.stine@okstate.edu 15 October 2023 # + import subprocess import re from multiprocessing import Pool from ppaAnalyze import synthsfromcsv 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) def deleteRedundant(synthsToRun): @@ -23,7 +26,7 @@ def deleteRedundant(synthsToRun): def freqSweep(module, width, tech): synthsToRun = [] arr = [-8, -6, -4, -2, 0, 2, 4, 6, 8] - allSynths = synthsfromcsv('bestSynths.csv') + allSynths = synthsfromcsv('ppa/bestSynths.csv') for synth in allSynths: if (synth.module == module) & (synth.tech == tech) & (synth.width == width): f = 1000/synth.delay @@ -57,20 +60,20 @@ def allCombos(widths, modules, techs, freqs): if __name__ == '__main__': ##### Run specific syntheses - widths = [8, 16, 32, 64, 128] - modules = ['mult', 'add', 'shiftleft', 'flop', 'comparator', 'priorityencoder', 'add', 'csa', 'mux2', 'mux4', 'mux8'] - techs = ['sky90', 'sky130', 'tsmc28', 'tsmc28psyn'] - freqs = [5000] - synthsToRun = allCombos(widths, modules, techs, freqs) + widths = [8, 16, 32, 64, 128] + modules = ['mult', 'add', 'shiftleft', 'flop', 'comparator', 'priorityencoder', 'add', 'csa', 'mux2', 'mux4', 'mux8'] + techs = ['sky90', 'tsmc28'] + freqs = [5000] + synthsToRun = allCombos(widths, modules, techs, freqs) ##### Run a sweep based on best delay found in existing syntheses - module = 'add' - width = 32 - tech = 'sky90' - synthsToRun = freqSweep(module, width, tech) + module = 'add' + width = 32 + tech = 'sky90' + synthsToRun = freqSweep(module, width, tech) ##### Only do syntheses for which a run doesn't already exist - synthsToRun = filterRedundant(synthsToRun) - - pool = Pool(processes=25) - pool.starmap(print, synthsToRun) + synthsToRun = filterRedundant(synthsToRun) + + pool = Pool(processes=25) + pool.starmap(runCommand, synthsToRun)