From 615060bc4017a3db864568ee3bb7bfb3ec18d2e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 3 Jan 2018 18:01:03 +0100 Subject: Add pipelined and no-delay-slot for qtmips_cli --- qtmips_cli/main.cpp | 5 ++++- tests/cpu_trap/test.sh | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/qtmips_cli/main.cpp b/qtmips_cli/main.cpp index 4fd6ce5..57187ce 100644 --- a/qtmips_cli/main.cpp +++ b/qtmips_cli/main.cpp @@ -16,6 +16,8 @@ void create_parser(QCommandLineParser &p) { p.addPositionalArgument("FILE", "Input ELF executable file"); p.addOptions({ + {"pipelined", "Configure CPU to use five stage pipeline."}, + {"no-delay-slot", "Disable jump delay slot."}, {{"trace-fetch", "tr-fetch"}, "Trace fetched instruction."}, {{"trace-pc", "tr-pc"}, "Print program counter register changes."}, {{"trace-gp", "tr-gp"}, "Print general purpose register changes. You can use * for all registers.", "REG"}, @@ -35,7 +37,8 @@ void configure_machine(QCommandLineParser &p, MachineConfig &cc) { } cc.set_elf(pa[0]); - // TODO + cc.set_delay_slot(!p.isSet("no-delay-slot")); + cc.set_pipelined(p.isSet("pipelined")); } void configure_tracer(QCommandLineParser &p, Tracer &tr) { diff --git a/tests/cpu_trap/test.sh b/tests/cpu_trap/test.sh index 430af14..d2ab99c 100755 --- a/tests/cpu_trap/test.sh +++ b/tests/cpu_trap/test.sh @@ -12,3 +12,4 @@ mips_make_test # Run test qtmips_run qtmips_cli/qtmips_cli --fail-match O "$TEST_DIR/cpu_trap" +qtmips_run qtmips_cli/qtmips_cli --pipelined --fail-match O "$TEST_DIR/cpu_trap" -- cgit v1.2.3