URL
https://opencores.org/ocsvn/a-z80/a-z80/trunk
[/] [a-z80/] [trunk/] [host/] [common/] [uart.v] - Diff between revs 8 and 14
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 8 |
Rev 14 |
Line 20... |
Line 20... |
assign busy = |bitcount[3:1];
|
assign busy = |bitcount[3:1];
|
wire sending = |bitcount;
|
wire sending = |bitcount;
|
|
|
// Calculate UART clock based on the input clock
|
// Calculate UART clock based on the input clock
|
reg [28:0] d;
|
reg [28:0] d;
|
wire [28:0] inc = d[28] ? (BAUD) : (BAUD - IN_CLOCK);
|
wire [28:0] inc = d[28] ? 29'(BAUD) : 29'(BAUD - IN_CLOCK);
|
wire [28:0] delta = d + inc;
|
wire [28:0] delta = d + inc;
|
|
|
always @(posedge clk)
|
always @(posedge clk)
|
begin
|
begin
|
if (reset)
|
if (reset)
|
Line 46... |
Line 46... |
shifter <= 0;
|
shifter <= 0;
|
end else
|
end else
|
begin
|
begin
|
if (wr & ~busy)
|
if (wr & ~busy)
|
begin
|
begin
|
|
// synopsys translate_off
|
$strobe("[UART] %c", data[7:0]);
|
$strobe("[UART] %c", data[7:0]);
|
|
// synopsys translate_on
|
shifter <= { data[7:0], 1'h0 };
|
shifter <= { data[7:0], 1'h0 };
|
bitcount <= 4'd11; // 1 + 8 + 2
|
bitcount <= 4'd11; // 1 + 8 + 2
|
end
|
end
|
|
|
if (sending & ser_clk)
|
if (sending & ser_clk)
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.