summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-08-03 19:41:04 -0400
committerIan Moffett <ian@osmora.org>2024-08-03 19:41:04 -0400
commitca5484e280296b28870186e13236e0033b9f1b27 (patch)
treef61a3386cc4e489ca0a995b6e3fc7cd9e918ba8b
parentf7f868aa082fa08b9bbf34a08cec1d4cc3c2ade5 (diff)
soc: pimc: Add MMIO write interface
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sv/soc/irq/pimc.sv24
1 files changed, 24 insertions, 0 deletions
diff --git a/sv/soc/irq/pimc.sv b/sv/soc/irq/pimc.sv
index 6ad4c43..3c721b3 100644
--- a/sv/soc/irq/pimc.sv
+++ b/sv/soc/irq/pimc.sv
@@ -43,8 +43,10 @@ module pimc #(
/* MMIO interface */
input logic [47:0] mmio_addr,
+ input logic [31:0] mmio_wdata,
output logic [31:0] mmio_rdata,
input wire mmio_re,
+ input wire mmio_we,
output logic notify,
output logic [7:0] lineno,
@@ -87,6 +89,28 @@ module pimc #(
endcase
end
+ /* Handle MMIO wires */
+ if (mmio_we) begin
+ case (mmio_addr)
+ IRQTAB_MMIOBASE: irqtab[0] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 4: irqtab[1] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 8: irqtab[2] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 12: irqtab[3] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 16: irqtab[4] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 20: irqtab[5] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 24: irqtab[6] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 28: irqtab[7] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 32: irqtab[8] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 36: irqtab[9] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 40: irqtab[10] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 44: irqtab[11] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 48: irqtab[12] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 52: irqtab[13] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 56: irqtab[14] <= mmio_wdata;
+ IRQTAB_MMIOBASE + 60: irqtab[15] <= mmio_wdata;
+ endcase
+ end
+
if (irqack == 1'b1) begin
lineno <= 8'b0;
notify <= 1'b1;