forked from pulp-platform/dram_rtl_sim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdram_rtl_sim.mk
26 lines (22 loc) · 984 Bytes
/
dram_rtl_sim.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright 2024 ETH Zurich and University of Bologna.
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
# SPDX-License-Identifier: SHL-0.51
#
# Nils Wistoff <[email protected]>
BENDER ?= bender
CMAKE ?= cmake
DRAM_RTL_SIM_ROOT ?= $(shell $(BENDER) path axi_dram_sim)
DRAMSYS_ROOT ?= $(DRAM_RTL_SIM_ROOT)/dramsys_lib/DRAMSys
DRAMSYS_BUILD_DIR ?= $(DRAMSYS_ROOT)/build
dramsys: $(DRAMSYS_BUILD_DIR)/lib/libsystemc.so
# Clone and patch DRAMSys
$(DRAMSYS_ROOT)/.patched:
rm -rf $(DRAMSYS_ROOT)
git clone https://github.com/tukl-msd/DRAMSys.git $(DRAMSYS_ROOT)
cd $(DRAMSYS_ROOT) && git reset --hard 8e021ea && git apply $(DRAM_RTL_SIM_ROOT)/dramsys_lib/dramsys_lib_patch
@touch $@
# Build DRAMSys
$(DRAMSYS_BUILD_DIR)/lib/libsystemc.so: $(DRAMSYS_ROOT)/.patched
mkdir -p $(DRAMSYS_BUILD_DIR)
cd $(DRAMSYS_BUILD_DIR) && $(CMAKE) -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC -D DRAMSYS_WITH_DRAMPOWER=ON $(DRAMSYS_ROOT)
$(MAKE) -C $(DRAMSYS_BUILD_DIR)