[JUART]
- better BAUD_DIV git-svn-id: http://moon:8086/svn/vhdl/trunk@1345 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
@@ -32,6 +32,7 @@ architecture behave of tb_juart_tx_rx is
|
||||
|
||||
-- Number of user data words for simulation
|
||||
constant CLK_PERIOD : time := 10 ns;
|
||||
constant BAUD_DIV : natural := 2;
|
||||
|
||||
-- Common
|
||||
signal rst : std_logic := '1';
|
||||
@@ -51,7 +52,7 @@ architecture behave of tb_juart_tx_rx is
|
||||
|
||||
-- Others
|
||||
signal baud_count : unsigned(15 downto 0);
|
||||
signal baudrate : unsigned(15 downto 0) := X"0001";
|
||||
signal baud_reg : unsigned(15 downto 0) := to_unsigned(BAUD_DIV-1, baud_count'length);
|
||||
signal data_rx : unsigned(7 downto 0);
|
||||
signal data_tx : unsigned(7 downto 0);
|
||||
|
||||
@@ -108,7 +109,7 @@ begin
|
||||
en_16_x_baud <= '0';
|
||||
if rst = '1' then
|
||||
baud_count <= (others => '0');
|
||||
elsif baud_count = baudrate then
|
||||
elsif baud_count = baud_reg then
|
||||
baud_count <= (others => '0');
|
||||
en_16_x_baud <= '1';
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user