Skip to content

Commit 5c06c8f

Browse files
authored
Merge pull request #1000 from Pinata-Consulting/makefile-save-disk-space
Makefile: use ln instead of cp to save space
2 parents c20fe95 + 020154f commit 5c06c8f

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

flow/Makefile

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -399,11 +399,11 @@ $(RESULTS_DIR)/1_1_yosys.v: $(DONT_USE_LIBS) $(WRAPPED_LIBS) $(DONT_USE_SC_LIB)
399399

400400
$(RESULTS_DIR)/1_synth.v: $(RESULTS_DIR)/1_1_yosys.v
401401
mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR)
402-
cp $< $@
402+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
403403

404404
$(RESULTS_DIR)/1_synth.sdc: $(SDC_FILE)
405405
mkdir -p $(RESULTS_DIR) $(LOG_DIR) $(REPORTS_DIR)
406-
cp $< $@
406+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
407407

408408
clean_synth:
409409
rm -f $(RESULTS_DIR)/1_*.v $(RESULTS_DIR)/1_synth.sdc
@@ -443,7 +443,7 @@ $(RESULTS_DIR)/2_2_floorplan_io.odb: $(RESULTS_DIR)/2_1_floorplan.odb $(IO_CONST
443443
ifndef IS_CHIP
444444
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/io_placement_random.tcl -metrics $(LOG_DIR)/2_2_floorplan_io.json) 2>&1 | tee $(LOG_DIR)/2_2_floorplan_io.log
445445
else
446-
cp $< $@
446+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
447447
endif
448448

449449
# STEP 3: Timing Driven Mixed Sized Placement
@@ -453,7 +453,7 @@ ifeq ($(MACRO_PLACEMENT),)
453453
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/tdms_place.tcl -metrics $(LOG_DIR)/2_3_tdms.json) 2>&1 | tee $(LOG_DIR)/2_3_tdms_place.log
454454
else
455455
$(info [INFO][FLOW] Using manual macro placement file $(MACRO_PLACEMENT))
456-
cp $< $@
456+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
457457
endif
458458

459459
# STEP 4: Macro Placement
@@ -473,7 +473,7 @@ $(RESULTS_DIR)/2_6_floorplan_pdn.odb: $(RESULTS_DIR)/2_5_floorplan_tapcell.odb $
473473
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/pdn.tcl -metrics $(LOG_DIR)/2_6_pdn.json) 2>&1 | tee $(LOG_DIR)/2_6_pdn.log
474474

475475
$(RESULTS_DIR)/2_floorplan.odb: $(RESULTS_DIR)/2_6_floorplan_pdn.odb
476-
cp $< $@
476+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
477477

478478
$(RESULTS_DIR)/2_floorplan.sdc: $(RESULTS_DIR)/2_1_floorplan.odb
479479

@@ -506,7 +506,7 @@ $(RESULTS_DIR)/3_2_place_iop.odb: $(RESULTS_DIR)/3_1_place_gp_skip_io.odb $(IO_C
506506
ifndef IS_CHIP
507507
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/io_placement.tcl -metrics $(LOG_DIR)/3_2_place_iop.json) 2>&1 | tee $(LOG_DIR)/3_2_place_iop.log
508508
else
509-
cp $< $@
509+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
510510
endif
511511

512512
# STEP 3: Global placement with placed IOs, timing-driven, and routability-driven.
@@ -529,10 +529,10 @@ $(RESULTS_DIR)/3_5_place_dp.odb: $(RESULTS_DIR)/3_4_place_resized.odb
529529
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/detail_place.tcl -metrics $(LOG_DIR)/3_5_opendp.json) 2>&1 | tee $(LOG_DIR)/3_5_opendp.log
530530

531531
$(RESULTS_DIR)/3_place.odb: $(RESULTS_DIR)/3_5_place_dp.odb
532-
cp $< $@
532+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
533533

534534
$(RESULTS_DIR)/3_place.sdc: $(RESULTS_DIR)/2_floorplan.sdc
535-
cp $< $@
535+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
536536

537537
# Clean Targets
538538
#-------------------------------------------------------------------------------
@@ -570,7 +570,7 @@ $(RESULTS_DIR)/4_2_cts_fillcell.odb: $(RESULTS_DIR)/4_1_cts.odb
570570
$(RESULTS_DIR)/4_cts.sdc: $(RESULTS_DIR)/4_cts.odb
571571

572572
$(RESULTS_DIR)/4_cts.odb: $(RESULTS_DIR)/4_2_cts_fillcell.odb
573-
cp $< $@
573+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
574574

