Compare commits
3 Commits
0b5de90fb1
...
15cd36dcd4
Author | SHA1 | Date | |
---|---|---|---|
15cd36dcd4 | |||
2281ec4144 | |||
11c481cec2 |
@ -207,7 +207,7 @@ private:
|
|||||||
${it}<%}%>
|
${it}<%}%>
|
||||||
}
|
}
|
||||||
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
auto cur_pc_val = tu.constant(pc.val, traits::reg_bit_widths[traits::PC]);
|
||||||
pc=pc+4;
|
pc=pc+ ${instr.length/8};
|
||||||
gen_set_pc(tu, pc, traits::NEXT_PC);
|
gen_set_pc(tu, pc, traits::NEXT_PC);
|
||||||
tu.open_scope();<%instr.behavior.eachLine{%>
|
tu.open_scope();<%instr.behavior.eachLine{%>
|
||||||
${it}<%}%>
|
${it}<%}%>
|
||||||
|
@ -619,9 +619,9 @@ template <typename BASE, features_e FEAT> std::pair<uint64_t, bool> riscv_hart_m
|
|||||||
}
|
}
|
||||||
return std::make_pair(entry, true);
|
return std::make_pair(entry, true);
|
||||||
}
|
}
|
||||||
throw std::runtime_error("memory load file is not a valid elf file");
|
throw std::runtime_error(fmt::format("memory load file {} is not a valid elf file",name));
|
||||||
}
|
}
|
||||||
throw std::runtime_error("memory load file not found");
|
throw std::runtime_error(fmt::format("memory load file not found, check if {} is a valid file", name));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename BASE, features_e FEAT>
|
template<typename BASE, features_e FEAT>
|
||||||
|
@ -583,9 +583,9 @@ template <typename BASE> std::pair<uint64_t, bool> riscv_hart_msu_vp<BASE>::load
|
|||||||
}
|
}
|
||||||
return std::make_pair(entry, true);
|
return std::make_pair(entry, true);
|
||||||
}
|
}
|
||||||
throw std::runtime_error("memory load file is not a valid elf file");
|
throw std::runtime_error(fmt::format("memory load file {} is not a valid elf file",name));
|
||||||
}
|
}
|
||||||
throw std::runtime_error("memory load file not found");
|
throw std::runtime_error(fmt::format("memory load file not found, check if {} is a valid file", name));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename BASE>
|
template <typename BASE>
|
||||||
|
@ -689,9 +689,9 @@ template <typename BASE, features_e FEAT> std::pair<uint64_t, bool> riscv_hart_m
|
|||||||
}
|
}
|
||||||
return std::make_pair(entry, true);
|
return std::make_pair(entry, true);
|
||||||
}
|
}
|
||||||
throw std::runtime_error("memory load file is not a valid elf file");
|
throw std::runtime_error(fmt::format("memory load file {} is not a valid elf file",name));
|
||||||
}
|
}
|
||||||
throw std::runtime_error("memory load file not found");
|
throw std::runtime_error(fmt::format("memory load file not found, check if {} is a valid file", name));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename BASE, features_e FEAT>
|
template<typename BASE, features_e FEAT>
|
||||||
|
@ -53,7 +53,7 @@ template <> struct traits<tgc_c> {
|
|||||||
static constexpr std::array<const char*, 36> reg_aliases{
|
static constexpr std::array<const char*, 36> reg_aliases{
|
||||||
{"ZERO", "RA", "SP", "GP", "TP", "T0", "T1", "T2", "S0", "S1", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S10", "S11", "T3", "T4", "T5", "T6", "PC", "NEXT_PC", "PRIV", "DPC"}};
|
{"ZERO", "RA", "SP", "GP", "TP", "T0", "T1", "T2", "S0", "S1", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S10", "S11", "T3", "T4", "T5", "T6", "PC", "NEXT_PC", "PRIV", "DPC"}};
|
||||||
|
|
||||||
enum constants {MISA_VAL=0b01000000000000000001000100000100, MARCHID_VAL=0x80000003, XLEN=32, INSTR_ALIGNMENT=2, RFS=32, fence=0, fencei=1, fencevmal=2, fencevmau=3, CSR_SIZE=4096, MUL_LEN=64};
|
enum constants {MISA_VAL=0b01000000000000000001000100000100, MARCHID_VAL=0x80000003, PGMASK=0b111111111111, XLEN=32, INSTR_ALIGNMENT=2, RFS=32, fence=0, fencei=1, fencevmal=2, fencevmau=3, CSR_SIZE=4096, MUL_LEN=64};
|
||||||
|
|
||||||
constexpr static unsigned FP_REGS_SIZE = 0;
|
constexpr static unsigned FP_REGS_SIZE = 0;
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ public:
|
|||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << "[p:" << lvl[this->reg.PRIV] << ";s:0x" << std::hex << std::setfill('0')
|
s << "[p:" << lvl[this->reg.PRIV] << ";s:0x" << std::hex << std::setfill('0')
|
||||||
<< std::setw(sizeof(reg_t) * 2) << (reg_t)this->state.mstatus << std::dec << ";c:"
|
<< std::setw(sizeof(reg_t) * 2) << (reg_t)this->state.mstatus << std::dec << ";c:"
|
||||||
<< this->icount + this->cycle_offset << "]";
|
<< this->reg.icount + this->cycle_offset << "]";
|
||||||
SCCDEBUG(owner->name())<<"disass: "
|
SCCDEBUG(owner->name())<<"disass: "
|
||||||
<< "0x" << std::setw(16) << std::right << std::setfill('0') << std::hex << pc << "\t\t" << std::setw(40)
|
<< "0x" << std::setw(16) << std::right << std::setfill('0') << std::hex << pc << "\t\t" << std::setw(40)
|
||||||
<< std::setfill(' ') << std::left << instr << s.str();
|
<< std::setfill(' ') << std::left << instr << s.str();
|
||||||
@ -178,7 +178,7 @@ public:
|
|||||||
|
|
||||||
void wait_until(uint64_t flags) override {
|
void wait_until(uint64_t flags) override {
|
||||||
SCCDEBUG(owner->name()) << "Sleeping until interrupt";
|
SCCDEBUG(owner->name()) << "Sleeping until interrupt";
|
||||||
while(this->pending_trap == 0 && (this->csr[arch::mip] & this->csr[arch::mie]) == 0) {
|
while(this->reg.pending_trap == 0 && (this->csr[arch::mip] & this->csr[arch::mie]) == 0) {
|
||||||
sc_core::wait(wfi_evt);
|
sc_core::wait(wfi_evt);
|
||||||
}
|
}
|
||||||
PLAT::wait_until(flags);
|
PLAT::wait_until(flags);
|
||||||
@ -207,7 +207,7 @@ public:
|
|||||||
this->csr[arch::mip] &= ~mask;
|
this->csr[arch::mip] &= ~mask;
|
||||||
this->check_interrupt();
|
this->check_interrupt();
|
||||||
if(value)
|
if(value)
|
||||||
SCCTRACE(owner->name()) << "Triggering interrupt " << id << " Pending trap: " << this->pending_trap;
|
SCCTRACE(owner->name()) << "Triggering interrupt " << id << " Pending trap: " << this->reg.pending_trap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user