uart: make baudrate a generic
This commit is contained in:
parent
1d36528b2c
commit
1d69c453a8
@ -3,6 +3,11 @@ use ieee.std_logic_1164.all;
|
|||||||
use ieee.numeric_std.all;
|
use ieee.numeric_std.all;
|
||||||
|
|
||||||
entity uart is
|
entity uart is
|
||||||
|
generic
|
||||||
|
(
|
||||||
|
baudrate : in natural := 1_000_000
|
||||||
|
);
|
||||||
|
|
||||||
port
|
port
|
||||||
(
|
(
|
||||||
clk : in std_logic;
|
clk : in std_logic;
|
||||||
@ -32,7 +37,7 @@ end uart;
|
|||||||
-- Mnemonic: receive from the left, transmit to the right
|
-- Mnemonic: receive from the left, transmit to the right
|
||||||
|
|
||||||
architecture Behavioral of uart is
|
architecture Behavioral of uart is
|
||||||
constant BAUD: positive := 1_000_000;
|
constant BAUD: positive := baudrate;
|
||||||
constant SYSFREQ: natural := 100_000_000;
|
constant SYSFREQ: natural := 100_000_000;
|
||||||
constant CLKCNT: natural := SYSFREQ / BAUD;
|
constant CLKCNT: natural := SYSFREQ / BAUD;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user