Skip to content

Commit

Permalink
Add first test case for bypass module(MIPT-ILab#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
bova-ev committed Apr 23, 2019
1 parent 2803ad1 commit 83357cc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions simulator/modules/decode/bypass/t/unit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,21 @@

#include "../data_bypass.h"
#include "../data_bypass_interface.h"

#include <mips/mips.h>
#include <mips/mips_instr.h>
#include <catch.hpp>

class MIPS32Instr : public BaseMIPSInstr<uint32>
{
public:
explicit MIPS32Instr( std::string_view str_opcode) : BaseMIPSInstr<uint32>( MIPSVersion::v32, str_opcode, Endian::little, 0x0000, 0xc000) { }
};

TEST_CASE( "Test test_case")
{
DataBypass<MIPS32Instr> db( 7);
MIPS32Instr load( "lw");
db.trace_new_instr( load);
CHECK( 1);
}

0 comments on commit 83357cc

Please sign in to comment.