Line 118... |
Line 118... |
|
|
-- spi --
|
-- spi --
|
signal spi_data : std_ulogic;
|
signal spi_data : std_ulogic;
|
|
|
-- irq --
|
-- irq --
|
signal msi_ring, mei_ring : std_ulogic;
|
signal msi_ring, mei_ring, nmi_ring : std_ulogic;
|
signal soc_firq_ring : std_ulogic_vector(5 downto 0);
|
signal soc_firq_ring : std_ulogic_vector(5 downto 0);
|
|
|
-- Wishbone bus --
|
-- Wishbone bus --
|
type wishbone_t is record
|
type wishbone_t is record
|
addr : std_ulogic_vector(31 downto 0); -- address
|
addr : std_ulogic_vector(31 downto 0); -- address
|
Line 207... |
Line 207... |
FAST_MUL_EN => false, -- use DSPs for M extension's multiplier
|
FAST_MUL_EN => false, -- use DSPs for M extension's multiplier
|
FAST_SHIFT_EN => false, -- use barrel shifter for shift operations
|
FAST_SHIFT_EN => false, -- use barrel shifter for shift operations
|
TINY_SHIFT_EN => false, -- use tiny (single-bit) shifter for shift operations
|
TINY_SHIFT_EN => false, -- use tiny (single-bit) shifter for shift operations
|
CPU_CNT_WIDTH => 64, -- total width of CPU cycle and instret counters (0..64)
|
CPU_CNT_WIDTH => 64, -- total width of CPU cycle and instret counters (0..64)
|
-- Physical Memory Protection (PMP) --
|
-- Physical Memory Protection (PMP) --
|
PMP_NUM_REGIONS => 4, -- number of regions (0..64)
|
PMP_NUM_REGIONS => 5, -- number of regions (0..64)
|
PMP_MIN_GRANULARITY => 64*1024, -- minimal region granularity in bytes, has to be a power of 2, min 8 bytes
|
PMP_MIN_GRANULARITY => 64*1024, -- minimal region granularity in bytes, has to be a power of 2, min 8 bytes
|
-- Hardware Performance Monitors (HPM) --
|
-- Hardware Performance Monitors (HPM) --
|
HPM_NUM_CNTS => 12, -- number of inmplemnted HPM counters (0..29)
|
HPM_NUM_CNTS => 12, -- number of implemented HPM counters (0..29)
|
HPM_CNT_WIDTH => 40, -- total size of HPM counters (1..64)
|
HPM_CNT_WIDTH => 40, -- total size of HPM counters (1..64)
|
-- Internal Instruction memory --
|
-- Internal Instruction memory --
|
MEM_INT_IMEM_EN => int_imem_c , -- implement processor-internal instruction memory
|
MEM_INT_IMEM_EN => int_imem_c , -- implement processor-internal instruction memory
|
MEM_INT_IMEM_SIZE => imem_size_c, -- size of processor-internal instruction memory in bytes
|
MEM_INT_IMEM_SIZE => imem_size_c, -- size of processor-internal instruction memory in bytes
|
MEM_INT_IMEM_ROM => false, -- implement processor-internal instruction memory as ROM
|
MEM_INT_IMEM_ROM => false, -- implement processor-internal instruction memory as ROM
|
Line 296... |
Line 296... |
-- NeoPixel-compatible smart LED interface (available if IO_NEOLED_EN = true) --
|
-- NeoPixel-compatible smart LED interface (available if IO_NEOLED_EN = true) --
|
neoled_o => open, -- async serial data line
|
neoled_o => open, -- async serial data line
|
-- system time input from external MTIME (available if IO_MTIME_EN = false) --
|
-- system time input from external MTIME (available if IO_MTIME_EN = false) --
|
mtime_i => (others => '0'), -- current system time
|
mtime_i => (others => '0'), -- current system time
|
-- Interrupts --
|
-- Interrupts --
|
|
nm_irq_i => nmi_ring, -- non-maskable interrupt
|
soc_firq_i => soc_firq_ring, -- fast interrupt channels
|
soc_firq_i => soc_firq_ring, -- fast interrupt channels
|
mtime_irq_i => '0', -- machine software interrupt, available if IO_MTIME_EN = false
|
mtime_irq_i => '0', -- machine software interrupt, available if IO_MTIME_EN = false
|
msw_irq_i => msi_ring, -- machine software interrupt
|
msw_irq_i => msi_ring, -- machine software interrupt
|
mext_irq_i => mei_ring -- machine external interrupt
|
mext_irq_i => mei_ring -- machine external interrupt
|
);
|
);
|
Line 594... |
Line 595... |
-- bus interface --
|
-- bus interface --
|
wb_irq.rdata <= (others => '0');
|
wb_irq.rdata <= (others => '0');
|
wb_irq.ack <= wb_irq.cyc and wb_irq.stb and wb_irq.we and and_all_f(wb_irq.sel);
|
wb_irq.ack <= wb_irq.cyc and wb_irq.stb and wb_irq.we and and_all_f(wb_irq.sel);
|
wb_irq.err <= '0';
|
wb_irq.err <= '0';
|
-- trigger IRQ using CSR.MIE bit layout --
|
-- trigger IRQ using CSR.MIE bit layout --
|
|
nmi_ring <= '0';
|
msi_ring <= '0';
|
msi_ring <= '0';
|
mei_ring <= '0';
|
mei_ring <= '0';
|
soc_firq_ring <= (others => '0');
|
soc_firq_ring <= (others => '0');
|
if ((wb_irq.cyc and wb_irq.stb and wb_irq.we and and_all_f(wb_irq.sel)) = '1') then
|
if ((wb_irq.cyc and wb_irq.stb and wb_irq.we and and_all_f(wb_irq.sel)) = '1') then
|
|
nmi_ring <= wb_irq.wdata(00); -- non-maskable interrupt
|
msi_ring <= wb_irq.wdata(03); -- machine software interrupt
|
msi_ring <= wb_irq.wdata(03); -- machine software interrupt
|
mei_ring <= wb_irq.wdata(11); -- machine software interrupt
|
mei_ring <= wb_irq.wdata(11); -- machine software interrupt
|
--
|
--
|
soc_firq_ring(0) <= wb_irq.wdata(26); -- fast interrupt SoC channel 0 (-> FIRQ channel 10)
|
soc_firq_ring(0) <= wb_irq.wdata(26); -- fast interrupt SoC channel 0 (-> FIRQ channel 10)
|
soc_firq_ring(1) <= wb_irq.wdata(27); -- fast interrupt SoC channel 1 (-> FIRQ channel 11)
|
soc_firq_ring(1) <= wb_irq.wdata(27); -- fast interrupt SoC channel 1 (-> FIRQ channel 11)
|