Skip to content
Snippets Groups Projects
Commit 26d2cc19 authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[Util] add helper function to get FINN root

parent 135f22a6
No related branches found
No related tags found
No related merge requests found
......@@ -97,5 +97,6 @@ docker run -t --rm --name $DOCKER_INST_NAME -it \
-v $VIVADO_PATH:$VIVADO_PATH \
-e VIVADO_PATH=$VIVADO_PATH \
-e FINN_INST_NAME=$DOCKER_INST_NAME \
-e FINN_ROOT="/workspace/finn" \
-p $JUPYTER_PORT:$JUPYTER_PORT \
$DOCKER_TAG bash -c "$DOCKER_CMD"
......@@ -10,6 +10,19 @@ import onnx
from finn.core.datatype import DataType
def get_finn_root():
"Return the root directory that FINN is cloned into."
try:
return os.environ["FINN_ROOT"]
except KeyError:
raise Exception(
"""Environment variable FINN_ROOT must be set
correctly. Please ensure you have launched the Docker contaier correctly.
"""
)
def make_build_dir(prefix=""):
"""Creates a temporary folder with given prefix to be used as a build dir.
Use this function instead of tempfile.mkdtemp to ensure any generated files
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment