-
Notifications
You must be signed in to change notification settings - Fork 58
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
10 changed files
with
1,685 additions
and
5 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,53 @@ | ||
# Copyright 2023 ETH Zurich and University of Bologna. | ||
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Viviane Potocnik ETH Zurich <[email protected]> | ||
|
||
# Usage of absolute paths is required to externally include this Makefile | ||
MK_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
SRC_DIR := $(realpath $(MK_DIR)../../../target/snitch_cluster/sw/apps/transformer/src) | ||
DNN_DIR := $(realpath $(MK_DIR)../../dnn/src/) | ||
BLAS_DIR := $(realpath $(MK_DIR)../../blas/) | ||
APP_DIR := $(realpath $(MK_DIR)src) | ||
DATA_GEN_DIR := $(realpath $(MK_DIR)../../../target/snitch_cluster/sw/apps/dnn/) | ||
APP ?= transformer | ||
|
||
$(info DATA_GEN_DIR: $(DATA_GEN_DIR)) | ||
|
||
SRCS = $(realpath $(SRC_DIR)/$(APP).c) | ||
INCDIRS += $(SRC_DIR) $(BLAS_DIR) $(DNN_DIR) $(APP_DIR) | ||
|
||
DATA_CFG = $(SRC_DIR)/params.hjson | ||
DATA_H = $(SRC_DIR)/data.h | ||
|
||
$(info Generating $(DATA_H) from $(DATA_CFG) using $(DATA_GEN_DIR)/datagen.py) | ||
|
||
$(DATA_H): $(DATA_GEN_DIR)/datagen.py $(DATA_CFG) | ||
$(info Generating $(DATA_H) from $(DATA_CFG)) | ||
$(info Running command: $< -c $(DATA_CFG) -o $@ ) | ||
$< -c $(DATA_CFG) -o $@ | ||
$(info Done and saved to $(DATA_H)) | ||
|
||
.PHONY: clean-data clean echo | ||
|
||
clean-data: | ||
rm -f $(DATA_H) | ||
|
||
clean: clean-data | ||
|
||
echo: | ||
$(info prefix: $(realpath $(MK_DIR))) | ||
$(info APP: $(APP)) | ||
$(info APP_DIR: $(APP_DIR)) | ||
$(info DATA_H: $(DATA_H)) | ||
$(info DATA_CFG: $(DATA_CFG)) | ||
$(info MK_DIR: $(MK_DIR)) | ||
$(info SRC_DIR: $(SRC_DIR)) | ||
$(info DNN_DIR: $(DNN_DIR)) | ||
$(info BLAS_DIR: $(BLAS_DIR)) | ||
$(info SRCS: $(SRCS)) | ||
$(info INCDIRS: $(INCDIRS)) | ||
$(info DEP: $(DEP)) | ||
$(info PYTHON: $(MK_DIR)dnn/datagen.py) | ||
$(info PYTHON COMMAND: $(MK_DIR)dnn/datagen.py -c $(DATA_CFG) -o $(DATA_H)) |
Oops, something went wrong.