diff --git a/primitives/float/get_hardfloat.sh b/primitives/float/get_hardfloat.sh index 4742bf8ce..4e2d14dd5 100755 --- a/primitives/float/get_hardfloat.sh +++ b/primitives/float/get_hardfloat.sh @@ -1,22 +1,19 @@ #!/bin/bash -HARDFLOAT_DIR="$PWD" +HARDFLOAT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" HARDFLOAT_URL="http://www.jhauser.us/arithmetic/HardFloat-1.zip" ZIP_FILE="HardFloat-1.zip" -rm -rf "${HARDFLOAT_DIR}/HardFloat-1" - -mkdir -p "${HARDFLOAT_DIR}" - cd "${HARDFLOAT_DIR}" curl -LO "${HARDFLOAT_URL}" if [ -f "$ZIP_FILE" ]; then - unzip "$ZIP_FILE" && rm "$ZIP_FILE" + unzip -o "$ZIP_FILE" echo "HardFloat library fetched and extracted to ${HARDFLOAT_DIR}" else echo "Failed to download HardFloat library from ${HARDFLOAT_URL}" + exit 1 fi diff --git a/runt.toml b/runt.toml index 013d4576e..78b5e5462 100644 --- a/runt.toml +++ b/runt.toml @@ -562,15 +562,16 @@ fud exec -s calyx.exec './target/debug/calyx' \ name = "correctness HardFloat floating point" paths = ["tests/correctness/hardfloat/*.futil"] cmd = """ -cd primitives/float && ./get_hardfloat.sh > /dev/null 2>&1 && cd ../../ && +if [ ! -d "primitives/float/HardFloat-1" ]; then + bash primitives/float/get_hardfloat.sh > /dev/null 2>&1 +fi && fud exec --from calyx --to jq \ --through verilog \ --through dat \ -s verilog.data {}.data \ -s calyx.exec './target/debug/calyx' \ -s verilog.cycle_limit 500 \ - {} -q && -rm -rf primitives/float/HardFloat-1/ + {} -q """ expect_dir = "tests/correctness/hardfloat/" timeout = 30