Skip to content

Commit

Permalink
External interrupt interface
Browse files Browse the repository at this point in the history
  • Loading branch information
piotro888 committed Nov 19, 2024
1 parent c19fcfe commit ab01b5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion coreblocks/core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from amaranth import *
from amaranth.lib.wiring import Component, flipped, connect, Out
from amaranth.lib.wiring import Component, flipped, connect, In, Out
from transactron.utils.amaranth_ext.elaboratables import ModuleConnector

from transactron.utils.dependencies import DependencyContext
Expand Down Expand Up @@ -35,12 +35,14 @@
class Core(Component):
wb_instr: WishboneInterface
wb_data: WishboneInterface
interrupts: Signal

def __init__(self, *, gen_params: GenParams):
super().__init__(
{
"wb_instr": Out(WishboneSignature(gen_params.wb_params)),
"wb_data": Out(WishboneSignature(gen_params.wb_params)),
"interrupts": In(gen_params.isa.xlen),
}
)

Expand Down Expand Up @@ -115,6 +117,8 @@ def elaborate(self, platform):

m.submodules.csr_generic = self.csr_generic
m.submodules.interrupt_controller = self.interrupt_controller
m.d.comb += self.interrupt_controller.internal_report_level.eq(self.interrupts[0:16])
m.d.comb += self.interrupt_controller.custom_report.eq(self.interrupts[16:])

m.submodules.core_counter = core_counter = CoreInstructionCounter(self.gen_params)

Expand Down
2 changes: 1 addition & 1 deletion coreblocks/params/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def __post_init__(self):

instr_buffer_size: int = 4

interrupt_custom_count: int = 0
interrupt_custom_count: int = 16
interrupt_custom_edge_trig_mask: int = 0

user_mode: bool = True
Expand Down

0 comments on commit ab01b5f

Please sign in to comment.