summaryrefslogtreecommitdiff
path: root/util/m5/Makefile.aarch64
diff options
context:
space:
mode:
authorHanhwi Jang <jang.hanhwi@gmail.com>2017-12-10 02:02:34 +0900
committerHanhwi Jang <jang.hanhwi@gmail.com>2018-01-25 12:11:24 +0000
commit3ccef3dd7702530718f145c4c30061688ebe276f (patch)
tree2ca19a4ff18b9f27baff911bde45ee4ce633f305 /util/m5/Makefile.aarch64
parent83f2b253989fd6dfc8f48d5368ae351ade91cfc6 (diff)
downloadgem5-3ccef3dd7702530718f145c4c30061688ebe276f.tar.xz
util: Implement Lua module for m5ops.
This module allows m5ops to be executed in Lua programs. To compile it (in util/m5): The following command generates Lua moduel, gem5OpLua.so. make -f Makefile.<arch> gem5OpLua.so To use it: First, put gem5OpLua.so in Lua library search path. Then, import the module and execute the m5op function. Example usage, creating a checkpoint. m5 = require("gem5OpLua") m5.do_checkpoint(0, 0) Change-Id: Icc18a1fb6c050afeb1cf4558fbdc724fb26a90e2 Reviewed-on: https://gem5-review.googlesource.com/6541 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'util/m5/Makefile.aarch64')
-rw-r--r--util/m5/Makefile.aarch6418
1 files changed, 14 insertions, 4 deletions
diff --git a/util/m5/Makefile.aarch64 b/util/m5/Makefile.aarch64
index 47abca5f6..08180665a 100644
--- a/util/m5/Makefile.aarch64
+++ b/util/m5/Makefile.aarch64
@@ -58,9 +58,13 @@ CFLAGS=-O2 -I $(JDK_PATH)/include/ -I $(JDK_PATH)/include/linux \
-I$(PWD)/../../include -march=armv8-a
LDFLAGS=-static -L. -lm5
-LIB_OBJS=m5op_arm_A64.o
+LIB_OBJS=m5op_arm_A64.o m5_mmap.o
OBJS=m5.o
JNI_OBJS=m5op_arm_A64.o jni_gem5Op.o
+LUA_OBJS=lua_gem5Op.o m5op_arm_A64.o m5_mmap.o
+
+### Need to install lua5.1 library to compile gem5OpLua.so
+LUA_HEADER_INCLUDE=$(shell pkg-config --cflags lua51) -I/usr/include/x86_64-linux-gnu
all: libm5.a m5
@@ -71,10 +75,10 @@ all: libm5.a m5
$(CC) $(CFLAGS) -o $@ -c $<
m5: $(OBJS) libm5.a
- $(CC) -o $@ $(OBJS) $(LDFLAGS)
+ $(CC) -o $@ $^ $(LDFLAGS)
libm5.a: $(LIB_OBJS)
- $(AR) rcs $@ $<
+ $(AR) rcs $@ $^
gem5OpJni: gem5OpJni.jar $(JNI_OBJS)
$(CC) --shared -o lib$@.so $(JNI_OBJS)
@@ -84,5 +88,11 @@ gem5OpJni.jar:
$(JH) jni.gem5Op; \
$(JR) cvf $@ jni/*.class
+lua_gem5Op.o: lua_gem5Op.c
+ $(CC) $(CFLAGS) $(LUA_HEADER_INCLUDE) -o $@ -c $<
+
+gem5OpLua.so: $(LUA_OBJS)
+ $(CC) $(CFLAGS) $^ -o $@ -shared
+
clean:
- rm -f *.o m5 libgemOpJni.so gem5OpJni.jar jni/*.class libm5.a
+ rm -f *.o m5 libgem5OpJni.so gem5OpJni.jar jni/*.class libm5.a gem5OpLua.so