Giter Site home page Giter Site logo

zipcpu / wbuart32 Goto Github PK

View Code? Open in Web Editor NEW
271.0 16.0 47.0 1.21 MB

A simple, basic, formally verified UART controller

License: GNU General Public License v3.0

Makefile 7.67% C++ 14.71% Verilog 74.80% Perl 2.38% HTML 0.44%
fpga uart uart-verilog verilator wishbone wishbone-bus verilog serialport

wbuart32's Introduction

Another Wishbone (or even AXI-lite) Controlled UART

Forasmuch as many have taken in hand to set forth a UART core, ... It seemed good to me also, having had perfect (a good) understanding of all things from the very first, to write ... my own UART core. [Ref]

  • This Verilog core contains two UART modules, one for transmit and one for receive. Each can be configured via one 32-bit word for just about any baud rate, one or two stop bits, five through eight data bits, and odd, even, mark, or space parity. If you are looking for an example Verilog UART module containing all these features, then you have just found it.

  • The module goes beyond simple transmit and receive, however, to also include a fairly generic synchronous FIFO. For those looking for a fairly simple FIFO, whether for your UART capability or something else, you've also just found it.

  • If you are looking for a wishbone--enabled peripheral, this module offers two configuration methods: one that can be included in another, larger, wishbone module, and another which is complete in its own right--together with an integrated FIFO and a FIFO status register.

  • If what you want is an AXI-lite peripheral, there is also an AXI-lite wrapper having the same register interface as the wbuart core listed above.

  • If you are familiar with other UART setup protocols, you'll find this one much easier to setup. For example, unlike the 16550 serial port, this serial port can be set up by just writing to and setting a single 32--bit register. Once set, either at startup or by writing the the port afterwards, and your UART is fully configured. Changes will take place on the next byte to be transmitted (or received).

  • If you would rather test your own UART transmitter and/or receiver, this core contains within it a Verilator enabled UART simulator which can be used in test-benches of your own UART implementation to know if you've done it right or not.

  • Finally, the test benches within bench/verilog of this directory can be used as very simple test benches to test for UART functionality on a board with only two pins (clock and output UART), or three pins (adding the input UART). Thus, if you are just trying to start up a project and need a demonstration that will prove if your UART will work, you can find several such a demonstration projects in this code. Further, two of those test benches will also create VCD files that can be inspected via gtkwave, so you can get a feel for how the whole thing works.

At one time, the biggest drawback to the files in these directories was that there wasn't a version of this UART interface containing a FIFO. Well, no more. Now there is a wbuart.v file that can be integrated into a wishbone/B4/pipeline bus and a similar axiluart.v file that can be used to integrate this into an AXI-lite environment. As mentioned above, this module contains a FIFO with a parameterized length that can extend up to 1024 entries. Indeed, recent changes have even added in optional hardware flow control, should you wish to use it.

Thus this is a very simple and easy to use controller.

Commercial Applications

Should you find the GPLv3 license insufficient for your needs, other licenses can be purchased from Gisselquist Technology, LLC.

wbuart32's People

Contributors

foobar2016 avatar lovemhz avatar pietrmar avatar wsnyder avatar zipcpu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wbuart32's Issues

Fifo full vs overflow behaviour

I'm using your ufifo.v module in my HRMCPU project and I noticed something I don't understand.

Is it correct to assume that o_err means that the fifo is full (and hence shouldn't be written to until some slot is freed up with a read?

I was using o_err signal as a fifo_is_full flag, but I noticed that once the fifo is full (o_err get value 1), even if you read values from the fifo, o_err (or r_ovfl) never gets 0 again, unless reset is asserted. is that normal?

I suspect I might be using the wrong signal (o_err) to know if the fifo is full or not... Am I?

Help needed in the standalone testbench part

Hi
I am trying to simulate the receiver part. In using your echo test as a standalone test how do I input values to the receiver?. Here you have shown the testing logic but how to give proper data and test. In the HelloWorld test, transmitting was very clear by turning ON/OFF suitable registers and by exactly putting data in tx_data. In the receiver testing side how to do that, please help. Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.