[DE0-Nano]

- added POR for CPU
- UART set to 460800 baud and added more FIFO depth

git-svn-id: http://moon:8086/svn/vhdl/trunk@1367 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2017-01-12 02:54:47 +00:00
parent 6e9407ef79
commit 5a2a217622
@@ -130,11 +130,12 @@ ARCHITECTURE behavior OF mips_sys IS
signal gpo0 : unsigned(31 downto 0); signal gpo0 : unsigned(31 downto 0);
signal gpi0 : unsigned(31 downto 0) := (others => '0'); signal gpi0 : unsigned(31 downto 0) := (others => '0');
signal sys_rst : STD_LOGIC;
signal sys_nmi : STD_LOGIC; signal sys_nmi : STD_LOGIC;
signal cpu_rst : STD_LOGIC := '1'; -- pre-init for POR
signal sys_rst : STD_LOGIC := '1'; -- pre-init for POR
signal reset_counter : unsigned(7 downto 0) := (others => '1'); signal cpu_rst_count : unsigned(23 downto 0) := (others => '1'); -- pre-init for POR
signal reset : STD_LOGIC := '1'; signal sys_rst_count : unsigned(7 downto 0) := (others => '1'); -- pre-init for POR
subtype addr_t is unsigned (2 downto 0); subtype addr_t is unsigned (2 downto 0);
subtype reg_t is unsigned (7 downto 0); subtype reg_t is unsigned (7 downto 0);
@@ -148,7 +149,6 @@ ARCHITECTURE behavior OF mips_sys IS
signal reg_we : STD_LOGIC; signal reg_we : STD_LOGIC;
BEGIN BEGIN
sys_rst <= reset;
sys_nmi <= not sys_nmi_n; sys_nmi <= not sys_nmi_n;
sys_leds <= cpu_debug & gpo0(5 downto 0); sys_leds <= cpu_debug & gpo0(5 downto 0);
spi_ss_n <= not spi_ss; spi_ss_n <= not spi_ss;
@@ -182,17 +182,32 @@ inst_jtag_reg: entity work.jtag_reg
re_o => reg_re re_o => reg_re
); );
power_up_reset: sys_reset:
process(sys_clk) process(sys_clk)
begin begin
if rising_edge(sys_clk) then if rising_edge(sys_clk) then
if sys_rst_n = '0' then if sys_rst_n = '0' then
reset <= '1'; sys_rst <= '1';
reset_counter <= (others => '1'); sys_rst_count <= (others => '1');
elsif (reset_counter /= 0) then elsif (sys_rst_count /= 0) then
reset_counter <= reset_counter - 1; sys_rst_count <= sys_rst_count - 1;
else else
reset <= '0'; sys_rst <= '0';
end if;
end if;
end process;
cpu_reset:
process(sys_clk)
begin
if rising_edge(sys_clk) then
if sys_rst_n = '0' then
cpu_rst <= '1';
cpu_rst_count <= (others => '1');
elsif (cpu_rst_count /= 0) then
cpu_rst_count <= cpu_rst_count - 1;
else
cpu_rst <= '0';
end if; end if;
end if; end if;
end process; end process;
@@ -284,7 +299,7 @@ inst_mips_top: entity work.mips_top
nmi => sys_nmi, nmi => sys_nmi,
eb => '1', eb => '1',
cpu_clk => sys_clk, cpu_clk => sys_clk,
RST_I => sys_rst, RST_I => cpu_rst,
CLK_I => sys_clk, CLK_I => sys_clk,
ACK_I => ACK_I, ACK_I => ACK_I,
SRDY_I => SRDY_I, SRDY_I => SRDY_I,
@@ -344,8 +359,8 @@ inst_uart0 : entity work.uart_wb
GENERIC MAP GENERIC MAP
( (
f_sysclk => F_SYSCLK, f_sysclk => F_SYSCLK,
baudrate_default => 115200.0, baudrate_default => 460800.0,
fifo_depth_bits => 1 fifo_depth_bits => 4
) )
PORT MAP PORT MAP
( (
@@ -370,8 +385,8 @@ inst_uart1 : entity work.uart_wb
GENERIC MAP GENERIC MAP
( (
f_sysclk => F_SYSCLK, f_sysclk => F_SYSCLK,
baudrate_default => 115200.0, baudrate_default => 460800.0,
fifo_depth_bits => 1 fifo_depth_bits => 4
) )
PORT MAP PORT MAP
( (