Remove requirement for a RISC-V toolchain for build RISC-V tests
The tests have transitioned to only use the internal assembler, so there is no need to keep this requirement. We might revert on this in the future, if we add C-language tests.
MODIFY
test/CMakeLists.txt
test/CMakeLists.txt
@@ -14,32 +14,6 @@ macro(create_qtest name)
target_link_libraries(${name} ripes_lib)
endmacro()
-# =============================================================================
-# RISC-V Tests
-# =============================================================================
-option(RIPES_ENABLE_RISCV_TESTS "Enable RISC-V unit tests" OFF)
-if(RIPES_ENABLE_RISCV_TESTS)
- message(STATUS "RISC-V Tests enabled")
- message(STATUS "Locating required toolchain tools...")
- list (APPEND RV_TOOLS
- riscv64-unknown-elf-as
- riscv64-unknown-elf-objdump
- riscv64-unknown-elf-gcc
- )
-
- foreach(tool ${RV_TOOLS})
- # Ensure required RISC-V toolchain tools are available
- unset(RV_TOOL CACHE)
- find_program(RV_TOOL ${tool})
- if(NOT RV_TOOL)
- message(FATAL_ERROR "'${tool}' not found! A RISC-V toolchain must be available to build and run the RISC-V tests.")
- endif()
- message(STATUS "Found tool '${RV_TOOL}'")
- endforeach()
-
create_qtest(tst_riscv)
- message(STATUS "RISC-V tests configured successfully")
-endif()
-
create_qtest(tst_assembler)
create_qtest(tst_expreval)

MODIFY
test/tst_riscv.cpp
test/tst_riscv.cpp
@@ -28,9 +28,6 @@ using RVISA = ISAInfo<ISA::RV32I>;
// Compilation tools & directories
const QString s_testdir = VSRTL_RISCV_TEST_DIR;
const QString s_outdir = s_testdir + QDir::separator() + "build";
-const QString s_assembler = "riscv64-unknown-elf-as";
-const QString s_objcopy = "riscv64-unknown-elf-objcopy";
-const QString s_linkerScript = "rvtest.ld";
// Ecall status codes
static constexpr unsigned s_success = 42;
@@ -46,25 +43,6 @@ static constexpr unsigned s_maxCycles = 10000;
// Tests which contains instructions or assembler directives not yet supported
const auto s_excludedTests = {"f", "ldst", "move", "recoding", /* fails on CI, unknown as of know */ "memory"};
-QString compileTestFile(const QString& testfile) {
- QProcess exec;
-
- const QString outElf = s_outdir + QDir::separator() + testfile + ".out";
- const QString outBin = s_outdir + QDir::separator() + testfile + ".bin";
-
- if (!QDir(s_outdir).exists()) {
- QDir().mkdir(s_outdir);
- }
-
- // Build
- bool error = exec.execute(s_assembler, {"-march=rv32im", s_testdir + QDir::separator() + testfile, "-o", outElf});
-
- // Extract .text segment
- error = exec.execute(s_objcopy, {"-O", "binary", "--only-section=.text", outElf, outBin});
-
- return error ? QString() : outBin;
-}
-
class tst_RISCV : public QObject {
Q_OBJECT

Remove requirement for a RISC-V toolchain for build RISC-V tests

The tests have transitioned to only use the internal assembler, so there is no need to keep this requirement. We might revert on this in the future, if we add C-language tests.