Aldec: Prefer CFG_TOPLEVEL over TOPLEVEL if set
@@ -122,7 +122,11 @@ endif
ifdef SCRIPT_FILE
@echo "do $(SCRIPT_FILE)" >> $@
endif
- @echo "asim $(ASIM_ARGS) +access +w -interceptcoutput -O2 -dbg $(GPI_ARGS) $(TOPLEVEL)" >> $@
+ifneq ($(CFG_TOPLEVEL),)
+ @echo "asim $(ASIM_ARGS) +access +w -interceptcoutput -O2 -dbg $(GPI_ARGS) $(CFG_TOPLEVEL) $(EXTRA_TOPS)" >> $@
+else
+ @echo "asim $(ASIM_ARGS) +access +w -interceptcoutput -O2 -dbg $(GPI_ARGS) $(TOPLEVEL) $(EXTRA_TOPS)" >> $@
+endif
ifeq ($(WAVES),1)
@echo "log -recursive *" >> $@
endif
