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

Subversion Repositories ion

[/] [ion/] [trunk/] [vhdl/] [tb/] [mips_tb.vhdl] - Diff between revs 207 and 211

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

Rev 207 Rev 211
Line 126... Line 126...
subtype t_irq_countdown     is std_logic_vector(31 downto 0);
subtype t_irq_countdown     is std_logic_vector(31 downto 0);
type t_irq_countdown_array  is array(0 to 7) of t_irq_countdown;
type t_irq_countdown_array  is array(0 to 7) of t_irq_countdown;
 
 
signal irq_countdown :      t_irq_countdown_array;
signal irq_countdown :      t_irq_countdown_array;
 
 
 
-- Simulated block of 4 read/write, 32-bit I/O registers, used in cache test. 
 
type t_debug_reg_block is array(0 to 3) of t_word;
 
signal debug_reg_block :    t_debug_reg_block;
 
 
 
 
begin
begin
 
 
    -- UUT instantiation -------------------------------------------------------
    -- UUT instantiation -------------------------------------------------------
    mpu: entity work.mips_mpu
    mpu: entity work.mips_mpu
Line 254... Line 258...
    variable uart_data : integer;
    variable uart_data : integer;
    begin
    begin
        if clk'event and clk='1' then
        if clk'event and clk='1' then
            if io_byte_we /= "0000" then
            if io_byte_we /= "0000" then
                if io_wr_addr(31 downto 16)=X"2001" then
                if io_wr_addr(31 downto 16)=X"2001" then
 
                    -- IRQ trigger register block (write only)
                    irq_trigger_load <= '1';
                    irq_trigger_load <= '1';
                    irq_trigger_data <= io_wr_data;
                    irq_trigger_data <= io_wr_data;
                    irq_trigger_addr <= io_wr_addr(4 downto 2);
                    irq_trigger_addr <= io_wr_addr(4 downto 2);
 
                elsif io_wr_addr(31 downto 12)=X"2000f" then
 
                    -- Debug register block (read/write)
 
                    debug_reg_block(conv_integer(unsigned(io_wr_addr(3 downto 2)))) <= io_wr_data;
                else
                else
                    irq_trigger_load <= '0';
                    irq_trigger_load <= '0';
                end if;
                end if;
            else
            else
                irq_trigger_load <= '0';
                irq_trigger_load <= '0';
            end if;
            end if;
        end if;
        end if;
    end process simulated_io;
    end process simulated_io;
 
 
 
    -- The only readable i/o is the debug reg block. We simulate an asynchronous
 
    -- read port (a mux).
 
    io_rd_data <= debug_reg_block(conv_integer(unsigned(io_rd_addr(3 downto 2))));
 
 
    -- Simulate IRQs -----------------------------------------------------------
    -- Simulate IRQs -----------------------------------------------------------
    irq_trigger_registers:
    irq_trigger_registers:
    process(clk)
    process(clk)
    variable index : integer range 0 to 7;
    variable index : integer range 0 to 7;
    begin
    begin

powered by: WebSVN 2.1.0

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