AMF-Placer  2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
removeFailurePartFromTcl.py
Go to the documentation of this file.
1 import argparse
2 
3 
4 parser = argparse.ArgumentParser()
5 
6 parser.add_argument(
7  "-o", "--Output", help="The Output File Path", required=True)
8 parser.add_argument(
9  "-i", "--Input", help="The Input File Path", required=True)
10 parser.add_argument("-e", "--ErrorLocation",
11  help="The error BEL location which triggers the error in Vivado", required=True)
12 
13 
14 args = parser.parse_args()
15 
16 inputFile = open(args.Input, 'r')
17 outputFile = open(args.Output, 'w')
18 targetBELStr = args.ErrorLocation
19 
20 lines = inputFile.readlines()
21 
22 targetLineId = 0
23 for i, line in enumerate(lines):
24  if (line.find(targetBELStr) >= 0):
25  targetLineId = i
26 
27 startPrintOut = False
28 for line in lines[targetLineId:]:
29  if (line.find("set result ") >= 0):
30  startPrintOut = True
31  if (startPrintOut):
32  print(line, file=outputFile, end='')
33 
34 inputFile.close()
35 outputFile.close()