@@ -207,7 +207,6 @@ ifeq ($(MAKELEVEL),0)
207207 $(info [INFO][FLOW] Invoked hierarchical flow.)
208208 $(foreach block,$(BLOCKS),$(info Block ${block} needs to be hardened.))
209209endif
210- $(foreach block,$(BLOCKS),$(eval BLOCK_CONFIGS += ./designs/$(PLATFORM)/$(DESIGN_NICKNAME)/$(block)/config.mk))
211210 $(foreach block,$(BLOCKS),$(eval BLOCK_LEFS += ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lef))
212211 $(foreach block,$(BLOCKS),$(eval BLOCK_LIBS += ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/${block}.lib))
213212 $(foreach block,$(BLOCKS),$(eval BLOCK_GDS += ./results/$(PLATFORM)/$(DESIGN_NICKNAME)_$(block)/$(FLOW_VARIANT)/6_final.gds))
@@ -313,9 +312,23 @@ endif
313312export WRAPPED_GDSOAS = $(foreach lef,$(notdir $(WRAP_LEFS ) ) ,$(OBJECTS_DIR ) /$(lef :.lef=_mod.$(STREAM_SYSTEM_EXT ) ))
314313
315314define GENERATE_ABSTRACT_RULE
316- # Single rule, two targets, hence the "&:", syntax
315+ ifeq ($(wildcard $(3 ) ) ,)
316+ # There is no unqiue config.mk for this module, use the shared
317+ # block.mk that, by convention, is in the same folder as config.mk
318+ # of the parent macro.
319+ #
320+ # At an early stage, before refining each of the macros, a shared
321+ # block.mk file can be useful to run through the flow to explore
322+ # more global concerns instead of getting mired in the details of
323+ # each macro.
324+ block := $(patsubst ./designs/$(PLATFORM ) /$(DESIGN_NICKNAME ) /% ,% ,$(dir $(3 ) ) )
325+ $(1 ) $(2 ) & : ./designs/$$(PLATFORM ) /$$(DESIGN_NICKNAME ) /block.mk
326+ $$(UNSET_AND_MAKE ) DESIGN_NAME=${block} DESIGN_NICKNAME=$$(DESIGN_NICKNAME ) _${block} DESIGN_CONFIG=$$< generate_abstract
327+ else
328+ # There is a unqiue config.mk for this Verilog module
317329$(1 ) $(2 ) & : $(3 )
318- $$(UNSET_AND_MAKE ) DESIGN_CONFIG=$(3 ) generate_abstract
330+ $$(UNSET_AND_MAKE ) DESIGN_CONFIG=$$< generate_abstract
331+ endif
319332endef
320333
321334# Targets to harden Blocks in case of hierarchical flow is triggered
0 commit comments