Line 2... |
Line 2... |
-- ion_cpu.vhdl -- MIPS-I(tm) compatible CPU core
|
-- ion_cpu.vhdl -- MIPS-I(tm) compatible CPU core
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
-- project: ION (http://www.opencores.org/project,ion_cpu)
|
-- project: ION (http://www.opencores.org/project,ion_cpu)
|
-- author: Jose A. Ruiz (ja_rd@hotmail.com)
|
-- author: Jose A. Ruiz (ja_rd@hotmail.com)
|
-- created: Jan/11/2011
|
-- created: Jan/11/2011
|
-- last modified: Jan/31/2011 (ja_rd@hotmail.com)
|
-- last modified: Mar/03/2011 (ja_rd@hotmail.com)
|
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
-- Software placed into the public domain by the author. Use under the terms of
|
-- Software placed into the public domain by the author. Use under the terms of
|
-- the GPL.
|
-- the GPL.
|
-- Software 'as is' without warranty. Author liable for nothing.
|
-- Software 'as is' without warranty. Author liable for nothing.
|
--
|
--
|
Line 50... |
Line 50... |
port(
|
port(
|
clk : in std_logic;
|
clk : in std_logic;
|
reset : in std_logic;
|
reset : in std_logic;
|
interrupt : in std_logic;
|
interrupt : in std_logic;
|
|
|
data_rd_addr : out std_logic_vector(31 downto 0);
|
data_addr : out std_logic_vector(31 downto 0);
|
|
|
data_rd : in std_logic_vector(31 downto 0);
|
data_rd : in std_logic_vector(31 downto 0);
|
data_rd_vma : out std_logic;
|
data_rd_vma : out std_logic;
|
|
|
|
byte_we : out std_logic_vector(3 downto 0);
|
|
data_wr : out std_logic_vector(31 downto 0);
|
|
|
code_rd_addr : out std_logic_vector(31 downto 2);
|
code_rd_addr : out std_logic_vector(31 downto 2);
|
code_rd : in std_logic_vector(31 downto 0);
|
code_rd : in std_logic_vector(31 downto 0);
|
code_rd_vma : out std_logic;
|
code_rd_vma : out std_logic;
|
|
|
data_wr_addr : out std_logic_vector(31 downto 2);
|
|
byte_we : out std_logic_vector(3 downto 0);
|
|
data_wr : out std_logic_vector(31 downto 0);
|
|
|
|
mem_wait : in std_logic
|
mem_wait : in std_logic
|
);
|
);
|
end; --entity mips_cpu
|
end; --entity mips_cpu
|
|
|
architecture rtl of mips_cpu is
|
architecture rtl of mips_cpu is
|
Line 468... |
Line 468... |
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end if;
|
end process pc_register;
|
end process pc_register;
|
|
|
-- FIXME we should not output the lowest 2 bits
|
-- Common rd/wr address; lowest 2 bits are output as debugging aid only
|
data_rd_addr <= p1_data_addr(31 downto 0);
|
data_addr <= p1_data_addr(31 downto 0);
|
|
|
-- FIXME these two need to pushed behind a register, they are glitch-prone
|
-- FIXME these two need to pushed behind a register, they are glitch-prone
|
data_rd_vma <= p1_do_load and not pipeline_stalled; -- FIXME register
|
data_rd_vma <= p1_do_load and not pipeline_stalled; -- FIXME register
|
code_rd_vma <= not stall_pipeline; -- FIXME register
|
code_rd_vma <= not stall_pipeline; -- FIXME register
|
|
|
code_rd_addr <= p0_pc_next;
|
code_rd_addr <= p0_pc_next;
|
|
|
data_wr_addr <= p1_data_addr(31 downto 2);
|
|
|
|
-- compute target of J/JR instructions
|
-- compute target of J/JR instructions
|
p0_pc_jump <= p1_rs(31 downto 2) when p1_do_reg_jump='1' else
|
p0_pc_jump <= p1_rs(31 downto 2) when p1_do_reg_jump='1' else
|
p0_pc_reg(31 downto 28) & p1_ir_reg(25 downto 0);
|
p0_pc_reg(31 downto 28) & p1_ir_reg(25 downto 0);
|
|
|