Merge branch 'develop'

This commit is contained in:
Eyck Jentzsch 2021-11-11 19:34:23 +01:00
commit c15fef05d0
12 changed files with 289 additions and 40 deletions

View File

@ -16,7 +16,7 @@
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.1336041151.1615713914" name="/" resourcePath=""> <folderInfo id="cdt.managedbuild.toolchain.gnu.base.1336041151.1615713914" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.1297474963" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base"> <toolChain id="cdt.managedbuild.toolchain.gnu.base.1297474963" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.1141103737" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/> <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.1141103737" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder buildPath="/TGFS-ISS/build/Debug" id="de.marw.cdt.cmake.core.genscriptbuilder.1100382234" parallelBuildOn="false" superClass="de.marw.cdt.cmake.core.genscriptbuilder"/> <builder buildPath="/TGC-ISS/build/Debug" id="de.marw.cdt.cmake.core.genscriptbuilder.1100382234" keepEnvironmentInBuildfile="false" name="CMake Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="de.marw.cdt.cmake.core.genscriptbuilder"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.740869785" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> <tool id="cdt.managedbuild.tool.gnu.archiver.base.740869785" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1934077203" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base"> <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1934077203" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.17118862" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.17118862" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
@ -41,21 +41,23 @@
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule buildDir="build/${ConfigName}" moduleId="de.marw.cdt.cmake.core.settings"> <storageModule buildDir="build/${ConfigName}" moduleId="de.marw.cdt.cmake.core.settings">
<options/> <options/>
<defs/> <defs>
<undefs/> <def name="ENABLE_CODEGEN" type="BOOL" val="ON"/>
<def name="CMAKE_BUILD_TYPE" type="STRING" val="${ConfigName}"/>
</defs>
</storageModule> </storageModule>
</cconfiguration> </cconfiguration>
</storageModule> </storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0"> <storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="TGFS-ISS.null.449389099" name="TGFS-ISS"/> <project id="TGC-ISS.null.449389099" name="TGC-ISS"/>
</storageModule> </storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2"> <storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default"> <configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/TGFS-ISS"/> <resource resourceType="PROJECT" workspacePath="/TGC-ISS"/>
</configuration> </configuration>
<configuration configurationName="Debug"> <configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/TGFS-ISS"/> <resource resourceType="PROJECT" workspacePath="/TGC-ISS"/>
</configuration> </configuration>
</storageModule> </storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "dbt-core"] [submodule "dbt-core"]
path = dbt-core path = dbt-core
url = https://git.minres.com/DBT-RISE/DBT-RISE-Core.git url = https://git.minres.com/DBT-RISE/DBT-RISE-Core.git
[submodule "coredsl"]
path = coredsl
url = https://git.minres.com/DBT-RISE/CoreDSL.git

View File

@ -1,10 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>TGFS-ISS</name> <name>TGC-ISS</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers> <triggers>clean,full,incremental,</triggers>
@ -23,5 +28,6 @@
<nature>org.eclipse.cdt.core.ccnature</nature> <nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature> <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View File

