forked from pulp-platform/occamy
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
|