diff options
author | William PC <w_calandrini[at]hotmail[dot]com> | 2022-11-05 02:27:06 +0000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-11-05 21:15:08 +0700 |
commit | e40642159b23e9b8b2ad75cfb575121e38c37b5d (patch) | |
tree | fd95231859228ab38b0e7b88c88b59a272569a5f /academic | |
parent | 5140b3b4e2ddd4d111b5d55a03ddcc5f8243b161 (diff) | |
download | slackbuilds-e40642159b23e9b8b2ad75cfb575121e38c37b5d.tar.gz |
academic/SimEng: Added (cycle-accurate processor simulator)
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'academic')
-rw-r--r-- | academic/SimEng/README | 28 | ||||
-rw-r--r-- | academic/SimEng/SimEng.SlackBuild | 142 | ||||
-rw-r--r-- | academic/SimEng/SimEng.info | 10 | ||||
-rw-r--r-- | academic/SimEng/slack-desc | 19 |
4 files changed, 199 insertions, 0 deletions
diff --git a/academic/SimEng/README b/academic/SimEng/README new file mode 100644 index 0000000000..acc2230a48 --- /dev/null +++ b/academic/SimEng/README @@ -0,0 +1,28 @@ + SimEng is a framework for building modern, cycle-accurate processor +simulators. Its goals are to be: + + - Fast, typically 4-5X faster than gem5 + - Easy to use and modify to model desired microarchitecture + configurations. New cores can be configured in just a few hours + - Scalable, from simple scalar microarchitectures up to the most + sophisticated, superscalar, out-of-order designs + - Capable of supporting a wide range of instruction set + architectures (ISAs), starting with Armv8 but eventually including + RISC-V, x86, POWER, etc. + - Accurate, aiming for simulated cycle times being within 5-10% of + real hardware + - Open source, with a permissive license to enable collaboration + across academia and industry + + SimEng places an emphasis on performance and ease of use, whilst +maintaining a clean, modern, simple and well-documented code base. +For example, the current out-of-order (OoO) model is implemented +in around 10,000 lines of simple C++, with another 9,000 lines or +so implementing the specifics of the Armv8 ISA, and around 13,000 +lines of code in the accompanying test suite. SimEng should be +simple to read and understand, making it ideal to modify to your +requirements and include it in your projects. + + + Invocation example: + # simeng /usr/share/SimEng-0.9.4/configs/a64fx.yaml diff --git a/academic/SimEng/SimEng.SlackBuild b/academic/SimEng/SimEng.SlackBuild new file mode 100644 index 0000000000..aef696ee19 --- /dev/null +++ b/academic/SimEng/SimEng.SlackBuild @@ -0,0 +1,142 @@ +#!/bin/bash + +# Slackware build script for SimEng + +# Copyright 2022 William PC - Seattle, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=SimEng +VERSION=${VERSION:-0.9.4} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +YAMLCPP_VERSION=0.7.0 + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + + +# fix library installation path +sed -i '55s#DESTINATION lib#&'${LIBDIRSUFFIX}'/'$PRGNAM'#' src/lib/CMakeLists.txt +sed -i '72s#lib#&'${LIBDIRSUFFIX}'/'$PRGNAM'#' CMakeLists.txt + + +mkdir -p build +cd build + +# unpack dependences +mkdir -p _deps/{capstone-lib,yaml-cpp}-src +tar xvf $CWD/capstone-src.tar.gz -C _deps/capstone-lib-src --strip-components 1 +tar xvf $CWD/yaml-cpp-$YAMLCPP_VERSION.tar.gz -C _deps/yaml-cpp-src --strip-components 1 + + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib${LIBDIRSUFFIX} \ + -DCMAKE_INSTALL_MANDIR=/usr/man \ + -DCMAKE_INSTALL_DOCDIR=/usr/doc/$PRGNAM-$VERSION \ + -DCMAKE_INSTALL_DATAROOTDIR=/usr \ + -DBUILD_SHARED_LIBS=ON \ + -DFETCHCONTENT_FULLY_DISCONNECTED=ON \ + $OPTS \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install/strip DESTDIR=$PKG +cd .. + +# install libraries used by SimEng +cp -av build/_deps/yaml-cpp-build/libyaml-cpp.so* \ + build/_deps/capstone-lib-build/libcapstone.so* \ + $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM + +# install additional files +mkdir -p $PKG/usr/share/$PRGNAM-$VERSION +cp -a configs $PKG/usr/share/$PRGNAM-$VERSION + + +# Don't ship .la files: +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + {CONTRIBUTORS,LICENSE,RELEASE-NOTES}.txt docs \ + LICENSE_{CAPSTONE,GTEST,LLVM,YAML-CPP}.txt \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/academic/SimEng/SimEng.info b/academic/SimEng/SimEng.info new file mode 100644 index 0000000000..6579e02d93 --- /dev/null +++ b/academic/SimEng/SimEng.info @@ -0,0 +1,10 @@ +PRGNAM="SimEng" +VERSION="0.9.4" +HOMEPAGE="https://uob-hpc.github.io/SimEng" +DOWNLOAD="https://github.com/UoB-HPC/SimEng/archive/0.9.4/SimEng-0.9.4.tar.gz https://github.com/UoB-HPC/capstone/archive/Armv9.2-update/capstone-src.tar.gz https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.7.0.tar.gz" +MD5SUM="2f249f7b38cc716cb13f1a5b41555b92 c837da9aad754299d9ee62007f428e76 74d646a3cc1b5d519829441db96744f0" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="William PC" +EMAIL="w_calandrini[at]hotmail[dot]com" diff --git a/academic/SimEng/slack-desc b/academic/SimEng/slack-desc new file mode 100644 index 0000000000..0c74a32504 --- /dev/null +++ b/academic/SimEng/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +SimEng: SimEng (framework for cycle-accurate processor simulator) +SimEng: +SimEng: The Simulation Engine (SimEng) is a framework for building modern +SimEng: cycle-accurate processor simulators. It aims to be: +SimEng: - Fast +SimEng: - Easy to use and modify to desired configurations +SimEng: - Scalable, supporting simulation of simple scalar cores, up to +SimEng: superscalar out-of-order designs +SimEng: - Capable of supporting a wide range of ISAs. +SimEng: - Open source, with a permissive license to enable collaboration +SimEng: across academia and industry |