- Debugged UART - Firmware support for SPI, UART - Work on SD/MMC support in firmware - Debugged mblite core/WB interface
98 lines
2.6 KiB
VHDL
98 lines
2.6 KiB
VHDL
-------------------------------------------------------------------------------
|
|
-- Title : Wrapper to integrate mblite core
|
|
-- Project :
|
|
-------------------------------------------------------------------------------
|
|
-- File : mblite_wrapper.vhd
|
|
-- Author : Matthias Blankertz <matthias@blankertz.org>
|
|
-- Company :
|
|
-- Created : 2013-06-02
|
|
-- Last update: 2013-06-07
|
|
-- Platform :
|
|
-- Standard : VHDL'93/02
|
|
-------------------------------------------------------------------------------
|
|
-- Description:
|
|
-------------------------------------------------------------------------------
|
|
-- Copyright (c) 2013
|
|
-------------------------------------------------------------------------------
|
|
-- Revisions :
|
|
-- Date Version Author Description
|
|
-- 2013-06-02 1.0 matthias Created
|
|
-------------------------------------------------------------------------------
|
|
|
|
library IEEE;
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
|
|
|
-- Uncomment the following library declaration if using
|
|
-- arithmetic functions with Signed or Unsigned values
|
|
use IEEE.NUMERIC_STD.ALL;
|
|
|
|
-- Uncomment the following library declaration if instantiating
|
|
-- any Xilinx primitives in this code.
|
|
--library UNISIM;
|
|
--use UNISIM.VComponents.all;
|
|
|
|
use work.intercon_package.all;
|
|
|
|
library mblite;
|
|
use mblite.core_Pkg.all;
|
|
|
|
entity mblite_wrapper is
|
|
port (
|
|
clk_i : in std_logic;
|
|
rst_i : in std_logic;
|
|
|
|
wbm_i : in cpu_wbm_i_type;
|
|
wbm_o : out cpu_wbm_o_type;
|
|
|
|
rom_wbs_i : in mblite_rom_wbs_i_type;
|
|
rom_wbs_o : out mblite_rom_wbs_o_type
|
|
);
|
|
end mblite_wrapper;
|
|
|
|
architecture Mixed of mblite_wrapper is
|
|
signal mb_imem_o : imem_out_type;
|
|
signal mb_imem_i : imem_in_type;
|
|
signal mb_wb_o : wb_mst_out_type;
|
|
signal mb_wb_i : wb_mst_in_type;
|
|
begin
|
|
|
|
mb_wb_i.clk_i <= clk_i;
|
|
mb_wb_i.rst_i <= rst_i;
|
|
|
|
mblite_inst : entity mblite.core_wb
|
|
port map (
|
|
imem_o => mb_imem_o,
|
|
imem_i => mb_imem_i,
|
|
wb_o => mb_wb_o,
|
|
wb_i => mb_wb_i
|
|
);
|
|
|
|
mblite_rom_inst : entity work.mblite_rom
|
|
port map (
|
|
clka => clk_i,
|
|
ena => mb_imem_o.ena_o,
|
|
addra => mb_imem_o.adr_o(13 downto 2),
|
|
douta => mb_imem_i.dat_i,
|
|
wbs_i => rom_wbs_i,
|
|
wbs_o => rom_wbs_o
|
|
);
|
|
|
|
wb_reg : process(clk_i)
|
|
begin
|
|
if rising_edge(clk_i) then
|
|
wbm_o.adr_o <= mb_wb_o.adr_o;
|
|
wbm_o.we_o <= mb_wb_o.we_o;
|
|
wbm_o.sel_o <= mb_wb_o.sel_o;
|
|
end if;
|
|
end process wb_reg;
|
|
|
|
wbm_o.dat_o <= mb_wb_o.dat_o;
|
|
wbm_o.stb_o <= mb_wb_o.stb_o;
|
|
wbm_o.cyc_o <= mb_wb_o.cyc_o;
|
|
|
|
mb_wb_i.dat_i <= wbm_i.dat_i;
|
|
mb_wb_i.ack_i <= wbm_i.ack_i;
|
|
mb_wb_i.int_i <= '0';
|
|
|
|
end Mixed;
|