diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-12-13 21:43:25 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-12-16 16:29:10 -0600 |
| commit | 0c63c46e31642d0102542a745af6b445a9d22b3b (patch) | |
| tree | 0e8b6db18829e4a3d6c894af206f2b5257815827 /tb/avalon.impl.hpp | |
| parent | d564e3538a3654facc94bb4cd1ee021830dfcf52 (diff) | |
Implement interrupt controller
Diffstat (limited to '')
| -rw-r--r-- | tb/avalon.impl.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tb/avalon.impl.hpp b/tb/avalon.impl.hpp index 6f4bfb9..e04c7b0 100644 --- a/tb/avalon.impl.hpp +++ b/tb/avalon.impl.hpp @@ -22,16 +22,28 @@ namespace taller::avalon } template<class Platform> + void interconnect<Platform>::attach_intc(interrupt_controller &intc) + { + assert(root_intc == nullptr); + + attach(intc.as_slave()); + root_intc = &intc; + } + + template<class Platform> bool interconnect<Platform>::tick(bool clk) { if(!plat.reset_reset_n) [[unlikely]] { active = nullptr; + plat.avl_irq = 0; + avl_read = false; avl_write = false; avl_address = 0; avl_writedata = 0; avl_byteenable = 0; + return true; } @@ -59,6 +71,11 @@ namespace taller::avalon binding.dev.tick(); } + if(root_intc) + { + plat.avl_irq = root_intc->irq(); + } + if(!active) { avl_address = plat.avl_address; |