@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.16)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/scc/cmake) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/scc/cmake)
project(TGFS-ISS VERSION 1.0.0 LANGUAGES CXX) project(TGFS-ISS VERSION 1.0.0 LANGUAGES CXX)
set(CORE_NAME TGC_C CACHE STRING "The core to build the ISS for" )
set(WITH_LLVM FALSE CACHE BOOL "Build LLVM based backend") set(WITH_LLVM FALSE CACHE BOOL "Build LLVM based backend")
include(GNUInstallDirs) include(GNUInstallDirs)
include(Conan)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -32,7 +32,60 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(warnings "/W4 /WX /EHsc") set(warnings "/W4 /WX /EHsc")
endif() endif()
setup_conan(TARGETS) include(ConanInline)
set(CONAN_BOOST_OPTIONS
boost:fPIC=True
boost:shared=True
boost:header_only=False
boost:without_context=True
boost:without_contract=True
boost:without_coroutine=True
boost:without_fiber=True
boost:without_graph=True
boost:without_graph_parallel=True
boost:without_iostreams=True
boost:without_json=True
boost:without_locale=True
boost:without_log=True
boost:without_math=True
boost:without_mpi=True
boost:without_nowide=True
boost:without_python=True
boost:without_random=True
boost:without_regex=True
boost:without_serialization=True
boost:without_stacktrace=True
boost:without_test=True
boost:without_timer=True
boost:without_type_erasure=True
boost:without_wave=True
)
set(CONAN_PACKAGES fmt/6.1.2 zlib/1.2.11 boost/1.75.0 gsl-lite/0.37.0 elfio/3.8 tcc/0.9.27)
set(CONAN_SETTINGS fmt:header_only=True ${CONAN_BOOST_OPTIONS})
if(NOT DEFINED ENV{SYSTEMC_HOME})
set(CONAN_PACKAGES ${CONAN_PACKAGES}
systemc/2.3.3
systemc-cci/1.0.0
)
set(CONAN_SETTINGS ${CONAN_SETTINGS}
#systemc:phase_cb=False
systemc-cci:shared=False
)
endif()
conan_check()
conan_add_remote(NAME minres URL https://artifactory.minres.com/artifactory/api/conan/oss)
conan_cmake_configure(REQUIRES ${CONAN_PACKAGES}
GENERATORS cmake_find_package
OPTIONS ${CONAN_SETTINGS}
)
conan_install()
find_package(tcc)
find_package(elfio)
find_package(fmt)
find_package(gsl-lite)
# This line finds the boost lib and headers. # This line finds the boost lib and headers.
set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install. set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install.
@ -55,6 +108,10 @@ if (ENABLE_CLANG_TIDY)
endif() endif()
endif() endif()
include(CodeGen)
gen_coredsl(${CORE_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/tgfs/gen_input/${CORE_NAME}.core_desc interp)
add_subdirectory(dbt-core) add_subdirectory(dbt-core)
add_subdirectory(scc) add_subdirectory(scc)
add_subdirectory(tgfs) add_subdirectory(tgfs)

33
Modulefile Normal file
View File

@ -0,0 +1,33 @@
#%Module######################################################################
##
## Project Module
##
proc ModulesHelp { } {
puts stderr "\tThe TGFS-ISS Project Module\n"
puts stderr "\tThis module loads PATHs and variables for accessing Verilator."
}
set distro [exec /bin/lsb_release -i -s]
if { $distro == "CentOS" && ![info exists ::env(PROJECT)] && ![info exists ::env(PCP_DIR)] } {
puts stderr "Don't forget to execute 'scl enable devtoolset-7 bash'"
}
if {![info exists ::env(PROJECT)] && [file exists $::env(HOME)/.sdkman/candidates/java/11.0.9.hs-adpt/] != 1} {
puts stderr "Please install java via 'sdk install java 11.0.9.hs-adpt'!"
prereq java/11.0.9
} else {
prepend-path PATH $::env(HOME)/.sdkman/candidates/java/11.0.9.hs-adpt/bin
}
if {![info exists ::env(PROJECT)] && [file exists $::env(HOME)/.sdkman/candidates/maven/3.6.3] != 1} {
puts stderr "Please install mvn via 'sdk install maven 3.6.3'!"
prereq maven/3.6.3
} else {
prepend-path PATH $::env(HOME)/.sdkman/candidates/sbt/1.4.4/bin
}
module load tools/cmake tools/gcc-riscv64/9.2.0
setenv PROJECT TGFS-ISS

113
cmake/CodeGen.cmake Normal file
View File

@ -0,0 +1,113 @@
cmake_minimum_required(VERSION 3.16)
option(ENABLE_CODEGEN "Enable code generation for supported cores" ON)
set(ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
set(DBT_CORE_TGC_DIR ${ROOT_DIR}/tgfs)
#helper to setup code generation and generate outputs
set(GENERATOR_JAR ${ROOT_DIR}/coredsl/com.minres.coredsl.generator.repository/target/com.minres.coredsl.generator-2.0.0-SNAPSHOT.jar)
if(EXISTS ${ROOT_DIR}/coredsl/pom.xml AND NOT EXISTS ${GENERATOR_JAR})
execute_process(
COMMAND mvn package
WORKING_DIRECTORY ${ROOT_DIR}/coredsl
OUTPUT_VARIABLE StdOut
ERROR_VARIABLE StdErr
RESULT_VARIABLE Status
ERROR_QUIET)
if(Status AND NOT Status EQUAL 0)
message(STATUS "mvn package call failed: ${Status}, ${StdOut}, ${StdErr}")
endif()
endif()
set(JAVA_OPTS --add-modules ALL-SYSTEM --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.annotation=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
--add-opens=java.base/java.lang.module=ALL-UNNAMED --add-opens=java.base/java.lang.ref=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.math=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.net.spi=ALL-UNNAMED
--add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.channels=ALL-UNNAMED
--add-opens=java.base/java.nio.channels.spi=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED
--add-opens=java.base/java.nio.charset.spi=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED
--add-opens=java.base/java.nio.file.attribute=ALL-UNNAMED --add-opens=java.base/java.nio.file.spi=ALL-UNNAMED
--add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.security.acl=ALL-UNNAMED
--add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.security.interfaces=ALL-UNNAMED
--add-opens=java.base/java.security.spec=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED
--add-opens=java.base/java.text.spi=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED
--add-opens=java.base/java.time.chrono=ALL-UNNAMED --add-opens=java.base/java.time.format=ALL-UNNAMED
--add-opens=java.base/java.time.temporal=ALL-UNNAMED --add-opens=java.base/java.time.zone=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED
--add-opens=java.base/java.util.function=ALL-UNNAMED --add-opens=java.base/java.util.jar=ALL-UNNAMED
--add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.util.spi=ALL-UNNAMED
--add-opens=java.base/java.util.stream=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED
--add-opens=java.datatransfer/java.awt.datatransfer=ALL-UNNAMED --add-opens=java.desktop/java.applet=ALL-UNNAMED
--add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/java.awt.color=ALL-UNNAMED
--add-opens=java.desktop/java.awt.desktop=ALL-UNNAMED --add-opens=java.desktop/java.awt.dnd=ALL-UNNAMED
--add-opens=java.desktop/java.awt.dnd.peer=ALL-UNNAMED --add-opens=java.desktop/java.awt.event=ALL-UNNAMED
--add-opens=java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.desktop/java.awt.geom=ALL-UNNAMED
--add-opens=java.desktop/java.awt.im=ALL-UNNAMED --add-opens=java.desktop/java.awt.im.spi=ALL-UNNAMED
--add-opens=java.desktop/java.awt.image=ALL-UNNAMED --add-opens=java.desktop/java.awt.image.renderable=ALL-UNNAMED
--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED --add-opens=java.desktop/java.awt.print=ALL-UNNAMED
--add-opens=java.desktop/java.beans=ALL-UNNAMED --add-opens=java.desktop/java.beans.beancontext=ALL-UNNAMED
--add-opens=java.instrument/java.lang.instrument=ALL-UNNAMED --add-opens=java.logging/java.util.logging=ALL-UNNAMED
--add-opens=java.management/java.lang.management=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED
--add-opens=java.rmi/java.rmi=ALL-UNNAMED --add-opens=java.rmi/java.rmi.activation=ALL-UNNAMED
--add-opens=java.rmi/java.rmi.dgc=ALL-UNNAMED --add-opens=java.rmi/java.rmi.registry=ALL-UNNAMED
--add-opens=java.rmi/java.rmi.server=ALL-UNNAMED --add-opens=java.sql/java.sql=ALL-UNNAMED)
set(GENERATOR java ${JAVA_OPTS} -jar ${GENERATOR_JAR})
set(INPUT_DIR ${DBT_CORE_TGC_DIR}/gen_input)
set(REPO_DIR ${DBT_CORE_TGC_DIR}/gen_input/CoreDSL-Instruction-Set-Description)
set(TMPL_DIR ${DBT_CORE_TGC_DIR}/gen_input/templates/)
if(ENABLE_CODEGEN AND EXISTS ${GENERATOR_JAR})
macro(gen_coredsl CORE_NAME INPUT_FILE BACKEND)
message(STATUS "Adding generation steps for ${CORE_NAME} in ${DBT_CORE_TGC_DIR} for ${BACKEND}")
string(TOUPPER ${BACKEND} BE_UPPER)
string(TOLOWER ${CORE_NAME} CORE_NAMEL)
if(EXISTS ${DBT_CORE_TGC_DIR}/generate.sh AND NOT EXISTS ${DBT_CORE_TGC_DIR}/incl/iss/arch/${CORE_NAMEL}.h)
# make sure source file exist initially
execute_process(
COMMAND /bin/bash ${DBT_CORE_TGC_DIR}/../generate.sh -c $CORE_NAME -b $BACKEND
WORKING_DIRECTORY ${DBT_CORE_TGC_DIR}/..
RESULT_VARIABLE return_code)
endif()
list(APPEND ${CORE_NAME}_MAPPING -m "${TMPL_DIR}/CORENAME.h.gtl:${DBT_CORE_TGC_DIR}/incl/iss/arch/${CORE_NAMEL}.h")
list(APPEND ${CORE_NAME}_MAPPING -m "${TMPL_DIR}/CORENAME.cpp.gtl:${DBT_CORE_TGC_DIR}/src/iss/${CORE_NAMEL}.cpp")
list(APPEND ${CORE_NAME}_MAPPING -m "${TMPL_DIR}/${BACKEND}/CORENAME.cpp.gtl:${DBT_CORE_TGC_DIR}/src/vm/interp/vm_${CORE_NAMEL}.cpp")
list(APPEND ${CORE_NAME}_MAPPING -m "${TMPL_DIR}/CORENAME_instr.yaml.gtl:${DBT_CORE_TGC_DIR}/${CORE_NAME}_instr.yaml")
set(${CORE_NAME}_OUTPUT_FILES ${DBT_CORE_TGC_DIR}/incl/iss/arch/${CORE_NAMEL}.h ${DBT_CORE_TGC_DIR}/src/iss/${CORE_NAMEL}.cpp ${DBT_CORE_TGC_DIR}/src/vm/interp/vm_${CORE_NAMEL}.cpp)
#add_custom_command(
# COMMAND ${GENERATOR} -b ${BE_UPPER} -c ${CORE_NAME} -r ${REPO_DIR} ${${CORE_NAME}_MAPPING} ${INPUT_FILE}
# DEPENDS ${GENERATOR_JAR} ${INPUT_FILE} ${TMPL_DIR}/CORENAME.h.gtl ${TMPL_DIR}/CORENAME.cpp.gtl ${TMPL_DIR}/${BACKEND}/CORENAME.cpp.gtl
# OUTPUT ${${CORE_NAME}_OUTPUT_FILES}
# COMMENT "Generating code for ${CORE_NAME}."
# USES_TERMINAL VERBATIM
#)
if(NOT DEFINED ENV{CI})
add_custom_target(${CORE_NAME}_cpp
COMMAND ${GENERATOR} -b ${BE_UPPER} -c ${CORE_NAME} -r ${REPO_DIR} ${${CORE_NAME}_MAPPING} ${INPUT_FILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMENT "Generating ISS sources"
BYPRODUCTS ${${CORE_NAME}_OUTPUT_FILES}
USES_TERMINAL
)
endif()
execute_process(
COMMAND ${GENERATOR} -b ${BE_UPPER} -c ${CORE_NAME} -r ${REPO_DIR} ${${CORE_NAME}_MAPPING} ${INPUT_FILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
RESULT_VARIABLE return_code)
endmacro()
else()
macro(gen_coredsl CORE_NAME INPUT_FILE BACKEND)
add_custom_target(${CORE_NAME}_cpp)
message(STATUS "Not adding generation steps for ${CORE_NAME}(${ENABLE_CODEGEN}, ${GENERATOR_JAR})")
if(NOT EXISTS ${GENERATOR_JAR})
message(STATUS "CoreDSL Generator ${GENERATOR_JAR} does not exists")
endif()
endmacro()
endif()

View File

@ -1,26 +0,0 @@
[requires]
gsl_microsoft/20180102@bincrafters/stable
fmt/6.1.2
# SystemC/2.3.3@minres/stable
# SystemCVerification/2.0.1@minres/stable
# SystemC-CCI/1.0.0@minres/stable
tcc/0.9.27@minres/stable
boost/1.71.0@conan/stable
zlib/1.2.11
elfio/3.4@minres/stable
[generators]
cmake
[options]
seasocks:shared=True
boost:fPIC=True
boost:shared=False
boost:header_only=False
fmt:header_only=True
# SystemC:stdcxx=11
# SystemC:shared=True
# SystemCVerification:stdcxx=11
# SystemCVerification:shared=True
# SystemC-CCI:stdcxx=11
# SystemC-CCI:shared=True

1
coredsl Submodule

@ -0,0 +1 @@
Subproject commit 2258a1cb004ddaaa839978b7044963355ad83bfb

@ -1 +1 @@
Subproject commit d87dfff430e9ff3d394327bbf649a9f1bb05e396 Subproject commit d64b1986626fd927f0b2a5e787f8941d6dd6aecd

60
generate.sh Normal file
View File

@ -0,0 +1,60 @@
#!/bin/bash
##
# Absolute path to this script, e.g. /home/user/bin/foo.sh
SCRIPT=`readlink -f "$0"`
# Absolute path this script is in, thus /home/user/bin
SCRIPTDIR=`dirname "$SCRIPT"`
SCRIPTNAME=`basename "$SCRIPT"`
function print_help {
echo "Usage: $SCRIPTNAME [-h] -c <core name> -v <core variant> <input file>"
echo "Generate ISS sources for TGC cores"
echo " -c <name> core name"
echo " -b <backend> ISS backend for which sources are generated, interp,tcc, or llvm"
exit 0
}
CORE_NAME=
BACKEND=
while getopts 'c:b:h' c
do
case $c in
c) CORE_NAME=$OPTARG ;;
b) BACKEND=$OPTARG ;;
h) print_help ;;
esac
done
shift $((OPTIND-1))
if [ -z "$CORE_NAME" ]; then
echo "core name missing!"
exit 1
fi
if [ -z "$BACKEND" ]; then
echo "core variant missing!"
exit 1
fi
JAVA_OPTS="--add-modules ALL-SYSTEM --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.annotation=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.module=ALL-UNNAMED --add-opens=java.base/java.lang.ref=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.math=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.net.spi=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.channels=ALL-UNNAMED --add-opens=java.base/java.nio.channels.spi=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.nio.charset.spi=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/java.nio.file.attribute=ALL-UNNAMED --add-opens=java.base/java.nio.file.spi=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.security.acl=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.security.interfaces=ALL-UNNAMED --add-opens=java.base/java.security.spec=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.text.spi=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.time.chrono=ALL-UNNAMED --add-opens=java.base/java.time.format=ALL-UNNAMED --add-opens=java.base/java.time.temporal=ALL-UNNAMED --add-opens=java.base/java.time.zone=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED --add-opens=java.base/java.util.function=ALL-UNNAMED --add-opens=java.base/java.util.jar=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.util.spi=ALL-UNNAMED --add-opens=java.base/java.util.stream=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.datatransfer/java.awt.datatransfer=ALL-UNNAMED --add-opens=java.desktop/java.applet=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/java.awt.color=ALL-UNNAMED --add-opens=java.desktop/java.awt.desktop=ALL-UNNAMED --add-opens=java.desktop/java.awt.dnd=ALL-UNNAMED --add-opens=java.desktop/java.awt.dnd.peer=ALL-UNNAMED --add-opens=java.desktop/java.awt.event=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.desktop/java.awt.geom=ALL-UNNAMED --add-opens=java.desktop/java.awt.im=ALL-UNNAMED --add-opens=java.desktop/java.awt.im.spi=ALL-UNNAMED --add-opens=java.desktop/java.awt.image=ALL-UNNAMED --add-opens=java.desktop/java.awt.image.renderable=ALL-UNNAMED --add-opens=java.desktop/java.awt.peer=ALL-UNNAMED --add-opens=java.desktop/java.awt.print=ALL-UNNAMED --add-opens=java.desktop/java.beans=ALL-UNNAMED --add-opens=java.desktop/java.beans.beancontext=ALL-UNNAMED --add-opens=java.instrument/java.lang.instrument=ALL-UNNAMED --add-opens=java.logging/java.util.logging=ALL-UNNAMED --add-opens=java.management/java.lang.management=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.rmi/java.rmi=ALL-UNNAMED --add-opens=java.rmi/java.rmi.activation=ALL-UNNAMED --add-opens=java.rmi/java.rmi.dgc=ALL-UNNAMED --add-opens=java.rmi/java.rmi.registry=ALL-UNNAMED --add-opens=java.rmi/java.rmi.server=ALL-UNNAMED --add-opens=java.sql/java.sql=ALL-UNNAMED"
GENERATOR="java $JAVA_OPTS -jar coredsl/com.minres.coredsl.generator.repository/target/com.minres.coredsl.generator-2.0.0-SNAPSHOT.jar "
INPUT_FILE=$1
REPO_DIR=tgfs/gen_input/CoreDSL-Instruction-Set-Description
TMPL_DIR=tgfs/gen_input/templates
CORE_NAME_LC=`echo "$CORE_NAME" | tr '[:upper:]' '[:lower:]'`
MAPPING=""
MAPPING="$MAPPING -m ${TMPL_DIR}/CORENAME.h.gtl:tgfs/incl/iss/arch/${CORE_NAME_LC}.h"
MAPPING="$MAPPING -m ${TMPL_DIR}/CORENAME.cpp.gtl:tgfs/src/iss/${CORE_NAME_LC}.cpp"
MAPPING="$MAPPING -m ${TMPL_DIR}/${BACKEND}/CORENAME.cpp.gtl:tgfs/src/vm/${BACKEND}/vm_${CORE_NAME_LC}.cpp"
MAPPING="$MAPPING -m ${TMPL_DIR}/CORENAME_instr.yaml.gtl:tgfs/${CORE_NAME_LC}_instr.yaml"
[ -f coredsl/com.minres.coredsl.generator.repository/target/com.minres.coredsl.generator-2.0.0-SNAPSHOT.jar ] || (cd coredsl; mvn package)
$GENERATOR -c $CORE_NAME -r $REPO_DIR $MAPPING $INPUT_FILE

2
scc

@ -1 +1 @@
Subproject commit d0f2f5599787149be8dbd1e17f5aa6caaa2e3140 Subproject commit 7b2017a21dec666b1fb14650b3147fa11208c886

2
tgfs

@ -1 +1 @@
Subproject commit d43b35949e60c45e45ec43af1977478d0f93869d Subproject commit d5fa47ef7f9395ae202442535624d99b58e290be