uart: make baudrate a generic
This commit is contained in:
		| @@ -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; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user