From 1d69c453a86a7299edb43333cdc3a0782921de54 Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Sun, 25 Jul 2021 23:50:09 -0700 Subject: [PATCH] uart: make baudrate a generic --- uart/uart.vhdl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/uart/uart.vhdl b/uart/uart.vhdl index 6f6151e..0daa97e 100644 --- a/uart/uart.vhdl +++ b/uart/uart.vhdl @@ -3,6 +3,11 @@ use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity uart is + generic + ( + baudrate : in natural := 1_000_000 + ); + port ( clk : in std_logic; @@ -32,7 +37,7 @@ end uart; -- Mnemonic: receive from the left, transmit to the right architecture Behavioral of uart is - constant BAUD: positive := 1_000_000; + constant BAUD: positive := baudrate; constant SYSFREQ: natural := 100_000_000; constant CLKCNT: natural := SYSFREQ / BAUD;