OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sim/] [neorv32_tb.vhd] - Diff between revs 47 and 48

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 47 Rev 48
Line 106... Line 106...
  -- 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 : std_ulogic;
  signal soc_firq_ring      : std_ulogic_vector(3 downto 0);
  signal soc_firq_ring      : std_ulogic_vector(7 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
    wdata : std_ulogic_vector(31 downto 0); -- master write data
    wdata : std_ulogic_vector(31 downto 0); -- master write data
Line 166... Line 166...
  -- -------------------------------------------------------------------------------------------
  -- -------------------------------------------------------------------------------------------
  clk_gen <= not clk_gen after (t_clock_c/2);
  clk_gen <= not clk_gen after (t_clock_c/2);
  rst_gen <= '0', '1' after 60*(t_clock_c/2);
  rst_gen <= '0', '1' after 60*(t_clock_c/2);
 
 
 
 
  -- CPU Core -------------------------------------------------------------------------------
  -- The Core of the Problem ----------------------------------------------------------------
  -- -------------------------------------------------------------------------------------------
  -- -------------------------------------------------------------------------------------------
  neorv32_top_inst: neorv32_top
  neorv32_top_inst: neorv32_top
  generic map (
  generic map (
    -- General --
    -- General --
    CLOCK_FREQUENCY              => f_clock_c,     -- clock frequency of clk_i in Hz
    CLOCK_FREQUENCY              => f_clock_c,     -- clock frequency of clk_i in Hz
Line 498... Line 498...
  irq_trigger: process(clk_gen)
  irq_trigger: process(clk_gen)
  begin
  begin
    if rising_edge(clk_gen) then
    if rising_edge(clk_gen) then
      -- 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;
      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 --
      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) = '1') then
      if ((wb_irq.cyc and wb_irq.stb and wb_irq.we and and_all_f(wb_irq.sel)) = '1') then
        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(20); -- fast interrupt channel 4
        soc_firq_ring(0) <= wb_irq.wdata(24); -- fast interrupt SoC channel 0
        soc_firq_ring(1) <= wb_irq.wdata(21); -- fast interrupt channel 5
        soc_firq_ring(1) <= wb_irq.wdata(25); -- fast interrupt SoC channel 1
        soc_firq_ring(2) <= wb_irq.wdata(22); -- fast interrupt channel 6
        soc_firq_ring(2) <= wb_irq.wdata(26); -- fast interrupt SoC channel 2
        soc_firq_ring(3) <= wb_irq.wdata(22); -- fast interrupt channel 7
        soc_firq_ring(3) <= wb_irq.wdata(27); -- fast interrupt SoC channel 3
 
        soc_firq_ring(4) <= wb_irq.wdata(28); -- fast interrupt SoC channel 4
 
        soc_firq_ring(5) <= wb_irq.wdata(29); -- fast interrupt SoC channel 5
 
        soc_firq_ring(6) <= wb_irq.wdata(30); -- fast interrupt SoC channel 6
 
        soc_firq_ring(7) <= wb_irq.wdata(31); -- fast interrupt SoC channel 7
      end if;
      end if;
    end if;
    end if;
  end process irq_trigger;
  end process irq_trigger;
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.