From b8cfc0525e082d74870e6e6221f16244322e488a Mon Sep 17 00:00:00 2001 From: Blaise Tine Date: Thu, 23 Sep 2021 03:56:36 -0400 Subject: [PATCH] minor update --- simX/decode.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/simX/decode.cpp b/simX/decode.cpp index ad111846..11b8e92d 100644 --- a/simX/decode.cpp +++ b/simX/decode.cpp @@ -294,7 +294,13 @@ std::shared_ptr Decoder::decode(Word code) { int rs2 = (code >> shift_rs2_) & reg_mask_; int rs3 = (code >> shift_rs3_) & reg_mask_; - auto iType = sc_instTable.at(op).iType; + auto op_it = sc_instTable.find(op); + if (op_it == sc_instTable.end()) { + std::cout << std::hex << "invalid opcode: 0x" << op << ", instruction=0x" << code << std::endl; + std::abort(); + } + + auto iType = op_it->second.iType; if (op == Opcode::FL || op == Opcode::FS) { if (func3 != 0x2) { iType = InstType::V_TYPE;