@@ -292,26 +292,23 @@ def openroad(
292292 base_dir ,
293293 parameters ,
294294 flow_variant ,
295- path = "" ,
296295 install_path = None ,
297296):
298297 """
299298 Run OpenROAD-flow-scripts with a given set of parameters.
300299 """
301300 # Make sure path ends in a slash, i.e., is a folder
302301 flow_variant = f"{ args .experiment } /{ flow_variant } "
303- if path != "" :
304- log_path = f"{ path } /{ flow_variant } /"
305- report_path = log_path .replace ("logs" , "reports" )
306- run_command (args , f"mkdir -p { log_path } " )
307- run_command (args , f"mkdir -p { report_path } " )
308- else :
309- log_path = os .path .abspath (
310- os .path .join (base_dir , f"flow/logs/{ args .platform } /{ args .design } " )
311- )
312- report_path = os .path .abspath (
313- os .path .join (base_dir , f"flow/reports/{ args .platform } /{ args .design } " )
302+ log_path = os .path .abspath (
303+ os .path .join (base_dir , f"flow/logs/{ args .platform } /{ args .design } " , flow_variant )
304+ )
305+ report_path = os .path .abspath (
306+ os .path .join (
307+ base_dir , f"flow/reports/{ args .platform } /{ args .design } " , flow_variant
314308 )
309+ )
310+ os .makedirs (log_path , exist_ok = True )
311+ os .makedirs (report_path , exist_ok = True )
315312
316313 if install_path is None :
317314 install_path = os .path .join (base_dir , "tools/install" )
@@ -331,11 +328,11 @@ def openroad(
331328 args ,
332329 make_command ,
333330 timeout = args .timeout ,
334- stderr_file = f" { log_path } error-make-finish.log" ,
335- stdout_file = f" { log_path } make-finish-stdout.log" ,
331+ stderr_file = os . path . join ( log_path , " error-make-finish.log") ,
332+ stdout_file = os . path . join ( log_path , " make-finish-stdout.log") ,
336333 )
337334
338- metrics_file = os .path .abspath (os .path .join (report_path , "metrics.json" ))
335+ metrics_file = os .path .abspath (os .path .join (log_path , "metrics.json" ))
339336 metrics_command = export_command
340337 metrics_command += f"{ base_dir } /flow/util/genMetrics.py -x"
341338 metrics_command += f" -v { flow_variant } "
@@ -345,8 +342,8 @@ def openroad(
345342 run_command (
346343 args ,
347344 metrics_command ,
348- stderr_file = f" { log_path } error-metrics.log" ,
349- stdout_file = f" { log_path } metrics-stdout.log" ,
345+ stderr_file = os . path . join ( log_path , " error-metrics.log") ,
346+ stdout_file = os . path . join ( log_path , " metrics-stdout.log") ,
350347 )
351348
352349 return metrics_file
0 commit comments