summaryrefslogtreecommitdiff
path: root/util/m5/Makefile.x86
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.x86
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.x86')
-rw-r--r--util/m5/Makefile.x8623
1 files changed, 20 insertions, 3 deletions
diff --git a/util/m5/Makefile.x86 b/util/m5/Makefile.x86
index 5ea29ccaa..890e4b151 100644
--- a/util/m5/Makefile.x86
+++ b/util/m5/Makefile.x86
@@ -32,7 +32,9 @@ AS=as
LD=ld
CFLAGS=-O2 -DM5OP_ADDR=0xFFFF0000 -I$(PWD)/../../include
-OBJS=m5.o m5op_x86.o
+OBJS=m5.o m5op_x86.o m5_mmap.o
+LUA_HEADER_INCLUDE=$(shell pkg-config --cflags-only-I lua51)
+LUA_OBJS=lua_gem5Op.opic m5op_x86.opic m5_mmap.opic
all: m5
@@ -40,10 +42,25 @@ all: m5
$(CC) $(CFLAGS) -o $@ -c $<
%.o: %.c
- $(CC) $(CFLAGS) -o $@ -c $<
+ $(CC) $(CFLAGS) -o $@ -c $<
+
+%.opic : %.S
+ $(CC) $(CFLAGS) -fPIC -o $@ -c $<
+
+%.opic : %.c
+ $(CC) $(CFLAGS) -fPIC -o $@ -c $<
m5: $(OBJS)
$(CC) -o $@ $(OBJS)
+m5op_x86.opic: m5op_x86.S
+ $(CC) $(CFLAGS) -DM5OP_PIC -fPIC -o $@ -c $<
+
+lua_gem5Op.opic: lua_gem5Op.c
+ $(CC) $(CFLAGS) $(LUA_HEADER_INCLUDE) -fPIC -o $@ -c $<
+
+gem5OpLua.so: $(LUA_OBJS)
+ $(CC) $(CFLAGS) -fPIC $^ -o $@ -shared
+
clean:
- rm -f *.o m5
+ rm -f *.o *.opic m5 gem5OpLua.so