OpenCores

The openrisc bugtracker has been moved to: bugzilla.opencores.org. This page is read-only

orpsocv2 uart_decoder starts on X

Back to bugtracker overview.

Information:
Type :: BUG
Status :: CLOSED
Assigned to :: Julius, Baxter

Description:
The uart-nocache test, when launched with "UART_PRINTF=1", prints gibberish (it should print "Hello World.") because uart_decoder task starts decoding at the first X (beginning of the simulation) instead of waiting for the start bit.
Here is a patch (svn diff) that fixes the problem:

Index: uart_decoder.v
===================================================================
--- uart_decoder.v (revision 59)
+++ uart_decoder.v (working copy)
@@ -74,9 +74,12 @@
task uart_decoder;
reg [7:0] tx_byte;
begin
-
+
+ while (`UART_TX_LINE !== 1'b1)
+ @(`UART_TX_LINE);
+
// Wait for start bit
- while (`UART_TX_LINE == 1'b1)
+ while (`UART_TX_LINE !== 1'b0)
@(`UART_TX_LINE);
#(UART_TX_WAIT+(UART_TX_WAIT/2));
tx_byte[0] = `UART_TX_LINE;
@@ -96,11 +99,11 @@
tx_byte[7] = `UART_TX_LINE;
#UART_TX_WAIT;
//Check for stop bit
- if (`UART_TX_LINE == 1'b0)
+ if (`UART_TX_LINE !== 1'b1)
begin
//$display("* WARNING: user stop bit not received when expected at time %d__", $time);
// Wait for return to idle
- while (`UART_TX_LINE == 1'b0)
+ while (`UART_TX_LINE !== 1'b1)
@(`UART_TX_LINE);
//$display("* USER UART returned to idle at time %d",$time);
end

Comments:

Baxter, Julius Jan 23, 2010
Applied to ORSPoCv2 and it appears to work. Thanks.

Post a comment:
Login to post comments!

Back to bugtracker overview.

© copyright 1999-2012 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.