@@ -109,48 +109,8 @@ DESIGN_CONFIG ?= ./designs/nangate45/gcd/config.mk
109109# this file.
110110include $(DESIGN_CONFIG )
111111
112- # For instance Bazel needs artifacts (.odb and .rpt files) on a failure to
113- # allow the user to save hours on re-running the failed step locally, but
114- # when working with a Makefile flow, it is more natural to fail the step
115- # and leave the user to manually inspect the logs and artifacts directly via
116- # the file system.
117- #
118- # Set to 1 to change the behavior to generate artifacts upon failure to
119- # e.g. do a global route. The exit code will still be non-zero on all other
120- # failures that aren't covered by the "useful to inspect the artifacts on
121- # failure" use-case.
122- #
123- # Example: just like detailed routing, a global route that fails with congestion, is not
124- # a build failure(as in exit code non-zero), it is a successful(as in zero exit code)
125- # global route that produce reports detailing the problem.
126- #
127- # Detailed route will not proceed, if there is global routing congestion
128- #
129- # This allows build systems, such as bazel, to create artifacts for global
130- # and detailed route, even if the operation had problems, without having
131- # know about the semantics between global and detailed route.
132- #
133- # Considering that global and detailed route can run for a long time and
134- # use a lot of memory, this allows inspecting results on a laptop for
135- # a build that ran on a server.
136- export GENERATE_ARTIFACTS_ON_FAILURE ?= 0
137-
138- # Default TNS_END_PERCENT value for post CTS timing repair
139- # Try fixing all violating endpoints by default (reduce to 5% for runtime)
140- export TNS_END_PERCENT ?=100
141-
142- # Default routing layer adjustment
143- export ROUTING_LAYER_ADJUSTMENT ?= 0.5
144- export RECOVER_POWER ?= 0
145- export SKIP_INCREMENTAL_REPAIR ?= 0
146- export DETAILED_METRICS ?= 0
147- export EQUIVALENCE_CHECK ?= 0
148- export CORE_UTILIZATION ?=
149- export DIE_AREA ?=
150- export CORE_AREA ?=
151-
152112# If we are running headless use offscreen rendering for save_image
153- ifndef DISPLAY
113+ ifeq ( $( DISPLAY ) ,)
154114export QT_QPA_PLATFORM ?= offscreen
155115endif
156116
@@ -200,6 +160,8 @@ export UTILS_DIR ?= $(FLOW_HOME)/util
200160export SCRIPTS_DIR ?= $(FLOW_HOME ) /scripts
201161export TEST_DIR ?= $(FLOW_HOME ) /test
202162
163+ $(foreach line,$(shell $(SCRIPTS_DIR)/defaults.py),$(eval export $(line)))
164+
203165PUBLIC =nangate45 sky130hd sky130hs asap7 ihp-sg13g2 gf180
204166
205167ifneq ($(wildcard $(PLATFORM_HOME ) /$(PLATFORM ) ) ,)
@@ -256,12 +218,7 @@ export OBJECTS_DIR = $(WORK_HOME)/objects/$(PLATFORM)/$(DESIGN_NICKNAME)/$(FLOW_
256218export REPORTS_DIR = $(WORK_HOME ) /reports/$(PLATFORM ) /$(DESIGN_NICKNAME ) /$(FLOW_VARIANT )
257219export RESULTS_DIR = $(WORK_HOME ) /results/$(PLATFORM ) /$(DESIGN_NICKNAME ) /$(FLOW_VARIANT )
258220
259- # BLOCKS is ORFS specific and is used to trigger hierarchical flow,
260- # MACROS is a space separated list of macros used in the design,
261- # but not necessarily built by ORFS using the BLOCKS mechanism.
262- export MACROS ?= $(BLOCKS )
263-
264- ifdef BLOCKS
221+ ifneq ($(BLOCKS ) ,)
265222 $(foreach block,$(BLOCKS),$(eval BLOCK_LEFS += ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lef))
266223 $(foreach block,$(BLOCKS),$(eval BLOCK_LIBS += ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lib))
267224 $(foreach block,$(BLOCKS),$(eval BLOCK_GDS += ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/6_final.gds))
@@ -271,11 +228,12 @@ ifdef BLOCKS
271228 export ADDITIONAL_LIBS += $(BLOCK_LIBS )
272229 export ADDITIONAL_GDS += $(BLOCK_GDS )
273230 export GDS_FILES += $(BLOCK_GDS )
274- ifdef CDL_FILES
231+ ifneq ($( CDL_FILES),)
275232 export CDL_FILES += $(BLOCK_CDL )
276233 endif
277234endif
278235
236+ export RTLMP_FLOW ?= 1
279237export RTLMP_RPT_DIR ?= $(OBJECTS_DIR ) /rtlmp
280238export RTLMP_RPT_FILE ?= partition.txt
281239export RTLMP_BLOCKAGE_FILE ?= $(OBJECTS_DIR ) /rtlmp/partition.txt.blockage
@@ -304,7 +262,7 @@ YOSYS_FLAGS += -v 3
304262
305263# -------------------------------------------------------------------------------
306264# setup all commands used within this flow
307- export TIME_BIN ?= /usr/bin/ time
265+ export TIME_BIN ?= env time
308266TIME_CMD = $(TIME_BIN ) -f 'Elapsed time: %E[h:]min:sec. CPU time: user %U sys %S (%P). Peak memory: %MKB.'
309267TIME_TEST = $(shell $(TIME_CMD ) echo foo 2>/dev/null)
310268ifeq (,$(strip $(TIME_TEST ) ) )
@@ -490,8 +448,7 @@ $(WRAPPED_LIBS):
490448# |____/ |_| |_| \_| |_| |_| |_|_____|____/___|____/
491449#
492450.PHONY : synth
493- synth : $(RESULTS_DIR ) /1_synth.v \
494- $(RESULTS_DIR)/1_synth.sdc
451+ synth : $(RESULTS_DIR ) /1_synth.v
495452
496453.PHONY : synth-report
497454synth-report : synth
@@ -548,10 +505,6 @@ $(RESULTS_DIR)/1_synth.rtlil: $(YOSYS_DEPENDENCIES)
548505$(RESULTS_DIR ) /1_1_yosys.v : $(RESULTS_DIR ) /1_synth.rtlil
549506 $(UNSET_AND_MAKE ) do-yosys-keep-hierarchy do-yosys
550507
551- $(RESULTS_DIR ) /1_synth.sdc : $(SDC_FILE )
552- mkdir -p $(RESULTS_DIR )
553- cp $(SDC_FILE ) $(RESULTS_DIR ) /1_synth.sdc
554-
555508.PHONY : do-synth
556509do-synth :
557510 mkdir -p $(RESULTS_DIR ) $(LOG_DIR ) $(REPORTS_DIR )
@@ -612,9 +565,11 @@ open_$(1): open_$(2)
612565endef
613566
614567define OPEN_GUI
615- .PHONY: $(1 ) _$(2 )
616- $(1 ) _$(2 ) :
617- $(3 ) =$(RESULTS_DIR ) /$(2 ) $(4 ) $(GUI_ARGS ) $(SCRIPTS_DIR ) /gui.tcl
568+ .PHONY: open_$(1 ) gui_$(1 )
569+ open_$(1 ) :
570+ $(2 ) =$(RESULTS_DIR ) /$(1 ) $(OPENROAD_NO_EXIT_CMD ) $(SCRIPTS_DIR ) /open.tcl
571+ gui_$(1 ) :
572+ $$(UNSET_AND_MAKE ) GUI_SHOW=1 open_$(1 )
618573endef
619574
620575# Separate dependency checking and doing a step. This can
@@ -659,7 +614,7 @@ do-$(1): $(OBJECTS_DIR)/copyright.txt
659614 @echo Running $(3 ) .tcl, stage $(1 )
660615 @(set -eo pipefail; \
661616 trap 'mv $(LOG_DIR ) /$(1 ) .tmp.log $(LOG_DIR ) /$(1 ) .log' EXIT; \
662- $(OPENROAD_EXE ) -exit -no_init $(SCRIPTS_DIR ) /noop.tcl 2>&1 >$(LOG_DIR ) /$(1 ) .tmp.log; \
617+ $(OPENROAD_EXE ) $( OPENROAD_ARGS ) -exit $(SCRIPTS_DIR ) /noop.tcl 2>&1 >$(LOG_DIR ) /$(1 ) .tmp.log; \
663618 $(TIME_CMD ) $(OPENROAD_CMD ) -no_splash $(SCRIPTS_DIR ) /$(3 ) .tcl -metrics $(LOG_DIR ) /$(1 ) .json 2>&1 | \
664619 tee -a $(abspath $(LOG_DIR ) /$(1 ) .tmp.log) )
665620endef
@@ -687,39 +642,19 @@ endef
687642# -------------------------------------------------------------------------------
688643$(eval $(call do-step,2_1_floorplan,$(RESULTS_DIR)/1_synth.v $(RESULTS_DIR)/1_synth.sdc $(TECH_LEF) $(SC_LEF) $(ADDITIONAL_LEFS) $(FOOTPRINT) $(SIG_MAP_FILE) $(FOOTPRINT_TCL),floorplan))
689644
690- # STEP 2: IO Placement (random)
691- # -------------------------------------------------------------------------------
692- ifndef IS_CHIP
693645$(eval $(call do-step,2_2_floorplan_io,$(RESULTS_DIR)/2_1_floorplan.odb $(IO_CONSTRAINTS),io_placement_random))
694- else
695- $(eval $(call do-copy,2_2_floorplan_io,2_1_floorplan.odb,$(IO_CONSTRAINTS)))
696- endif
697646
698647# STEP 3: Timing Driven Mixed Sized Placement
699648# -------------------------------------------------------------------------------
700- ifneq ($(MACRO_PLACEMENT )$(MACRO_PLACEMENT_TCL ) ,)
701- SKIP_TDMS: =1
702- endif
703- ifeq ($(RTLMP_FLOW ) , 1)
704- SKIP_TDMS: =1
705- endif
706- ifneq ($(SKIP_TDMS ) , 1)
707649$(eval $(call do-step,2_3_floorplan_tdms,$(RESULTS_DIR)/2_2_floorplan_io.odb $(RESULTS_DIR)/1_synth.v $(RESULTS_DIR)/1_synth.sdc $(LIB_FILES),tdms_place))
708- else
709- $(eval $(call do-copy,2_3_floorplan_tdms,2_2_floorplan_io.odb,$(RESULTS_DIR)/1_synth.v $(RESULTS_DIR)/1_synth.sdc $(LIB_FILES)))
710- endif
711650
712651# STEP 4: Macro Placement
713652# -------------------------------------------------------------------------------
714653$(eval $(call do-step,2_4_floorplan_macro,$(RESULTS_DIR)/2_3_floorplan_tdms.odb $(RESULTS_DIR)/1_synth.v $(RESULTS_DIR)/1_synth.sdc $(MACRO_PLACEMENT) $(MACRO_PLACEMENT_TCL),macro_place))
715654
716655# STEP 5: Tapcell and Welltie insertion
717656# -------------------------------------------------------------------------------
718- ifeq ($(TAPCELL_TCL ) ,)
719- $(eval $(call do-copy,2_5_floorplan_tapcell,2_4_floorplan_macro.odb))
720- else
721657$(eval $(call do-step,2_5_floorplan_tapcell,$(RESULTS_DIR)/2_4_floorplan_macro.odb $(TAPCELL_TCL),tapcell))
722- endif
723658
724659# STEP 6: PDN generation
725660# -------------------------------------------------------------------------------
@@ -754,13 +689,7 @@ place: $(RESULTS_DIR)/3_place.odb \
754689# -------------------------------------------------------------------------------
755690$(eval $(call do-step,3_1_place_gp_skip_io,$(RESULTS_DIR)/2_floorplan.odb $(RESULTS_DIR)/2_floorplan.sdc $(LIB_FILES),global_place_skip_io))
756691
757- # STEP 2: IO placement (non-random)
758- # -------------------------------------------------------------------------------
759- ifndef IS_CHIP
760692$(eval $(call do-step,3_2_place_iop,$(RESULTS_DIR)/3_1_place_gp_skip_io.odb $(IO_CONSTRAINTS),io_placement))
761- else
762- $(eval $(call do-copy,3_2_place_iop,3_1_place_gp_skip_io.odb,$(IO_CONSTRAINTS)))
763- endif
764693
765694# STEP 3: Global placement with placed IOs, timing-driven, and routability-driven.
766695# -------------------------------------------------------------------------------
@@ -851,19 +780,9 @@ $(eval $(call do-step,5_1_grt,$(RESULTS_DIR)/4_cts.odb $(FASTROUTE_TCL) $(PRE_GL
851780
852781# STEP 2: Run detailed route
853782# -------------------------------------------------------------------------------
854- ifeq ($(USE_WXL ) ,)
855783$(eval $(call do-step,5_2_route,$(RESULTS_DIR)/5_1_grt.odb,detail_route))
856- else
857- $(eval $(call do-step,5_2_route,$(RESULTS_DIR)/4_cts.odb,detail_route))
858- endif
859784
860- # SEP 3: Filler cell insertion
861- # ------------------------------------------------------------------------------
862- ifeq ($(FILL_CELLS ) ,)
863- $(eval $(call do-copy,5_3_fillcell,5_2_route.odb))
864- else
865785$(eval $(call do-step,5_3_fillcell,$(RESULTS_DIR)/5_2_route.odb,fillcell))
866- endif
867786
868787$(eval $(call do-copy,5_route,5_3_fillcell.odb))
869788
@@ -873,6 +792,10 @@ $(eval $(call do-copy,5_route,4_cts.sdc,,.sdc))
873792do-route :
874793 $(UNSET_AND_MAKE ) do-5_1_grt do-5_2_route do-5_3_fillcell do-5_route do-5_route.sdc
875794
795+ .PHONY : do-grt
796+ do-grt :
797+ $(UNSET_AND_MAKE ) do-5_1_grt
798+
876799.PHONY : clean_route
877800clean_route :
878801 rm -rf output* / results* .out.dmp layer_* .mps
@@ -923,13 +846,7 @@ elapsed:
923846elapsed-all :
924847 @$(UTILS_DIR ) /genElapsedTime.py -d $(shell find $(WORK_HOME ) /logs/$(PLATFORM ) /* /* / -type d)
925848
926- # ==============================================================================
927-
928- ifeq ($(USE_FILL ) ,1)
929849$(eval $(call do-step,6_1_fill,$(RESULTS_DIR)/5_route.odb $(RESULTS_DIR)/5_route.sdc $(FILL_CONFIG),density_fill))
930- else
931- $(eval $(call do-copy,6_1_fill,5_route.odb))
932- endif
933850
934851$(eval $(call do-copy,6_1_fill,5_route.sdc,,.sdc))
935852
@@ -1096,10 +1013,10 @@ $(foreach file,$(RESULTS_DEF) $(RESULTS_GDS) $(RESULTS_OAS),klayout_$(file)): kl
10961013
10971014.PHONY : gui_synth
10981015gui_synth :
1099- $(OPENROAD_GUI_CMD ) $(GUI_ARGS ) $( SCRIPTS_DIR ) /sta-synth.tcl
1016+ $(OPENROAD_GUI_CMD ) $(SCRIPTS_DIR ) /sta-synth.tcl
11001017.PHONY : open_synth
11011018open_synth :
1102- $(OPENROAD_NO_EXIT_CMD ) $(GUI_ARGS ) $( SCRIPTS_DIR ) /sta-synth.tcl
1019+ $(OPENROAD_NO_EXIT_CMD ) $(SCRIPTS_DIR ) /sta-synth.tcl
11031020
11041021$(eval $(call OPEN_GUI_SHORTCUT,floorplan,2_floorplan.odb))
11051022$(eval $(call OPEN_GUI_SHORTCUT,place,3_place.odb))
@@ -1108,10 +1025,8 @@ $(eval $(call OPEN_GUI_SHORTCUT,route,5_route.odb))
11081025$(eval $(call OPEN_GUI_SHORTCUT,grt,5_1_grt.odb))
11091026$(eval $(call OPEN_GUI_SHORTCUT,final,6_final.odb))
11101027
1111- $(foreach file,$(RESULTS_DEF),$(eval $(call OPEN_GUI,gui,$(file),DEF_FILE,$(OPENROAD_GUI_CMD))))
1112- $(foreach file,$(RESULTS_ODB),$(eval $(call OPEN_GUI,gui,$(file),ODB_FILE,$(OPENROAD_GUI_CMD))))
1113- $(foreach file,$(RESULTS_DEF),$(eval $(call OPEN_GUI,open,$(file),DEF_FILE,$(OPENROAD_NO_EXIT_CMD))))
1114- $(foreach file,$(RESULTS_ODB),$(eval $(call OPEN_GUI,open,$(file),ODB_FILE,$(OPENROAD_NO_EXIT_CMD))))
1028+ $(foreach file,$(RESULTS_DEF),$(eval $(call OPEN_GUI,$(file),DEF_FILE)))
1029+ $(foreach file,$(RESULTS_ODB),$(eval $(call OPEN_GUI,$(file),ODB_FILE)))
11151030
11161031# Write a def for the corresponding odb
11171032$(foreach file,$(RESULTS_ODB ) ,$(file ) .def) : % .def:
0 commit comments