575575
.PHONY: clean_cts
576576
clean_cts:
@@ -608,10 +608,10 @@ endif
608608
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/detail_route.tcl -metrics $(LOG_DIR)/5_2_TritonRoute.json) 2>&1 | tee $(LOG_DIR)/5_2_TritonRoute.log
609609

610610
$(RESULTS_DIR)/5_route.odb: $(RESULTS_DIR)/5_2_route.odb
611-
cp $< $@
611+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
612612

613613
$(RESULTS_DIR)/5_route.sdc: $(RESULTS_DIR)/4_cts.sdc
614-
cp $< $@
614+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
615615

616616
$(RESULTS_DIR)/5_route.v:
617617
@export OR_DB=5_route ;\
@@ -670,14 +670,14 @@ $(RESULTS_DIR)/6_1_fill.odb: $(RESULTS_DIR)/5_route.odb $(FILL_CONFIG)
670670
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/density_fill.tcl -metrics $(LOG_DIR)/6_density_fill.json) 2>&1 | tee $(LOG_DIR)/6_density_fill.log
671671
else
672672
$(RESULTS_DIR)/6_1_fill.odb: $(RESULTS_DIR)/5_route.odb
673-
cp $< $@
673+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
674674
endif
675675

676676
$(RESULTS_DIR)/6_1_fill.sdc: $(RESULTS_DIR)/5_route.sdc
677-
cp $< $@
677+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
678678

679679
$(RESULTS_DIR)/6_final.sdc: $(RESULTS_DIR)/5_route.sdc
680-
cp $< $@
680+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
681681

682682
$(LOG_DIR)/6_report.log: $(RESULTS_DIR)/6_1_fill.odb $(RESULTS_DIR)/6_1_fill.sdc
683683
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/final_report.tcl -metrics $(LOG_DIR)/6_report.json) 2>&1 | tee $(LOG_DIR)/6_report.log
@@ -694,17 +694,17 @@ skip_resize: $(RESULTS_DIR)/3_3_place_gp.odb
694694
.PHONY: skip_cts
695695
skip_cts: $(RESULTS_DIR)/3_place.odb $(RESULTS_DIR)/3_place.sdc
696696
# mock all intermediate results
697-
cp $(RESULTS_DIR)/3_place.odb $(RESULTS_DIR)/4_1_cts.odb
698-
cp $(RESULTS_DIR)/3_place.odb $(RESULTS_DIR)/4_2_cts_fillcell.odb
699-
cp $(RESULTS_DIR)/3_place.sdc $(RESULTS_DIR)/4_cts.sdc
700-
cp $(RESULTS_DIR)/3_place.odb $(RESULTS_DIR)/4_cts.odb
697+
cd $(RESULTS_DIR) && ln -sf 3_place.odb 4_1_cts.odb
698+
cd $(RESULTS_DIR) && ln -sf 3_place.odb 4_2_cts_fillcell.odb
699+
cd $(RESULTS_DIR) && ln -sf 3_place.sdc 4_cts.sdc
700+
cd $(RESULTS_DIR) && ln -sf 3_place.odb 4_cts.odb
701701

702702
# Skipping route can be useful to create a mock abstract
703703
.PHONY: skip_route
704704
skip_route: $(RESULTS_DIR)/4_cts.odb $(RESULTS_DIR)/4_cts.sdc
705-
cp $(RESULTS_DIR)/3_place.odb $(RESULTS_DIR)/5_1_grt.odb
706-
cp $(RESULTS_DIR)/3_place.odb $(RESULTS_DIR)/5_2_route.odb
707-
cp $(RESULTS_DIR)/3_place.odb $(RESULTS_DIR)/6_1_fill.odb
705+
cd $(RESULTS_DIR) && ln -sf 3_place.odb 5_1_grt.odb
706+
cd $(RESULTS_DIR) && ln -sf 3_place.odb 5_2_route.odb
707+
cd $(RESULTS_DIR) && ln -sf 3_place.odb 6_1_fill.odb
708708
touch $(RESULTS_DIR)/6_final.spef
709709

710710
# To create a mock abstract quickly, good enough to iterate quickly on
@@ -747,7 +747,7 @@ $(GDS_MERGED_FILE): $(RESULTS_DIR)/6_final.def $(OBJECTS_DIR)/klayout.lyt $(GDSO
747747
$(RESULTS_DIR)/6_final.v: $(LOG_DIR)/6_report.log
748748

749749
$(GDS_FINAL_FILE): $(GDS_MERGED_FILE)
750-
cp $^ $@
750+
ln -sf $(shell realpath --relative-to=$(dir $@) $<) $@
751751

752752
.PHONY: drc
753753
drc: $(REPORTS_DIR)/6_drc.lyrdb

0 commit comments

Comments
 (0)