@@ -257,26 +257,23 @@ def openroad(
257257 base_dir ,
258258 parameters ,
259259 flow_variant ,
260- path = "" ,
261260 install_path = None ,
262261):
263262 """
264263 Run OpenROAD-flow-scripts with a given set of parameters.
265264 """
266265 # Make sure path ends in a slash, i.e., is a folder
267266 flow_variant = f"{ args .experiment } /{ flow_variant } "
268- if path != "" :
269- log_path = f"{ path } /{ flow_variant } /"
270- report_path = log_path .replace ("logs" , "reports" )
271- run_command (args , f"mkdir -p { log_path } " )
272- run_command (args , f"mkdir -p { report_path } " )
273- else :
274- log_path = os .path .abspath (
275- os .path .join (base_dir , f"flow/logs/{ args .platform } /{ args .design } " )
276- )
277- report_path = os .path .abspath (
278- os .path .join (base_dir , f"flow/reports/{ args .platform } /{ args .design } " )
267+ log_path = os .path .abspath (
268+ os .path .join (base_dir , f"flow/logs/{ args .platform } /{ args .design } " , flow_variant )
269+ )
270+ report_path = os .path .abspath (
271+ os .path .join (
272+ base_dir , f"flow/reports/{ args .platform } /{ args .design } " , flow_variant
279273 )
274+ )
275+ os .makedirs (log_path , exist_ok = True )
276+ os .makedirs (report_path , exist_ok = True )
280277
281278 if install_path is None :
282279 install_path = os .path .join (base_dir , "tools/install" )
@@ -296,11 +293,11 @@ def openroad(
296293 args ,
297294 make_command ,
298295 timeout = args .timeout ,
299- stderr_file = f" { log_path } error-make-finish.log" ,
300- stdout_file = f" { log_path } make-finish-stdout.log" ,
296+ stderr_file = os . path . join ( log_path , " error-make-finish.log") ,
297+ stdout_file = os . path . join ( log_path , " make-finish-stdout.log") ,
301298 )
302299
303- metrics_file = os .path .abspath (os .path .join (report_path , "metrics.json" ))
300+ metrics_file = os .path .abspath (os .path .join (log_path , "metrics.json" ))
304301 metrics_command = export_command
305302 metrics_command += f"{ base_dir } /flow/util/genMetrics.py -x"
306303 metrics_command += f" -v { flow_variant } "
@@ -310,8 +307,8 @@ def openroad(
310307 run_command (
311308 args ,
312309 metrics_command ,
313- stderr_file = f" { log_path } error-metrics.log" ,
314- stdout_file = f" { log_path } metrics-stdout.log" ,
310+ stderr_file = os . path . join ( log_path , " error-metrics.log") ,
311+ stdout_file = os . path . join ( log_path , " metrics-stdout.log") ,
315312 )
316313
317314 return metrics_file
0 commit comments