Skip to content

Commit

Permalink
Fix A-ext failures due to switching to Sparta registers (#26)
Browse files Browse the repository at this point in the history
Co-authored-by: Colby Nyce <[email protected]>
  • Loading branch information
colby-nyce and cnyce authored Dec 12, 2024
1 parent 93bbfe9 commit 77f6d3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/inst_handlers/rv64/a/RvaInsts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ namespace atlas
ActionGroup* RvaInsts::sc_d_64_handler(atlas::AtlasState* state)
{
const AtlasInstPtr & inst = state->getCurrentInst();
const uint64_t rs2_val = inst->getRs2()->read();
const uint64_t rs2_val = inst->getRs2()->dmiRead<uint64_t>();
const uint64_t paddr = state->getTranslationState()->getTranslationResult().getPaddr();
state->writeMemory<uint64_t>(paddr, rs2_val);
return nullptr;
Expand All @@ -397,7 +397,7 @@ namespace atlas
ActionGroup* RvaInsts::sc_w_64_handler(atlas::AtlasState* state)
{
const AtlasInstPtr & inst = state->getCurrentInst();
const uint64_t rs2_val = inst->getRs2()->read();
const uint64_t rs2_val = inst->getRs2()->dmiRead<uint64_t>();
const uint64_t paddr = state->getTranslationState()->getTranslationResult().getPaddr();
state->writeMemory<uint32_t>(paddr, rs2_val);
return nullptr;
Expand Down
4 changes: 2 additions & 2 deletions core/inst_handlers/rv64/a/inst_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace atlas
static_assert(std::is_same<T, RV64>::value || std::is_same<T, RV32>::value);

const AtlasInstPtr & inst = state->getCurrentInst();
const T rs1_val = inst->getRs1()->read();
const T rs1_val = inst->getRs1()->dmiRead<uint64_t>();
constexpr uint32_t IMM_SIZE = 12;
const T imm = inst->hasImmediate() ? inst->getSignExtendedImmediate<T, IMM_SIZE>() : 0;
const T vaddr = rs1_val + imm;
Expand Down Expand Up @@ -48,7 +48,7 @@ namespace atlas
rd_val = state->readMemory<SIZE>(paddr);
}
inst->getRd()->write(rd_val);
const RV rs2_val = inst->getRs2()->read();
const RV rs2_val = inst->getRs2()->dmiRead<uint64_t>();
state->writeMemory<SIZE>(paddr, binary_op(rd_val, rs2_val));
return nullptr;
}
Expand Down

0 comments on commit 77f6d3b

Please sign in to comment.