Browse Source

Make triggers::module_t::triggers private.

pull/944/head
Tim Newsome 4 years ago
parent
commit
cf0707f883
  1. 4
      riscv/processor.cc
  2. 2
      riscv/processor.h
  3. 9
      riscv/triggers.cc
  4. 1
      riscv/triggers.h

4
riscv/processor.cc

@ -988,14 +988,14 @@ bool processor_t::store(reg_t addr, size_t len, const uint8_t* bytes)
return false;
}
void processor_t::trigger_updated()
void processor_t::trigger_updated(const std::vector<triggers::mcontrol_t *> *triggers)
{
mmu->flush_tlb();
mmu->check_triggers_fetch = false;
mmu->check_triggers_load = false;
mmu->check_triggers_store = false;
for (auto trigger : TM.triggers) {
for (auto trigger : *triggers) {
if (trigger->execute) {
mmu->check_triggers_fetch = true;
}

2
riscv/processor.h

@ -314,7 +314,7 @@ public:
HR_GROUP /* Halt requested due to halt group. */
} halt_request;
void trigger_updated();
void trigger_updated(const std::vector<triggers::mcontrol_t *> *triggers);
void set_pmp_num(reg_t pmp_num);
void set_pmp_granularity(reg_t pmp_granularity);

9
riscv/triggers.cc

@ -65,7 +65,6 @@ bool mcontrol_t::tdata1_write(processor_t *proc, const reg_t val) noexcept {
// Assume we're here because of csrw.
if (execute)
timing = 0;
proc->trigger_updated();
return true;
}
@ -180,7 +179,9 @@ reg_t module_t::tdata1_read(const processor_t *proc, unsigned index) const noexc
bool module_t::tdata1_write(processor_t *proc, unsigned index, const reg_t val) noexcept
{
return triggers[index]->tdata1_write(proc, val);
bool result = triggers[index]->tdata1_write(proc, val);
proc->trigger_updated(&triggers);
return result;
}
reg_t module_t::tdata2_read(const processor_t *proc, unsigned index) const noexcept
@ -190,7 +191,9 @@ reg_t module_t::tdata2_read(const processor_t *proc, unsigned index) const noexc
bool module_t::tdata2_write(processor_t *proc, unsigned index, const reg_t val) noexcept
{
return triggers[index]->tdata2_write(proc, val);
bool result = triggers[index]->tdata2_write(proc, val);
proc->trigger_updated(&triggers);
return result;
}

1
riscv/triggers.h

@ -111,6 +111,7 @@ public:
bool tdata2_write(processor_t *proc, unsigned index, const reg_t val) noexcept;
processor_t *proc;
private:
std::vector<mcontrol_t *> triggers;
};

Loading…
Cancel
Save