forked from powerjg/learning_gem5
-
Notifications
You must be signed in to change notification settings - Fork 0
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
11 changed files
with
233 additions
and
0 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,5 @@ | ||
_build/ | ||
_templates/ | ||
.git/ | ||
_static/figures/ | ||
_static/docker/ |
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,26 @@ | ||
FROM ubuntu:16.04 | ||
|
||
MAINTAINER Jason Lowe-Power <[email protected]> | ||
|
||
|
||
# Install all of gem5's dependencies | ||
RUN apt-get update -y && apt-get install -y \ | ||
build-essential \ | ||
python-dev \ | ||
scons \ | ||
swig \ | ||
zlib1g-dev \ | ||
m4 \ | ||
libprotobuf-dev \ | ||
python-protobuf \ | ||
protobuf-compiler \ | ||
libgoogle-perftools-dev | ||
RUN apt-get install --no-install-recommends -y mercurial | ||
|
||
# Download the gem5 source | ||
WORKDIR /usr/local/src | ||
RUN hg clone http://repo.gem5.org/gem5 | ||
|
||
# Build gem5 | ||
WORKDIR /usr/local/src/gem5 | ||
RUN scons build/X86/gem5.opt -j5 |
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,36 @@ | ||
#!/bin/bash | ||
|
||
# Change this to your docker username to push to docker hub | ||
PREFIX=powerjg | ||
|
||
build () { | ||
echo "Building $1..." | ||
docker build -q -t $1 -f $2 . | ||
rc=$? | ||
if [[ $rc != 0 ]]; then | ||
echo "Failed" | ||
exit $rc | ||
else | ||
echo "Done" | ||
fi | ||
} | ||
|
||
push () { | ||
docker push $1 | ||
echo | ||
} | ||
|
||
build powerjg/learning_gem5-base _static/docker/base.dockerfile | ||
|
||
|
||
part1=( building simple-config cache-config two-level-opts ) | ||
for name in "${part1[@]}"; do | ||
build $PREFIX/learning_gem5-part1-$name _static/docker/part1/$name.dockerfile | ||
push $PREFIX/learning_gem5-part1-$name | ||
done | ||
|
||
part2=( helloobject debugging events parameters ) | ||
for name in "${part2[@]}"; do | ||
build $PREFIX/learning_gem5-part2-$name _static/docker/part2/$name.dockerfile | ||
push $PREFIX/learning_gem5-part2-$name | ||
done |
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,12 @@ | ||
FROM learning-gem5/base | ||
|
||
MAINTAINER Jason Lowe-Power <[email protected]> | ||
|
||
|
||
|
||
WORKDIR /usr/local/src/gem5 | ||
|
||
|
||
# Run with no script. Default test with --help | ||
CMD ["build/X86/gem5.opt", \ | ||
"--help"] |
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,16 @@ | ||
FROM learning-gem5/base | ||
|
||
MAINTAINER Jason Lowe-Power <[email protected]> | ||
|
||
WORKDIR /usr/local/src/gem5 | ||
|
||
RUN mkdir -p /usr/local/src/gem5/configs/learning/part1/ | ||
|
||
# Copy script | ||
COPY _static/scripts/part1/caches.py \ | ||
_static/scripts/part1/two_level.py \ | ||
/usr/local/src/gem5/configs/learning/part1/ | ||
|
||
# Run with the script | ||
CMD ["build/X86/gem5.opt", \ | ||
"configs/learning/part1/two_level.py"] |
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,15 @@ | ||
FROM learning-gem5/base | ||
|
||
MAINTAINER Jason Lowe-Power <[email protected]> | ||
|
||
WORKDIR /usr/local/src/gem5 | ||
|
||
RUN mkdir -p /usr/local/src/gem5/configs/learning/part1/ | ||
|
||
# Copy script | ||
COPY _static/scripts/part1/simple.py \ | ||
/usr/local/src/gem5/configs/learning/part1/ | ||
|
||
# Run with the script | ||
CMD ["build/X86/gem5.opt", \ | ||
"configs/learning/part1/simple.py"] |
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,17 @@ | ||
FROM learning-gem5/base | ||
|
||
MAINTAINER Jason Lowe-Power <[email protected]> | ||
|
||
WORKDIR /usr/local/src/gem5 | ||
|
||
RUN mkdir -p /usr/local/src/gem5/configs/learning/part1/ | ||
|
||
# Copy script | ||
COPY _static/scripts/part1/caches_opts.py \ | ||
_static/scripts/part1/two_level_opts.py \ | ||
/usr/local/src/gem5/configs/learning/part1/ | ||
|
||
# Run with the script | ||
CMD ["build/X86/gem5.opt", \ | ||
"configs/learning/part1/two_level_opts.py", \ | ||
"--l2_size=1MB", "--l1d_size=128kB"] |
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,27 @@ | ||
FROM learning-gem5/base | ||
|
||
MAINTAINER Jason Lowe-Power <[email protected]> | ||
|
||
WORKDIR /usr/local/src/gem5 | ||
|
||
RUN mkdir -p /usr/local/src/gem5/configs/learning/part2/ && \ | ||
mkdir -p /usr/local/src/gem5/src/learning/ | ||
|
||
# Copy script | ||
COPY _static/scripts/part2/helloobject/run_hello.py \ | ||
/usr/local/src/gem5/configs/learning/part2/ | ||
|
||
# Copy code | ||
COPY _static/scripts/part2/debugging/SConscript \ | ||
_static/scripts/part2/debugging/hello_object.cc \ | ||
_static/scripts/part2/helloobject/HelloObject.py \ | ||
_static/scripts/part2/helloobject/hello_object.hh \ | ||
/usr/local/src/gem5/src/learning_gem5/ | ||
|
||
|
||
RUN scons build/X86/gem5.opt -j5 | ||
|
||
# Run with the script | ||
CMD ["build/X86/gem5.opt", \ | ||
"--debug-flags=Hello", \ | ||
"configs/learning/part2/run_hello.py"] |
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,26 @@ | ||
FROM learning-gem5/base | ||
|
||
MAINTAINER Jason Lowe-Power <[email protected]> | ||
|
||
WORKDIR /usr/local/src/gem5 | ||
|
||
RUN mkdir -p /usr/local/src/gem5/configs/learning/part2/ && \ | ||
mkdir -p /usr/local/src/gem5/src/learning/ | ||
|
||
# Copy script | ||
COPY _static/scripts/part2/helloobject/run_hello.py \ | ||
/usr/local/src/gem5/configs/learning/part2/ | ||
|
||
# Copy code | ||
COPY _static/scripts/part2/helloobject/HelloObject.py \ | ||
_static/scripts/part2/debugging/SConscript \ | ||
_static/scripts/part2/events/hello_object.cc \ | ||
_static/scripts/part2/events/hello_object.hh \ | ||
/usr/local/src/gem5/src/learning_gem5/ | ||
|
||
RUN scons build/X86/gem5.opt -j5 | ||
|
||
# Run with the script | ||
CMD ["build/X86/gem5.opt", \ | ||
"--debug-flags=Hello", \ | ||
"configs/learning/part2/run_hello.py"] |
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,25 @@ | ||
FROM learning-gem5/base | ||
|
||
MAINTAINER Jason Lowe-Power <[email protected]> | ||
|
||
WORKDIR /usr/local/src/gem5 | ||
|
||
RUN mkdir -p /usr/local/src/gem5/configs/learning/part2/ && \ | ||
mkdir -p /usr/local/src/gem5/src/learning/ | ||
|
||
# Copy script | ||
COPY _static/scripts/part2/helloobject/run_hello.py \ | ||
/usr/local/src/gem5/configs/learning/part2/ | ||
|
||
# Copy code | ||
COPY _static/scripts/part2/helloobject/HelloObject.py \ | ||
_static/scripts/part2/helloobject/SConscript \ | ||
_static/scripts/part2/helloobject/hello_object.cc \ | ||
_static/scripts/part2/helloobject/hello_object.hh \ | ||
/usr/local/src/gem5/src/learning_gem5/ | ||
|
||
RUN scons build/X86/gem5.opt -j5 | ||
|
||
# Run with the script | ||
CMD ["build/X86/gem5.opt", \ | ||
"configs/learning/part2/run_hello.py"] |
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,28 @@ | ||
FROM learning-gem5/base | ||
|
||
MAINTAINER Jason Lowe-Power <[email protected]> | ||
|
||
WORKDIR /usr/local/src/gem5 | ||
|
||
RUN mkdir -p /usr/local/src/gem5/configs/learning/part2/ && \ | ||
mkdir -p /usr/local/src/gem5/src/learning/ | ||
|
||
# Copy script | ||
COPY _static/scripts/part2/parameters/hello_goodbye.py \ | ||
/usr/local/src/gem5/configs/learning/part2/ | ||
|
||
# Copy code | ||
COPY _static/scripts/part2/parameters/HelloObject.py \ | ||
_static/scripts/part2/parameters/SConscript \ | ||
_static/scripts/part2/parameters/hello_object.cc \ | ||
_static/scripts/part2/parameters/hello_object.hh \ | ||
_static/scripts/part2/parameters/goodbye_object.cc \ | ||
_static/scripts/part2/parameters/goodbye_object.hh \ | ||
/usr/local/src/gem5/src/learning_gem5/ | ||
|
||
RUN scons build/X86/gem5.opt -j5 | ||
|
||
# Run with the script | ||
CMD ["build/X86/gem5.opt", \ | ||
"--debug-flags=Hello", \ | ||
"configs/learning/part2/hello_goodbye.py"] |