AMF-Placer  2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
DSE.py
Go to the documentation of this file.
1 import os
2 import numpy as np
3 
4 for startPackingD in [0.25, 0.5, 1]:
5  for deltaPackingD in [0.25, 0.33, 0.5]:
6  for hpwlPackingWeight in [0.1, 0.05, 0.2]:
7  overallTcl = open(
8  "/home/zslwyuan-laptop/Documents/AMF-Placer/overall.tcl", "w")
9  outputPath = "/home/zslwyuan-laptop/Documents/AMF-Placer-DCP/dse/"
10  outputName = "OpenPiton_"+str(startPackingD).replace(".", "p")+"_"+str(
11  deltaPackingD).replace(".", "p")+"_"+str(hpwlPackingWeight).replace(".", "p")
12 
13  templateFile = open(
14  "../benchmarks/testConfig/OpenPiton_template.json")
15  outputFile = open("../benchmarks/testConfig/OpenPiton.json", "w")
16  for line in templateFile.readlines():
17  print(line.replace("arg1", str(startPackingD)).replace(
18  "arg2", str(deltaPackingD)).replace("arg3", str(hpwlPackingWeight)), end="", file=outputFile)
19  outputFile.close()
20  templateFile.close()
21 
22  errorCode = os.system(
23  "./AMFPlacer ../benchmarks/testConfig/OpenPiton.json > "+outputPath+outputName+".placerLog")
24 
25  if (errorCode == 0):
26  print(
27  "open_checkpoint /home/zslwyuan-laptop/Documents/AMF-Placer-Vivado/midOpenPiton/OpenPiton.dcp", file=overallTcl)
28  print("source /home/zslwyuan-laptop/Documents/AMF-Placer/build/dumpData_OpenPiton/DumpCLBPacking-first-0.tcl", file=overallTcl)
29  print("write_checkpoint /home/zslwyuan-laptop/Documents/AMF-Placer-DCP/dse/" +
30  outputName+".dcp -force", file=overallTcl)
31  overallTcl.close()
32  os.system("vivado -mode batch -source /home/zslwyuan-laptop/Documents/AMF-Placer/overall.tcl -journal " +
33  outputPath+outputName+".jou"
34  + " -log " + outputPath+outputName+".log")