Line 1... |
Line 1... |
-- #################################################################################################
|
-- #################################################################################################
|
-- # << NEORV32 - Processor-internal bootloader ROM (BOOTROM) >> #
|
-- # << NEORV32 - Processor-internal bootloader ROM (BOOTROM) >> #
|
-- # ********************************************************************************************* #
|
-- # ********************************************************************************************* #
|
-- # BSD 3-Clause License #
|
-- # BSD 3-Clause License #
|
-- # #
|
-- # #
|
-- # Copyright (c) 2020, Stephan Nolting. All rights reserved. #
|
-- # Copyright (c) 2022, Stephan Nolting. All rights reserved. #
|
-- # #
|
-- # #
|
-- # Redistribution and use in source and binary forms, with or without modification, are #
|
-- # Redistribution and use in source and binary forms, with or without modification, are #
|
-- # permitted provided that the following conditions are met: #
|
-- # permitted provided that the following conditions are met: #
|
-- # #
|
-- # #
|
-- # 1. Redistributions of source code must retain the above copyright notice, this list of #
|
-- # 1. Redistributions of source code must retain the above copyright notice, this list of #
|
Line 45... |
Line 45... |
BOOTROM_BASE : std_ulogic_vector(31 downto 0) -- boot ROM base address
|
BOOTROM_BASE : std_ulogic_vector(31 downto 0) -- boot ROM base address
|
);
|
);
|
port (
|
port (
|
clk_i : in std_ulogic; -- global clock line
|
clk_i : in std_ulogic; -- global clock line
|
rden_i : in std_ulogic; -- read enable
|
rden_i : in std_ulogic; -- read enable
|
|
wren_i : in std_ulogic; -- write enable
|
addr_i : in std_ulogic_vector(31 downto 0); -- address
|
addr_i : in std_ulogic_vector(31 downto 0); -- address
|
data_o : out std_ulogic_vector(31 downto 0); -- data out
|
data_o : out std_ulogic_vector(31 downto 0); -- data out
|
ack_o : out std_ulogic -- transfer acknowledge
|
ack_o : out std_ulogic; -- transfer acknowledge
|
|
err_o : out std_ulogic -- transfer error
|
);
|
);
|
end neorv32_boot_rom;
|
end neorv32_boot_rom;
|
|
|
architecture neorv32_boot_rom_rtl of neorv32_boot_rom is
|
architecture neorv32_boot_rom_rtl of neorv32_boot_rom is
|
|
|
Line 89... |
Line 91... |
-- Memory Access --------------------------------------------------------------------------
|
-- Memory Access --------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
mem_file_access: process(clk_i)
|
mem_file_access: process(clk_i)
|
begin
|
begin
|
if rising_edge(clk_i) then
|
if rising_edge(clk_i) then
|
rden <= rden_i and acc_en;
|
rden <= acc_en and rden_i;
|
|
err_o <= acc_en and wren_i;
|
if (acc_en = '1') then -- reduce switching activity when not accessed
|
if (acc_en = '1') then -- reduce switching activity when not accessed
|
rdata <= mem_rom(to_integer(unsigned(addr)));
|
rdata <= mem_rom(to_integer(unsigned(addr)));
|
end if;
|
end if;
|
end if;
|
end if;
|
end process mem_file_access;
|
end process mem_file_access;
|