- added simulation entities

git-svn-id: http://moon:8086/svn/vhdl/trunk@1079 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2015-05-14 10:59:18 +00:00
parent 4cd6758a4b
commit db9e21023c
3 changed files with 124 additions and 22 deletions
+4 -22
View File
@@ -1,13 +1,8 @@
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.ALL;
use std.textio.all; -- Imports the standard textio package.
ENTITY uart_wb IS
Generic
(
simulate_tx : boolean := false
);
Port
(
CLK_I : in STD_LOGIC;
@@ -91,8 +86,6 @@ begin
------------------------------------------------------------------
registers_write:
process(CLK_I)
file output: text open write_mode is "STD_OUTPUT";
variable L : line;
begin
if rising_edge(CLK_I) then
reg_we_uart_tx <= '0';
@@ -105,16 +98,7 @@ registers_write:
when "0000" =>
reg_uart_tx <= DAT_I(7 downto 0);
if simulate_tx then
if DAT_I(7 downto 0) /= X"0D" then
write(L, character'val(to_integer(DAT_I(7 downto 0))));
end if;
if DAT_I(7 downto 0) = X"0A" then
writeline(output, L);
end if;
else
reg_we_uart_tx <= '1';
end if;
reg_we_uart_tx <= '1';
when "0001" =>
rx_int_en <= DAT_I(6);
@@ -181,7 +165,7 @@ irq_register:
end if;
end process;
inst_uart_tx: uart_tx
inst_uart_tx: entity work.uart_tx
port map
(
data_in => std_logic_vector(reg_uart_tx),
@@ -196,7 +180,7 @@ inst_uart_tx: uart_tx
clk => CLK_I
);
inst_uart_rx: uart_rx
inst_uart_rx: entity work.uart_rx
port map
(
serial_in => ser_rx,
@@ -210,9 +194,7 @@ inst_uart_rx: uart_rx
clk => CLK_I
);
status_sim <= "0000000000000000";
status_real <= "000000" & irq_rx & irq_tx & '0' & rx_int_en & tx_int_en & rx_data_present & rx_full & rx_half_full & tx_full & tx_half_full ;
uart_status_port <= status_sim when simulate_tx else status_real;
uart_status_port <= "000000" & irq_rx & irq_tx & '0' & rx_int_en & tx_int_en & rx_data_present & rx_full & rx_half_full & tx_full & tx_half_full ;
INT_O <= irq_rx or irq_tx;