Skip to content

Commit 4990d15

Browse files
committed
simplifies clint_irq signal interface
1 parent 703bfc6 commit 4990d15

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

src/sysc/core_complex.cpp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,7 @@ template <unsigned int BUSWIDTH, typename QK> void core_complex<BUSWIDTH, QK>::i
230230
return tlm::TLM_COMPLETED;
231231
});
232232
#else
233-
SC_METHOD(sw_irq_cb);
234-
sensitive << sw_irq_i;
235-
SC_METHOD(timer_irq_cb);
236-
sensitive << timer_irq_i;
237-
SC_METHOD(ext_irq_cb);
238-
sensitive << ext_irq_i;
239-
SC_METHOD(local_irq_cb);
233+
SC_METHOD(clint_irq_cb);
240234
for(auto pin : clint_irq_i)
241235
sensitive << pin;
242236
#endif
@@ -362,21 +356,6 @@ template <unsigned int BUSWIDTH, typename QK> void core_complex<BUSWIDTH, QK>::r
362356
}
363357

364358
#ifndef USE_TLM_SIGNAL
365-
template <unsigned int BUSWIDTH, typename QK> void core_complex<BUSWIDTH, QK>::sw_irq_cb() {
366-
if(!rst_i->read() && sc_core::sc_time_stamp().value())
367-
core->local_irq(3, sw_irq_i.read());
368-
}
369-
370-
template <unsigned int BUSWIDTH, typename QK> void core_complex<BUSWIDTH, QK>::timer_irq_cb() {
371-
if(!rst_i->read() && sc_core::sc_time_stamp().value())
372-
core->local_irq(7, timer_irq_i.read());
373-
}
374-
375-
template <unsigned int BUSWIDTH, typename QK> void core_complex<BUSWIDTH, QK>::ext_irq_cb() {
376-
if(!rst_i->read() && sc_core::sc_time_stamp().value())
377-
core->local_irq(11, ext_irq_i.read());
378-
}
379-
380359
template <unsigned int BUSWIDTH, typename QK> void core_complex<BUSWIDTH, QK>::clint_irq_cb() {
381360
for(auto i = 0U; i < clint_irq_i.size(); ++i) {
382361
if(clint_irq_i[i].event()) {

src/sysc/core_complex.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ using irq_signal_t = tlm::scc::tlm_signal_bool_opt_in;
8484
using irq_signal_t = sc_core::sc_in<bool>;
8585
#endif
8686

87+
enum { SW_IRQ = 3, TIMER_IRQ = 7, EXT_IRQ = 11 };
88+
8789
template <unsigned int BUSWIDTH = scc::LT, typename QK = tlm::scc::quantumkeeper>
8890
class core_complex : public sc_core::sc_module, public scc::traceable, public core_complex_if {
8991
public:
@@ -95,12 +97,6 @@ class core_complex : public sc_core::sc_module, public scc::traceable, public co
9597

9698
sc_core::sc_in<bool> rst_i{"rst_i"};
9799

98-
irq_signal_t ext_irq_i{"ext_irq_i"};
99-
100-
irq_signal_t timer_irq_i{"timer_irq_i"};
101-
102-
irq_signal_t sw_irq_i{"sw_irq_i"};
103-
104100
sc_core::sc_vector<irq_signal_t> clint_irq_i{"local_irq_i", 16};
105101

106102
#ifndef CWR_SYSTEMC
@@ -232,9 +228,6 @@ class core_complex : public sc_core::sc_module, public scc::traceable, public co
232228
void run();
233229
void rst_cb();
234230
#ifndef USE_TLM_SIGNAL
235-
void sw_irq_cb();
236-
void timer_irq_cb();
237-
void ext_irq_cb();
238231
void clint_irq_cb();
239232
#endif
240233
///////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)