From f585489ff5af76d8e5cac139285dc57af8c95e64 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 26 Oct 2022 17:21:44 +0200 Subject: [PATCH] fixes pin naming --- src/sysc/core_complex.cpp | 29 ++++++++++++++++++++--------- src/sysc/core_complex.h | 5 +++-- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/sysc/core_complex.cpp b/src/sysc/core_complex.cpp index e3730f2..c3776cf 100644 --- a/src/sysc/core_complex.cpp +++ b/src/sysc/core_complex.cpp @@ -186,17 +186,17 @@ public: void local_irq(short id, bool value) { reg_t mask = 0; switch (id) { - case 16: // SW + case 3: // SW mask = 1 << 3; break; - case 17: // timer + case 7: // timer mask = 1 << 7; break; - case 18: // external + case 11: // external mask = 1 << 11; break; default: - /* do nothing*/ + if(id>15) mask = 1 << id; break; } if (value) { @@ -357,8 +357,11 @@ void core_complex::init(){ sensitive << sw_irq_i; SC_METHOD(timer_irq_cb); sensitive << timer_irq_i; - SC_METHOD(global_irq_cb); - sensitive << global_irq_i; + SC_METHOD(ext_irq_cb); + sensitive << ext_irq_i; + SC_METHOD(local_irq_cb); + for(auto pin:local_irq_i) + sensitive << pin; trc->m_db=scv_tr_db::get_default_db(); SC_METHOD(forward); @@ -480,11 +483,19 @@ void core_complex::rst_cb() { if (rst_i.read()) cpu->set_interrupt_execution(true); } -void core_complex::sw_irq_cb() { cpu->local_irq(16, sw_irq_i.read()); } +void core_complex::sw_irq_cb() { cpu->local_irq(3, sw_irq_i.read()); } -void core_complex::timer_irq_cb() { cpu->local_irq(17, timer_irq_i.read()); } +void core_complex::timer_irq_cb() { cpu->local_irq(7, timer_irq_i.read()); } -void core_complex::global_irq_cb() { cpu->local_irq(18, global_irq_i.read()); } +void core_complex::ext_irq_cb() { cpu->local_irq(11, ext_irq_i.read()); } + +void core_complex::local_irq_cb() { + for(auto i=0U; ilocal_irq(16+i, local_irq_i[i].read()); + } + } +} void core_complex::run() { wait(SC_ZERO_TIME); // separate from elaboration phase diff --git a/src/sysc/core_complex.h b/src/sysc/core_complex.h index f764a8a..f7d8d73 100644 --- a/src/sysc/core_complex.h +++ b/src/sysc/core_complex.h @@ -73,7 +73,7 @@ public: sc_core::sc_in rst_i{"rst_i"}; - sc_core::sc_in global_irq_i{"global_irq_i"}; + sc_core::sc_in ext_irq_i{"ext_irq_i"}; sc_core::sc_in timer_irq_i{"timer_irq_i"}; @@ -181,7 +181,8 @@ protected: void rst_cb(); void sw_irq_cb(); void timer_irq_cb(); - void global_irq_cb(); + void ext_irq_cb(); + void local_irq_cb(); uint64_t last_sync_cycle = 0; util::range_lut read_lut, write_lut; tlm_utils::tlm_quantumkeeper quantum_keeper;