Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import shutil
- import sys
- import subprocess
- import signal
- from multiprocessing import Pool
- def start_vivado(blockID, start, stop):
- print("Running instance :" + str(blockID))
- subprocess.check_call(
- "${XRAY_VIVADO} -mode batch -source $FUZDIR/job.tcl -tclargs " +
- str(blockID) + " " + str(start) + " " + str(stop),
- shell=True)
- def get_nb_pips():
- print("Fetching nb pips")
- subprocess.check_call(
- "${XRAY_VIVADO} -mode batch -source $FUZDIR/get_pipscount.tcl",
- shell=True)
- countfile = open("nb_pips.txt", "r")
- return int(countfile.readline())
- def main(argv):
- nbBlocks = 64
- nbParBlock = 4
- pipscount = get_nb_pips()
- blocksize = pipscount / nbBlocks
- if not os.path.exists("wires"):
- os.mkdir("wires")
- print(
- "Pips Count: " + str(pipscount) + " - Number of blocks: " +
- str(nbBlocks) + " - Parallel blocks: " + str(nbParBlock))
- blockId = range(0, nbBlocks)
- startI = range(0, pipscount, blocksize)
- stopI = range(blocksize, pipscount + 1, blocksize)
- with Pool(processes=nbParBlock) as pool:
- pool.map(start_vivado, blockId, startI, stopI)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement