From 83357cc3ef18823f5c93610cc8681a15a3d4980e Mon Sep 17 00:00:00 2001 From: Egor Bova Date: Tue, 23 Apr 2019 12:18:38 +0300 Subject: [PATCH] Add first test case for bypass module(MIPT-ILab#716) --- simulator/CMakeLists.txt | 1 + simulator/modules/decode/bypass/t/unit_test.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/simulator/CMakeLists.txt b/simulator/CMakeLists.txt index bb2c4ea1e..e49f66eae 100644 --- a/simulator/CMakeLists.txt +++ b/simulator/CMakeLists.txt @@ -76,6 +76,7 @@ set(TESTS_CPPS risc_v/riscv_register/t/unit_test.cpp risc_v/t/unit_test.cpp risc_v/t/riscv64_test.cpp + modules/decode/bypass/t/unit_test.cpp modules/fetch/bpu/t/unit_test.cpp func_sim/t/unit_test.cpp modules/core/t/unit_test.cpp diff --git a/simulator/modules/decode/bypass/t/unit_test.cpp b/simulator/modules/decode/bypass/t/unit_test.cpp index c9d414a85..a590562b2 100644 --- a/simulator/modules/decode/bypass/t/unit_test.cpp +++ b/simulator/modules/decode/bypass/t/unit_test.cpp @@ -6,5 +6,21 @@ #include "../data_bypass.h" #include "../data_bypass_interface.h" + +#include +#include #include +class MIPS32Instr : public BaseMIPSInstr +{ +public: + explicit MIPS32Instr( std::string_view str_opcode) : BaseMIPSInstr( MIPSVersion::v32, str_opcode, Endian::little, 0x0000, 0xc000) { } +}; + +TEST_CASE( "Test test_case") +{ + DataBypass db( 7); + MIPS32Instr load( "lw"); + db.trace_new_instr( load); + CHECK( 1); +} \ No newline at end of file