Updated SC-Components
This commit is contained in:
@ -50,7 +50,7 @@ plic::plic(sc_core::sc_module_name nm)
|
||||
{
|
||||
regs->registerResources(*this);
|
||||
// register callbacks
|
||||
regs->claim_complete.set_write_cb([this](scc::sc_register<uint32_t> reg, uint32_t v, sc_core::sc_time d) -> bool {
|
||||
regs->claim_complete.set_write_cb([this](scc::sc_register<uint32_t>& reg, const uint32_t& v, sc_core::sc_time d) -> bool {
|
||||
reg.put(v);
|
||||
reset_pending_int(v);
|
||||
// std::cout << "Value of register: 0x" << std::hex << reg << std::endl;
|
||||
|
@ -51,14 +51,14 @@ pwm::pwm(sc_core::sc_module_name nm)
|
||||
regs->registerResources(*this);
|
||||
|
||||
regs->pwmcfg.set_write_cb(
|
||||
[this](const scc::sc_register<uint32_t> ®, uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
[this](const scc::sc_register<uint32_t> ®, const uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
if (d.value()) wait(d);
|
||||
reg.put(data);
|
||||
update_counter();
|
||||
return true;
|
||||
});
|
||||
regs->pwmcount.set_write_cb(
|
||||
[this](const scc::sc_register<uint32_t> ®, uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
[this](const scc::sc_register<uint32_t> ®, const uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
if (d.value()) wait(d);
|
||||
reg.put(data);
|
||||
update_counter();
|
||||
@ -83,25 +83,25 @@ pwm::pwm(sc_core::sc_module_name nm)
|
||||
return true;
|
||||
});
|
||||
regs->pwmcmp0.set_write_cb(
|
||||
[this](const scc::sc_register<uint32_t> ®, uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
[this](const scc::sc_register<uint32_t> ®, const uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
reg.put(data);
|
||||
update_counter();
|
||||
return true;
|
||||
});
|
||||
regs->pwmcmp1.set_write_cb(
|
||||
[this](const scc::sc_register<uint32_t> ®, uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
[this](const scc::sc_register<uint32_t> ®, const uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
reg.put(data);
|
||||
update_counter();
|
||||
return true;
|
||||
});
|
||||
regs->pwmcmp2.set_write_cb(
|
||||
[this](const scc::sc_register<uint32_t> ®, uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
[this](const scc::sc_register<uint32_t> ®, const uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
reg.put(data);
|
||||
update_counter();
|
||||
return true;
|
||||
});
|
||||
regs->pwmcmp3.set_write_cb(
|
||||
[this](const scc::sc_register<uint32_t> ®, uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
[this](const scc::sc_register<uint32_t> ®, const uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
reg.put(data);
|
||||
update_counter();
|
||||
return true;
|
||||
|
@ -124,7 +124,7 @@ beh::beh(sc_core::sc_module_name nm)
|
||||
return true;
|
||||
});
|
||||
regs->csmode.set_write_cb(
|
||||
[this](const scc::sc_register<uint32_t> ®, uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
[this](const scc::sc_register<uint32_t> ®, const uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
if (regs->r_csmode.mode == 2 && regs->r_csmode.mode != bit_sub<0, 2>(data) && regs->r_csid < 4) {
|
||||
tlm::tlm_phase phase(tlm::BEGIN_REQ);
|
||||
sc_core::sc_time delay(SC_ZERO_TIME);
|
||||
@ -136,7 +136,7 @@ beh::beh(sc_core::sc_module_name nm)
|
||||
reg.put(data);
|
||||
return true;
|
||||
});
|
||||
regs->csid.set_write_cb([this](const scc::sc_register<uint32_t> ®, uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
regs->csid.set_write_cb([this](const scc::sc_register<uint32_t> ®, const uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
if (regs->r_csmode.mode == 2 && regs->csid != data && regs->r_csid < 4) {
|
||||
tlm::tlm_phase phase(tlm::BEGIN_REQ);
|
||||
sc_core::sc_time delay(SC_ZERO_TIME);
|
||||
@ -148,7 +148,7 @@ beh::beh(sc_core::sc_module_name nm)
|
||||
reg.put(data);
|
||||
return true;
|
||||
});
|
||||
regs->csdef.set_write_cb([this](const scc::sc_register<uint32_t> ®, uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
regs->csdef.set_write_cb([this](const scc::sc_register<uint32_t> ®, const uint32_t &data, sc_core::sc_time d) -> bool {
|
||||
auto diff = regs->csdef ^ data;
|
||||
if (regs->r_csmode.mode == 2 && diff != 0 && (regs->r_csid < 4) && (diff & (1 << regs->r_csid)) != 0) {
|
||||
tlm::tlm_phase phase(tlm::BEGIN_REQ);
|
||||
|
Reference in New Issue
Block a user