Skip to content

Commit

Permalink
Merge branch 'Samanti-Das-Resolving-Issues-30-93'
Browse files Browse the repository at this point in the history
  • Loading branch information
wysiwyng committed Nov 23, 2021
2 parents b27d7c4 + b3ad01d commit 4a43dba
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 68 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
if: matrix.config.name == 'Mac'
run: |
brew install boost coreutils
- name: Requirements (Linux/Mac)
if: matrix.config.name == 'Linux' || matrix.config.name == 'Mac'
working-directory: ${{runner.workspace}}
Expand All @@ -49,6 +50,7 @@ jobs:
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/$LLVM_NAME${{ matrix.config.llvm-ext }}
${{ matrix.config.unpack }} $LLVM_NAME${{ matrix.config.llvm-ext }}
mv $LLVM_NAME llvm-lib
- name: Requirements
shell: bash
working-directory: ${{runner.workspace}}
Expand All @@ -57,6 +59,7 @@ jobs:
wget https://static.dev.sifive.com/dev-tools/$TC_NAME${{ matrix.config.tc-ext }}
${{ matrix.config.unpack }} $TC_NAME${{ matrix.config.tc-ext }}
mv $TC_NAME riscv-tc
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

Expand All @@ -66,6 +69,7 @@ jobs:
run: |
export LLVM_DIR=${{runner.workspace}}/llvm-lib
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=../install
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
Expand Down Expand Up @@ -159,19 +163,19 @@ jobs:
./run_helper.sh ../SW/riscv/build64/riscv_example.elf
./run_helper.sh ../SW/riscv_cpp/build64/riscv_example.elf
- name: Test (Windows)
working-directory: ${{runner.workspace}}/install/examples/bare_etiss_processor/build
if: matrix.config.name == 'Windows'
shell: bash
run: |
PATH=$PATH:/d/a/etiss/install/lib/
cd $BUILD_TYPE
./main.exe --vp.elf_file=../../../SW/riscv/build/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv/memsegs.ini -pLogger
./main.exe --vp.elf_file=../../../SW/riscv/build/riscv_example.elf --jit.type=LLVMJIT --etiss.loglevel=4 -i../../../SW/riscv/memsegs.ini -pLogger
./main.exe --vp.elf_file=../../../SW/riscv_cpp/build/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv_cpp/memsegs.ini -pLogger
./main.exe --vp.elf_file=../../../SW/riscv_cpp/build/riscv_example.elf --jit.type=LLVMJIT --etiss.loglevel=4 -i../../../SW/riscv_cpp/memsegs.ini -pLogger
./main.exe --vp.elf_file=../../../SW/riscv/build64/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv/memsegs.ini -pLogger
./main.exe --vp.elf_file=../../../SW/riscv_cpp/build64/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv_cpp/memsegs.ini -pLogger
# - name: Test (Windows)
# working-directory: ${{runner.workspace}}/install/examples/bare_etiss_processor/build
# if: matrix.config.name == 'Windows'
# shell: bash
# run: |
# PATH=$PATH:/d/a/etiss/install/lib/
# cd $BUILD_TYPE
# ./main.exe --vp.elf_file=../../../SW/riscv/build/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv/memsegs.ini -pLogger
# ./main.exe --vp.elf_file=../../../SW/riscv/build/riscv_example.elf --jit.type=LLVMJIT --etiss.loglevel=4 -i../../../SW/riscv/memsegs.ini -pLogger
# ./main.exe --vp.elf_file=../../../SW/riscv_cpp/build/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv_cpp/memsegs.ini -pLogger
# ./main.exe --vp.elf_file=../../../SW/riscv_cpp/build/riscv_example.elf --jit.type=LLVMJIT --etiss.loglevel=4 -i../../../SW/riscv_cpp/memsegs.ini -pLogger
# ./main.exe --vp.elf_file=../../../SW/riscv/build64/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv/memsegs.ini -pLogger
# ./main.exe --vp.elf_file=../../../SW/riscv_cpp/build64/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv_cpp/memsegs.ini -pLogger

benchmark:
strategy:
Expand Down Expand Up @@ -348,6 +352,7 @@ jobs:
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo ::set-output name=body::$body
- name: Find Comment
uses: peter-evans/find-comment@v1
id: fc
Expand Down Expand Up @@ -403,7 +408,6 @@ jobs:
git commit -m "update perf"
git push
delete-artifact:
if: always()
needs: [display-wiki, display-pr]
Expand All @@ -418,5 +422,4 @@ jobs:
uses: geekyeggo/delete-artifact@1-glob-support
with:
name: "*"
useGlob: true

