| # Copyright 2024 Google LLC |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| KELVIN_CORE_SRC_DIR := $(ROOTDIR)/hw/kelvin |
| KELVIN_CORE_OUT_DIR := $(OUT)/kelvin/hw/kelvin_core |
| FASTVDMA_CORE_SRC_DIR := $(ROOTDIR)/hw/matcha |
| FASTVDMA_CORE_OUT_DIR := $(OUT)/matcha/hw/fastvdma_core |
| |
| $(KELVIN_CORE_OUT_DIR): |
| mkdir -p "$(KELVIN_CORE_OUT_DIR)" |
| |
| $(FASTVDMA_CORE_OUT_DIR): |
| mkdir -p "$(FASTVDMA_CORE_OUT_DIR)" |
| |
| ## Build kelvin system verilog core |
| # |
| # Used in the airgapped bitstream build |
| kelvin_core: | $(KELVIN_CORE_OUT_DIR) |
| cd "$(KELVIN_CORE_SRC_DIR)" && \ |
| bazel build //hdl/chisel:kelvin_core |
| cd "$(KELVIN_CORE_SRC_DIR)" && \ |
| cp -rf bazel-bin/hdl/chisel/* $(KELVIN_CORE_OUT_DIR) |
| |
| ## Clean kelvin core artifacts |
| kelvin_core_clean: |
| rm -rf "$(KELVIN_CORE_OUT_DIR)" |
| cd "$(KELVIN_CORE_SRC_DIR)" && bazel clean --expunge |
| |
| ## Build fastvdma system verilog core |
| # |
| # Used in the airgapped bitstream build |
| fastvdma_core: | $(FASTVDMA_CORE_OUT_DIR) |
| cd "$(FASTVDMA_CORE_SRC_DIR)" && \ |
| bazel build hw/ip/dma/chisel:fastvdma_core |
| cd "$(FASTVDMA_CORE_SRC_DIR)" && \ |
| cp -rf bazel-bin/hw/ip/dma/chisel/* $(FASTVDMA_CORE_OUT_DIR) |
| |
| ## Clean fastvdma core artifacts |
| fastvdma_core_clean: |
| rm -rf "$(FASTVDMA_CORE_OUT_DIR)" |
| cd "$(FASTVDMA_CORE_SRC_DIR)" && bazel clean --expunge |
| |
| .PHONY:: kelvin_core kelvin_core_clean |
| .PHONY:: fastvdma_core fastvdma_core_clean |