OpenCores
URL https://opencores.org/ocsvn/wbuart32/wbuart32/trunk

Subversion Repositories wbuart32

[/] [wbuart32/] [trunk/] [bench/] [verilog/] [linetest.v] - Diff between revs 10 and 13

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 10 Rev 13
Line 39... Line 39...
//
//
//
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
//
//
//
// Uncomment the next line if you want this program to work as a standalone
// One issue with the design is how to set the values of the setup register.
// (not verilated) RTL "program" to test your UART.  You'll also need to set
// (*This is a comment, not a verilator attribute ... )  Verilator needs to
// your setup condition properly, though.  I recommend setting it to the 
// know/set those values in order to work.  However, this design can also be
// ratio of your onboard clock to your desired baud rate.  For more information
// used as a stand-alone top level configuration file.  In this latter case,
// about how to set this, please see the specification.
// the setup register needs to be set internal to the file.  Here, we use
 
// OPT_STANDALONE to distinguish between the two.  If set, the file runs under
 
// (* Another comment still ...) Verilator and we need to get i_setup from the
 
// external environment.  If not, it must be set internally.
//
//
// `define OPT_STANDALONE
`ifndef VERILATOR
 
`define OPT_STANDALONE
 
`endif
//
//
module  linetest(i_clk,
module  linetest(i_clk,
`ifndef OPT_STANDALONE
`ifndef OPT_STANDALONE
                        i_setup,
                        i_setup,
`endif
`endif
Line 64... Line 69...
        // If i_setup isnt set up as an input parameter, it needs to be set.
        // If i_setup isnt set up as an input parameter, it needs to be set.
        // We do so here, to a setting appropriate to create a 115200 Baud
        // We do so here, to a setting appropriate to create a 115200 Baud
        // comms system from a 100MHz clock.  This also sets us to an 8-bit
        // comms system from a 100MHz clock.  This also sets us to an 8-bit
        // data word, 1-stop bit, and no parity.
        // data word, 1-stop bit, and no parity.
`ifdef  OPT_STANDALONE
`ifdef  OPT_STANDALONE
        wire    [29:0]   i_setup;
        wire    [30:0]   i_setup;
        assign          i_setup = 31'd868;      // 115200 Baud, if clk @ 100MHz
        assign          i_setup = 31'd868;      // 115200 Baud, if clk @ 100MHz
`endif
`endif
 
 
        reg     [7:0]    buffer  [0:255];
        reg     [7:0]    buffer  [0:255];
        reg     [7:0]    head, tail;
        reg     [7:0]    head, tail;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.