• Stars
    star
    406
  • Rank 106,421 (Top 3 %)
  • Language Verilog
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Verilog UART

Verilog UART Readme

Build Status

For more information and updates: http://alexforencich.com/wiki/en/verilog/uart/start

GitHub repository: https://github.com/alexforencich/verilog-uart

Introduction

This is a basic UART to AXI Stream IP core, written in Verilog with cocotb testbenches.

Documentation

The main code for the core exists in the rtl subdirectory. The uart_rx.v and uart_tx.v files are the actual implementation, uart.v simply instantiates both modules and makes a couple of internal connections.

The UART transmitter and receiver both use a single transmit or receive pin. The modules take one parameter, DATA_WIDTH, that specifies the width of both the data bus and the length of the actual data words communicated. The default value is 8 for an 8 bit interface. The prescale input determines the data rate - it should be set to Fclk / (baud * 8). This is an input instead of a parameter so it can be changed at run time, though it is not buffered internally so care should be used to avoid corrupt data. The main interface to the user design is an AXI4-Stream interface that consists of the tdata, tvalid, and tready signals. tready flows in the opposite direction. tdata is considered valid when tvalid is high. The destination will accept data only when tready is high. Data is transferred from the source to the destination only when both tvalid and tready are high, otherwise the bus is stalled.

Both interfaces also present a 'busy' signal that is high when an operation is taking place. The receiver also presents overrun error and frame error strobe outputs. If the data word currently in the tdata output register is not read before another word is received, then a single cycle pulse will be emitted from overrun_error and the word is discarded. If the receiver does not get a stop bit of the right level, then a single pulse will be emitted from the frame_error output and the received word will be discarded.

Source Files

rtl/uart.v     : Wrapper for complete UART
rtl/uart_rx.v  : UART receiver implementation
rtl/uart_tx.v  : UART transmitter implementation

AXI Stream Interface Example

two byte transfer with sink pause after each byte

          __    __    __    __    __    __    __    __    __
clk    __/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__/  \__
                _____ _________________
tdata  XXXXXXXXX_D0__X_D1______________XXXXXXXXXXXXXXXXXXXXXXXX
                _______________________
tvalid ________/                       \_______________________
       ______________             _____             ___________
tready               \___________/     \___________/

Testing

Running the included testbenches requires cocotb, cocotbext-axi, and Icarus Verilog. The testbenches can be run with pytest directly (requires cocotb-test), pytest via tox, or via cocotb makefiles.

More Repositories

1

verilog-ethernet

Verilog Ethernet components for FPGA implementation
Verilog
2,236
star
2

verilog-axi

Verilog AXI components for FPGA implementation
Verilog
1,452
star
3

verilog-pcie

Verilog PCI express components
Verilog
1,091
star
4

verilog-axis

Verilog AXI stream components for FPGA implementation
Python
722
star
5

verilog-i2c

Verilog I2C interface for FPGA implementation
Verilog
522
star
6

cocotbext-axi

AXI interface modules for Cocotb
Python
208
star
7

cocotbext-pcie

PCI express simulation framework for Cocotb
Python
136
star
8

verilog-lfsr

Fully parametrizable combinatorial parallel LFSR/CRC module
Python
135
star
9

xboot

XBoot Extensible Bootloader
C
127
star
10

verilog-wishbone

Verilog wishbone components
Python
108
star
11

verilog-cam

Verilog Content Addressable Memory Module
Verilog
100
star
12

verilog-dsp

Verilog digital signal processing components
Python
96
star
13

cocotbext-eth

Ethernet interface modules for Cocotb
Python
55
star
14

xfcp

Extensible FPGA control platform
Verilog
52
star
15

ftjrev

JTAG reverse engineering software for FTDI compatible cables
C
49
star
16

pin-uart

FPGA board-level debugging and reverse-engineering tool
Tcl
28
star
17

cocotbext-i2c

I2C models for cocotb
Python
26
star
18

verilog-ft245

Verilog FT245 to AXI stream interface
Python
26
star
19

dma-bench

Verilog
25
star
20

verilog-mersenne

Verilog implementation of Mersenne Twister PRNG
Python
25
star
21

cocotbext-uart

UART models for cocotb
Python
23
star
22

python-hpgl

Python HPGL parsing library
Python
18
star
23

fpga-utils

Various utilities for working with FPGAs
Python
10
star
24

verilog-flowgen

Ethernet flow generator framework
Python
9
star
25

templates

Templates for Embedded Development
C++
8
star
26

hdg2000

HDG2000
Python
7
star
27

binaryninja-m68k

Motorola 68k architecture support for binary ninja
Python
7
star
28

zigbee-terminal

Cross-platform ZigBee terminal
C++
7
star
29

xgrid

AVR XMEGA Grid Computing
C++
7
star
30

verilog-priorityqueue

3
star
31

groupmgr

Group manager plugin for Dokuwiki
PHP
2
star
32

verilog-hashtable

2
star
33

xmlconf

C
2
star