[JUART]
- better BAUD_DIV git-svn-id: http://moon:8086/svn/vhdl/trunk@1345 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
@@ -11,7 +11,7 @@ add wave -noupdate -format Logic /tb_juart_tx_rx/serial_in
|
||||
add wave -noupdate -format Logic /tb_juart_tx_rx/data_strobe
|
||||
add wave -noupdate -format Literal -radix hexadecimal /tb_juart_tx_rx/data_out
|
||||
add wave -noupdate -format Literal -radix hexadecimal /tb_juart_tx_rx/data_rx
|
||||
add wave -noupdate -format Literal /tb_juart_tx_rx/data_tx
|
||||
add wave -noupdate -format Literal -radix hexadecimal /tb_juart_tx_rx/data_tx
|
||||
TreeUpdate [SetDefaultTree]
|
||||
WaveRestoreCursors {{Cursor 1} {0 ps} 0}
|
||||
configure wave -namecolwidth 150
|
||||
|
||||
@@ -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