Skip to content

Commit

Permalink
fix uart baudrate issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
fm4dd committed Oct 6, 2024
1 parent 43b5762 commit c84cc2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
## toolchain
YOSYS = /home/fm/cc-toolchain-linux/bin/yosys/yosys
PR = /home/fm/cc-toolchain-linux/bin/p_r/p_r
OFL = /home/fm/cc-toolchain-linux/bin/openFPGALoader/openFPGALoader
# disable CC-provided openFPGALoader, switch to "OSS CAD Suite" version
# see https://github.com/fm4dd/gatemate-riscv/issues/5
#OFL = /home/fm/cc-toolchain-linux/bin/openFPGALoader/openFPGALoader
OFL = /home/fm/oss-cad-suite/bin/openFPGALoader

GTKW = gtkwave
IVL = iverilog
Expand Down
4 changes: 2 additions & 2 deletions rtl-shared/emmitter_uart.v
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ module corescore_emitter_uart
output wire o_uart_tx
);

localparam START_VALUE = clk_freq_hz/baud_rate;
localparam START_VALUE = (clk_freq_hz/baud_rate)-2;

localparam WIDTH = $clog2(START_VALUE);
localparam WIDTH = $clog2(START_VALUE+2);

reg [WIDTH:0] cnt = 0;

Expand Down

0 comments on commit c84cc2a

Please sign in to comment.