cvw/synthDC/ppaSynth.py
2022-05-18 17:01:55 +00:00

36 lines
937 B
Python
Executable File

#!/usr/bin/python3
import subprocess
from multiprocessing import Pool
def runCommand(module, width, tech, freq):
command = "make synth DESIGN=ppa_{}_{} TECH={} DRIVE=INV FREQ={} MAXOPT=1".format(module, width, tech, freq)
subprocess.Popen(command, shell=True)
def deleteRedundant(LoT):
'''removes any previous runs for the current synthesis specifications'''
synthStr = "rm -rf runs/ppa_{}_{}_rv32e_{}nm_{}_*"
for synth in LoT:
bashCommand = synthStr.format(*synth)
outputCPL = subprocess.check_output(['bash','-c', bashCommand])
widths = ['1']
modules = ['mux2']
freqs = ['10']
tech = 'sky90'
LoT = []
for module in modules:
for width in widths:
for freq in freqs:
LoT += [[module, width, tech, freq]]
deleteRedundant(LoT)
pool = Pool()
pool.starmap(runCommand, LoT)
pool.close()
bashCommand = "wait"
outputCPL = subprocess.check_output(['bash','-c', bashCommand])