reducing scope to vriable new_pc

This commit is contained in:
Màrius Montón 2021-11-26 01:21:31 +01:00
parent 175f01ac71
commit a3e98ecc7c
No known key found for this signature in database
GPG Key ID: FA199E7A752699F0
1 changed files with 2 additions and 2 deletions

View File

@ -277,13 +277,13 @@ bool BASE_ISA::Exec_BLTU() const {
bool BASE_ISA::Exec_BGEU() const {
int rs1, rs2;
int new_pc = 0;
rs1 = get_rs1();
rs2 = get_rs2();
if ( static_cast<std::uint32_t>(regs->getValue(rs1)) >= static_cast<std::uint32_t>(regs->getValue(rs2)) ) {
new_pc = static_cast<std::int32_t>(regs->getPC() + get_imm_B());
int new_pc;
new_pc = static_cast<std::int32_t>(regs->getPC() + get_imm_B());
logger->debug("{} ns. PC: 0x{:x}. BGEU: x{:d}(0x{:x}) > x{:d}(0x{:x}) -> PC (0x{:x})", sc_core::sc_time_stamp().value(), regs->getPC(),
rs1, regs->getValue(rs1), rs2, regs->getValue(rs2), new_pc);