From c5b6eaecea5ca8ea766df74ab34c37584f686212 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 2 Mar 2023 10:59:49 +0100 Subject: [PATCH] fixes generator script --- tgc-iss/generate.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tgc-iss/generate.sh b/tgc-iss/generate.sh index d735c0c..b9bfb77 100644 --- a/tgc-iss/generate.sh +++ b/tgc-iss/generate.sh @@ -1,10 +1,17 @@ #!/bin/bash ## - +if [ -z "${GENERATOR_HOME}" ]; then + if [ -z "${GENERATOR_HOME}" ]; then + echo "Please define GENERATOR_HOME to point to your CoreDSL source or GENERATOR_LOC to pint to your directory containing the jar" + exit 1 + else + export GENERATOR_LOC=${GENERATOR_HOME}/com.minres.coredsl.generator.repository/target + fi +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 /scratch/eyck/workarea/RISC-V/TGFS-VERIF/tgfs_iss/coredsl/com.minres.coredsl.generator.repository/target/com.minres.coredsl.generator-2.0.0-SNAPSHOT.jar " +GENERATOR="java $JAVA_OPTS -jar ${GENERATOR_LOC}/com.minres.coredsl.generator-2.0.0-SNAPSHOT.jar " CORE_NAME=$1 BACKEND=$2 @@ -15,11 +22,11 @@ REPO_DIR=dbt-rise-tgc/gen_input/CoreDSL-Instruction-Set-Description TMPL_DIR=dbt-rise-tgc/gen_input/templates MAPPING="" -MAPPING="$MAPPING -m ${TMPL_DIR}/CORENAME.h.gtl:dbt-rise-tgc/incl/iss/arch/${CORE_NAME_LC}.h" -MAPPING="$MAPPING -m ${TMPL_DIR}/CORENAME.cpp.gtl:dbt-rise-tgc/src/iss/${CORE_NAME_LC}.cpp" -MAPPING="$MAPPING -m ${TMPL_DIR}/${BACKEND}/CORENAME.cpp.gtl:dbt-rise-tgc/src/vm/${BACKEND}/vm_${CORE_NAME_LC}.cpp" +MAPPING="$MAPPING -m ${TMPL_DIR}/CORENAME.h.gtl:dbt-rise-tgc/src-gen/iss/arch/${CORE_NAME_LC}.h" +MAPPING="$MAPPING -m ${TMPL_DIR}/CORENAME.cpp.gtl:dbt-rise-tgc/src-gen/iss/arch/${CORE_NAME_LC}.cpp" +MAPPING="$MAPPING -m ${TMPL_DIR}/${BACKEND}/CORENAME.cpp.gtl:dbt-rise-tgc/src-gen/vm/${BACKEND}/vm_${CORE_NAME_LC}.cpp" -[ -f /scratch/eyck/workarea/RISC-V/TGFS-VERIF/tgfs_iss/coredsl/com.minres.coredsl.generator.repository/target/com.minres.coredsl.generator-2.0.0-SNAPSHOT.jar ] || (cd /scratch/eyck/workarea/RISC-V/TGFS-VERIF/tgfs_iss/coredsl; mvn package) +[ -f ${GENERATOR_LOC}/com.minres.coredsl.generator-2.0.0-SNAPSHOT.jar ] || (cd ${GENERATOR_HOME}; mvn package) $GENERATOR -c $CORE_NAME -r $REPO_DIR $MAPPING $INPUT_FILE