Merge pull request #158 from rxrbln/uart

added default clk divider parameter to simpleuart
This commit is contained in:
Claire Wolf 2020-04-15 18:49:23 +02:00 committed by GitHub
commit 824a5c8011
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 clk,
input resetn, input resetn,
@ -54,7 +54,7 @@ module simpleuart (
always @(posedge clk) begin always @(posedge clk) begin
if (!resetn) begin if (!resetn) begin
cfg_divider <= 1; cfg_divider <= DEFAULT_DIV;
end else begin end else begin
if (reg_div_we[0]) cfg_divider[ 7: 0] <= reg_div_di[ 7: 0]; 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]; if (reg_div_we[1]) cfg_divider[15: 8] <= reg_div_di[15: 8];