useGlob: true
35 changes: 4 additions & 31 deletions src/CPUCore.cpp
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
/**
@copyright
<pre>
Copyright 2018 Infineon Technologies AG
This file is part of ETISS tool, see <https://github.com/tum-ei-eda/etiss>.
The initial version of this software has been created with the funding support by the German Federal
Ministry of Education and Research (BMBF) in the project EffektiV under grant 01IS13022.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and
the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
Expand All @@ -31,23 +21,15 @@
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.
</pre>
@author Marc Greim <[email protected]>, Chair of Electronic Design Automation, TUM
@date July 29, 2014
@version 0.1
*/
/**
@file
@brief implementation of etiss/CPUCore.h
@detail
*/
#include "etiss/CPUCore.h"
#include "etiss/ETISS.h"
Expand Down Expand Up @@ -546,18 +528,13 @@ etiss::int32 CPUCore::execute(ETISS_System &_system)

// get JIT instance
std::shared_ptr<JIT> jiti = jit_; // copy jit because it may change
if (!jiti) // if not present fall back to first loaded jit implementation
if (!jiti)
{
jiti = etiss::getDefaultJIT();
etiss::log(etiss::WARNING,
std::string("Using default jit instance for CPUCore: ") + name_ + " - " + jiti->getName());
if (!jiti)
{
etiss::log(etiss::ERROR, std::string("No JIT available to ") + name_);
return RETURNCODE::JITERROR;
}
etiss::log(etiss::ERROR, std::string("No JIT available to ") + name_);
return RETURNCODE::JITERROR;
}


// verify jit
if (etiss::cfg().get<bool>("jit.verify", true))
{
Expand Down Expand Up @@ -935,7 +912,3 @@ etiss::int32 CPUCore::execute(ETISS_System &_system)

return exception;
}




38 changes: 17 additions & 21 deletions src/ETISS.cpp
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
/**
@copyright
<pre>
Copyright 2018 Infineon Technologies AG
This file is part of ETISS tool, see <https://github.com/tum-ei-eda/etiss>.
The initial version of this software has been created with the funding support by the German Federal
Ministry of Education and Research (BMBF) in the project EffektiV under grant 01IS13022.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and
the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
Expand All @@ -31,24 +21,16 @@
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.
</pre>
@author Marc Greim <[email protected]>, Chair of Electronic Design Automation, TUM
@date July 29, 2014
@version 0.1
*/
/**
@file ETISS.cpp
@brief Implementation of etiss/ETISS.h except for
etiss::preloadLibraries
@detail
*/

#include "etiss/ETISS.h"
Expand All @@ -62,6 +44,7 @@
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/variables_map.hpp>
#include <boost/algorithm/string.hpp>

#if ETISS_USE_DLSYM
#include <dlfcn.h>
Expand Down Expand Up @@ -512,15 +495,27 @@ void etiss_loadIniConfigs()
else if (std::string(iter_section.pItem) == "BoolConfigurations")
{
std::string itemval = iter_value.pItem;
boost::algorithm::to_lower(itemval); // converts itemval to lower case string
bool val;
std::istringstream(itemval) >> std::boolalpha >> val;

if ((itemval == "true") | (itemval == "yes") | (itemval == "1") | (itemval == "t")) val = true;
else if ((itemval == "false") | (itemval == "no") | (itemval == "0") | (itemval == "f")) val = false;
else etiss::log(etiss::FATALERROR, std::string("Configuration value ") + iter_key.pItem + " could not be parsed as boolean");

etiss::cfg().set<bool>(iter_key.pItem, val);
}
else if (std::string(iter_section.pItem) == "IntConfigurations") // already load!
{
std::string itemval = iter_value.pItem;
std::size_t sz = 0;
double val = std::stod(itemval, &sz);
long long val;
try {
val = std::stoll(itemval, &sz, 0);
}
// catch invalid_argument exception.
catch (std::invalid_argument const&){
etiss::log(etiss::FATALERROR, std::string("Configuration value ") + iter_key.pItem + " could not be parsed as integer");
}
etiss::cfg().set<long long>(iter_key.pItem, val);
// we use double, as long could have only 32 Bit (e.g. on Windows)
// and long long is not offered by the ini library
Expand Down Expand Up @@ -667,6 +662,7 @@ void etiss::Initializer::loadIniJIT(std::shared_ptr<etiss::CPUCore> cpu)
if (!etiss::cfg().isSet("jit.type"))
{
etiss::log(etiss::INFO, "No JIT configured. Will use default JIT. \n");
cpu->set(etiss::getDefaultJIT());
return;
}
if (cpu->getJITName() != "")
Expand Down Expand Up @@ -1007,4 +1003,4 @@ std::string etiss::errorMessage(etiss::int32 code, CPUArch *arch)
return "Unknown CPU architecture dependent error code.";
}
}
}
}

0 comments on commit 4a43dba

Please sign in to comment.