Compare commits
2 Commits
15cd36dcd4
...
0b5de90fb1
Author | SHA1 | Date | |
---|---|---|---|
0b5de90fb1 | |||
60d07f2eb6 |
@ -419,7 +419,7 @@ protected:
|
|||||||
std::vector<std::function<mem_write_f>> memfn_write;
|
std::vector<std::function<mem_write_f>> memfn_write;
|
||||||
void insert_mem_range(uint64_t, uint64_t, std::function<mem_read_f>, std::function<mem_write_f>);
|
void insert_mem_range(uint64_t, uint64_t, std::function<mem_read_f>, std::function<mem_write_f>);
|
||||||
feature_config cfg;
|
feature_config cfg;
|
||||||
unsigned mcause_max_irq{(FEAT&features_e::FEAT_CLIC)?4096:16};
|
uint64_t mcause_max_irq{(FEAT&features_e::FEAT_CLIC)?4096:16};
|
||||||
inline bool debug_mode_active() {return this->reg.PRIV&0x4;}
|
inline bool debug_mode_active() {return this->reg.PRIV&0x4;}
|
||||||
std::pair<std::function<mem_read_f>, std::function<mem_write_f>>
|
std::pair<std::function<mem_read_f>, std::function<mem_write_f>>
|
||||||
replace_mem_access(std::function<mem_read_f> rd, std::function<mem_write_f> wr){
|
replace_mem_access(std::function<mem_read_f> rd, std::function<mem_write_f> wr){
|
||||||
@ -966,12 +966,11 @@ template <typename BASE, features_e FEAT> iss::status riscv_hart_m_p<BASE, FEAT>
|
|||||||
val |= state.mstatus.MPIE<<27;
|
val |= state.mstatus.MPIE<<27;
|
||||||
val |= state.mstatus.MPP<<28;
|
val |= state.mstatus.MPP<<28;
|
||||||
} else
|
} else
|
||||||
val = csr[addr] & ((1UL<<(traits<BASE>::XLEN-1)) | (mcause_max_irq-1));
|
val = csr[addr]; // & ((1UL<<(traits<BASE>::XLEN-1)) | (mcause_max_irq-1));
|
||||||
return iss::Ok;
|
return iss::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename BASE, features_e FEAT> iss::status riscv_hart_m_p<BASE, FEAT>::write_cause(unsigned addr, reg_t val) {
|
template <typename BASE, features_e FEAT> iss::status riscv_hart_m_p<BASE, FEAT>::write_cause(unsigned addr, reg_t val) {
|
||||||
csr[addr] = val & ((1UL<<(traits<BASE>::XLEN-1)) | (mcause_max_irq-1));
|
|
||||||
if((FEAT & features_e::FEAT_CLIC) && (csr[mtvec]&0x3)==3) {
|
if((FEAT & features_e::FEAT_CLIC) && (csr[mtvec]&0x3)==3) {
|
||||||
auto mask = ((1UL<<(traits<BASE>::XLEN-1)) | (mcause_max_irq-1) | (0xfUL<<16));
|
auto mask = ((1UL<<(traits<BASE>::XLEN-1)) | (mcause_max_irq-1) | (0xfUL<<16));
|
||||||
csr[addr] = (val & mask) | (csr[addr] & ~mask);
|
csr[addr] = (val & mask) | (csr[addr] & ~mask);
|
||||||
|
@ -446,7 +446,7 @@ protected:
|
|||||||
std::vector<std::function<mem_write_f>> memfn_write;
|
std::vector<std::function<mem_write_f>> memfn_write;
|
||||||
void insert_mem_range(uint64_t, uint64_t, std::function<mem_read_f>, std::function<mem_write_f>);
|
void insert_mem_range(uint64_t, uint64_t, std::function<mem_read_f>, std::function<mem_write_f>);
|
||||||
feature_config cfg;
|
feature_config cfg;
|
||||||
unsigned mcause_max_irq{(FEAT&features_e::FEAT_CLIC)?4096:16};
|
uint64_t mcause_max_irq{(FEAT&features_e::FEAT_CLIC)?4096:16};
|
||||||
inline bool debug_mode_active() {return this->reg.PRIV&0x4;}
|
inline bool debug_mode_active() {return this->reg.PRIV&0x4;}
|
||||||
|
|
||||||
std::pair<std::function<mem_read_f>, std::function<mem_write_f>>
|
std::pair<std::function<mem_read_f>, std::function<mem_write_f>>
|
||||||
@ -1148,7 +1148,7 @@ template <typename BASE, features_e FEAT> iss::status riscv_hart_mu_p<BASE, FEAT
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
val = csr[addr] & ((1UL<<(traits<BASE>::XLEN-1)) | (mcause_max_irq-1));
|
val = csr[addr];// & ((1UL<<(traits<BASE>::XLEN-1)) | (mcause_max_irq-1));
|
||||||
return iss::Ok;
|
return iss::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
src/main.cpp
10
src/main.cpp
@ -61,7 +61,7 @@ int main(int argc, char *argv[]) {
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
desc.add_options()
|
desc.add_options()
|
||||||
("help,h", "Print help message")
|
("help,h", "Print help message")
|
||||||
("verbose,v", po::value<int>()->implicit_value(0), "Sets logging verbosity")
|
("verbose,v", po::value<int>()->default_value(4), "Sets logging verbosity")
|
||||||
("logfile,l", po::value<std::string>(), "Sets default log file.")
|
("logfile,l", po::value<std::string>(), "Sets default log file.")
|
||||||
("disass,d", po::value<std::string>()->implicit_value(""), "Enables disassembly")
|
("disass,d", po::value<std::string>()->implicit_value(""), "Enables disassembly")
|
||||||
("gdb-port,g", po::value<unsigned>()->default_value(0), "enable gdb server and specify port to use")
|
("gdb-port,g", po::value<unsigned>()->default_value(0), "enable gdb server and specify port to use")
|
||||||
@ -93,11 +93,9 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
LOGGER(DEFAULT)::print_time() = false;
|
LOGGER(DEFAULT)::print_time() = false;
|
||||||
LOGGER(connection)::print_time() = false;
|
LOGGER(connection)::print_time() = false;
|
||||||
if (clim.count("verbose")) {
|
auto l = logging::as_log_level(clim["verbose"].as<int>());
|
||||||
auto l = logging::as_log_level(clim["verbose"].as<int>());
|
LOGGER(DEFAULT)::reporting_level() = l;
|
||||||
LOGGER(DEFAULT)::reporting_level() = l;
|
LOGGER(connection)::reporting_level() = l;
|
||||||
LOGGER(connection)::reporting_level() = l;
|
|
||||||
}
|
|
||||||
if (clim.count("logfile")) {
|
if (clim.count("logfile")) {
|
||||||
// configure the connection logger
|
// configure the connection logger
|
||||||
auto f = fopen(clim["logfile"].as<std::string>().c_str(), "w");
|
auto f = fopen(clim["logfile"].as<std::string>().c_str(), "w");
|
||||||
|
Reference in New Issue
Block a user