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

Subversion Repositories ion

[/] [ion/] [trunk/] [vhdl/] [mips_cache.vhdl] - Diff between revs 114 and 134

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

Rev 114 Rev 134
Line 167... Line 167...
        data_wr         : in std_logic_vector(31 downto 0);
        data_wr         : in std_logic_vector(31 downto 0);
 
 
        mem_wait        : out std_logic;
        mem_wait        : out std_logic;
        cache_enable    : in std_logic;
        cache_enable    : in std_logic;
        ic_invalidate   : in std_logic;
        ic_invalidate   : in std_logic;
 
        -- Asserted for 1 cycle after code/data access to unmapped area
 
        unmapped        : out std_logic;
 
 
        -- interface to FPGA i/o devices
        -- interface to FPGA i/o devices
        io_rd_data      : in std_logic_vector(31 downto 0);
        io_rd_data      : in std_logic_vector(31 downto 0);
        io_rd_addr      : out std_logic_vector(31 downto 2);
        io_rd_addr      : out std_logic_vector(31 downto 2);
        io_wr_addr      : out std_logic_vector(31 downto 2);
        io_wr_addr      : out std_logic_vector(31 downto 2);
Line 264... Line 266...
    data_ignore_write,          -- hook for raising error flag FIXME untested
    data_ignore_write,          -- hook for raising error flag FIXME untested
    data_ignore_read,           -- hook for raising error flag FIXME untested
    data_ignore_read,           -- hook for raising error flag FIXME untested
 
 
    -- Other states -------------------------------------------------
    -- Other states -------------------------------------------------
 
 
    --code_wait_for_dcache,       -- wait for D-cache to stop using the buses
 
    bug                         -- caught an error in the state machine
    bug                         -- caught an error in the state machine
   );
   );
 
 
-- Cache state machine state register & next state
-- Cache state machine state register & next state
signal ps, ns :             t_cache_state;
signal ps, ns :             t_cache_state;
Line 415... Line 416...
            case data_wr_attr.mem_type is
            case data_wr_attr.mem_type is
            when MT_BRAM        => ns <= data_ignore_write;
            when MT_BRAM        => ns <= data_ignore_write;
            when MT_SRAM_16B    => ns <= data_writethrough_sram_0a;
            when MT_SRAM_16B    => ns <= data_writethrough_sram_0a;
            when MT_IO_SYNC     => ns <= data_write_io_0;
            when MT_IO_SYNC     => ns <= data_write_io_0;
            -- FIXME ignore write to undecoded area (clear pending flag)
            -- FIXME ignore write to undecoded area (clear pending flag)
            when others         => ns <= ps;
            when others         => ns <= data_ignore_write;
            end case;
            end case;
 
 
        elsif read_pending='1' then
        elsif read_pending='1' then
            case data_rd_attr.mem_type is
            case data_rd_attr.mem_type is
            when MT_BRAM        => ns <= data_refill_bram_0;
            when MT_BRAM        => ns <= data_refill_bram_0;
Line 453... Line 454...
                case data_wr_attr.mem_type is
                case data_wr_attr.mem_type is
                when MT_BRAM        => ns <= data_ignore_write;
                when MT_BRAM        => ns <= data_ignore_write;
                when MT_SRAM_16B    => ns <= data_writethrough_sram_0a;
                when MT_SRAM_16B    => ns <= data_writethrough_sram_0a;
                when MT_IO_SYNC     => ns <= data_write_io_0;
                when MT_IO_SYNC     => ns <= data_write_io_0;
                -- FIXME ignore write to undecoded area (clear pending flag)
                -- FIXME ignore write to undecoded area (clear pending flag)
                when others         => ns <= ps;
                when others         => ns <= data_ignore_write;
                end case;
                end case;
 
 
            elsif read_pending='1' then
            elsif read_pending='1' then
                case data_rd_attr.mem_type is
                case data_rd_attr.mem_type is
                when MT_BRAM        => ns <= data_refill_bram_0;
                when MT_BRAM        => ns <= data_refill_bram_0;
Line 491... Line 492...
                    case data_wr_attr.mem_type is
                    case data_wr_attr.mem_type is
                    when MT_BRAM        => ns <= data_ignore_write;
                    when MT_BRAM        => ns <= data_ignore_write;
                    when MT_SRAM_16B    => ns <= data_writethrough_sram_0a;
                    when MT_SRAM_16B    => ns <= data_writethrough_sram_0a;
                    when MT_IO_SYNC     => ns <= data_write_io_0;
                    when MT_IO_SYNC     => ns <= data_write_io_0;
                    -- FIXME ignore write to undecoded area (clear pending flag)
                    -- FIXME ignore write to undecoded area (clear pending flag)
                    when others         => ns <= ps;
                    when others         => ns <= data_ignore_write;
                    end case;
                    end case;
 
 
                elsif read_pending='1' then
                elsif read_pending='1' then
                    case data_rd_attr.mem_type is
                    case data_rd_attr.mem_type is
                    when MT_BRAM        => ns <= data_refill_bram_0;
                    when MT_BRAM        => ns <= data_refill_bram_0;
Line 664... Line 665...
        else
        else
            ns <= idle;
            ns <= idle;
        end if;
        end if;
 
 
    when data_ignore_write =>
    when data_ignore_write =>
 
        -- Access to unmapped area. We have 1 cycle to do something.
        ns <= idle;
        ns <= idle;
 
 
    when data_ignore_read =>
    when data_ignore_read =>
 
        -- Access to unmapped area. We have 1 cycle to do something.
        ns <= idle;
        ns <= idle;
 
 
    -- Exception states (something went wrong) ----------------------
    -- Exception states (something went wrong) ----------------------
 
 
    when code_crash =>
    when code_crash =>
        -- Attempted to fetch from i/o area. This is a software bug, probably,
        -- Attempted to fetch from i/o area. This is a software bug, probably,
        -- and should trigger a trap. We have 1 cycle to do something about it.
        -- and should trigger a trap. We have 1 cycle to do something about it.
        -- FIXME do something about wrong fetch: trap, etc.
 
        -- After this cycle, back to normal.
        -- After this cycle, back to normal.
        ns <= idle;
        ns <= idle;
 
 
    when bug =>
    when bug =>
        -- Something weird happened, we have 1 cycle to do something like raise
        -- Something weird happened, we have 1 cycle to do something like raise
Line 856... Line 858...
 
 
code_rd_attr <= decode_addr(code_rd_addr_mask);
code_rd_attr <= decode_addr(code_rd_addr_mask);
data_rd_attr <= decode_addr(data_rd_addr_mask);
data_rd_attr <= decode_addr(data_rd_addr_mask);
data_wr_attr <= decode_addr(data_wr_addr_mask);
data_wr_attr <= decode_addr(data_wr_addr_mask);
 
 
 
-- Unmapped area access flag, raised for 1 cycle only after each wrong access
 
with ps select unmapped <=
 
    '1' when code_crash,
 
    '1' when data_ignore_read,
 
    '1' when data_ignore_write,
 
    '0' when others;
 
 
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- BRAM interface (BRAM is FPGA Block RAM)
-- BRAM interface (BRAM is FPGA Block RAM)
 
 
-- BRAM address can come from code or data buses, we support code execution
-- BRAM address can come from code or data buses, we support code execution

powered by: WebSVN 2.1.0

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