Skip to content

Commit

Permalink
make: add tapeout makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
rgantonio committed Aug 27, 2024
1 parent 69af8ab commit 3ce7efa
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions target/tapeout/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@


##########################
# Default configurations #
##########################

MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MKFILE_DIR := $(dir $(MKFILE_PATH))
ROOT := $(MKFILE_DIR)../..
BENDER := bender
SNITCH_ROOT := $(shell $(BENDER) path snitch_cluster)

OCCAMYGEN ?= $(ROOT)/util/occamygen/occamygen.py

TARGET_RTL ?= $(ROOT)/target/rtl

#######################
# Config prerequisite #
#######################

# If the configuration file is overriden on the command-line (through
# CFG_OVERRIDE) and this file differs from the least recently used
# (LRU) config, all targets depending on the configuration file have
# to be rebuilt. This file is used to express this condition as a
# prerequisite for other rules.
CFG = $(TARGET_RTL)/cfg/occamy_cfg/lru.hjson

$(CFG): FORCE
@# If the LRU config file doesn't exist, we use the default config.
@if [ ! -e $@ ] ; then \
DEFAULT_CFG="$(TARGET_RTL)/cfg/occamy_cfg/snax_two_clusters.hjson"; \
echo "Using default config file: $$DEFAULT_CFG"; \
cp $$DEFAULT_CFG $@; \
fi
@# If a config file is provided on the command-line
@# then we override the LRU file with it
@if [ $(CFG_OVERRIDE) ] ; then \
echo "Overriding config file with: $(CFG_OVERRIDE)"; \
cp $(CFG_OVERRIDE) $@; \
fi
FORCE:

########################
# Generating Filelists #
########################

syn-gen-list:
@$(OCCAMYGEN) --cfg $(CFG) --outdir ${MKFILE_DIR} --cluster-only-flist ${SNITCH_ROOT}

debug-info:
@echo "SNITCH ROOT: ${SNITCH_ROOT}"
@echo "CFG override: ${CFG_OVERRIDE}"
@echo "Makefile path: ${MKFILE_PATH}"
@echo "Makefile dir: ${MKFILE_DIR}"

0 comments on commit 3ce7efa

Please sign in to comment.