added default clk divider parameter to simpleuart

This commit is contained in:
René Rebe 2020-04-15 13:11:55 +02:00
parent e308982e18
commit a7ff70dfb4
1 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@
*
*/
module simpleuart (
module simpleuart #(parameter integer DEFAULT_DIV = 1) (
input clk,
input resetn,
@ -54,7 +54,7 @@ module simpleuart (
always @(posedge clk) begin
if (!resetn) begin
cfg_divider <= 1;
cfg_divider <= DEFAULT_DIV;
end else begin
if (reg_div_we[0]) cfg_divider[ 7: 0] <= reg_div_di[ 7: 0];
if (reg_div_we[1]) cfg_divider[15: 8] <= reg_div_di[15: 8];