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

Subversion Repositories oms8051mini

[/] [oms8051mini/] [trunk/] [rtl/] [uart/] [uart_cfg.v] - Diff between revs 2 and 6

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

Rev 2 Rev 6
Line 12... Line 12...
////    nothing                                                   ////
////    nothing                                                   ////
////                                                              ////
////                                                              ////
////  Author(s):                                                  ////
////  Author(s):                                                  ////
////      - Dinesh Annayya, dinesha@opencores.org                 ////
////      - Dinesh Annayya, dinesha@opencores.org                 ////
////                                                              ////
////                                                              ////
////  Revision : Nov 26, 2016                                      //// 
////  Revision :                                                  //// 
 
////     v-0.0 : Nov 26, 2016                                     ////
 
////       1. Initial version picked from                         ////
 
////       http://www.opencores.org/cores/turbo8051/              ////
 
////     v-0.1 : Nov 28, 2016                                     ////
 
////       1. Register access for Read/Write fifo & baudrate      ////
////                                                              ////
////                                                              ////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////                                                              ////
////                                                              ////
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
////                                                              ////
////                                                              ////
Line 57... Line 62...
 
 
            // Outputs
            // Outputs
            reg_rdata,
            reg_rdata,
            reg_ack,
            reg_ack,
 
 
 
         // Uart Tx fifo interface
 
            tx_fifo_full,
 
            tx_fifo_wr_en,
 
            tx_fifo_data,
 
 
 
         // Uart Rx fifo interface
 
            rx_fifo_empty,
 
            rx_fifo_rd_en,
 
            rx_fifo_data,
 
 
       // configuration
       // configuration
            cfg_tx_enable,
            cfg_tx_enable,
            cfg_rx_enable,
            cfg_rx_enable,
            cfg_stop_bit ,
            cfg_stop_bit ,
            cfg_pri_mod  ,
            cfg_pri_mod  ,
 
            cfg_baud_16x ,
 
 
            frm_error_o,
            frm_error_o,
            par_error_o,
            par_error_o,
            rx_fifo_full_err_o
            rx_fifo_full_err_o
 
 
Line 75... Line 90...
 
 
 
 
input         mclk;
input         mclk;
input         reset_n;
input         reset_n;
 
 
 
//--------------------------------
 
// Uart Tx fifo interface
 
//--------------------------------
 
input            tx_fifo_full;
 
output           tx_fifo_wr_en;
 
output [7:0]     tx_fifo_data;
 
 
 
//--------------------------------
 
// Uart Rx fifo interface
 
//--------------------------------
 
input            rx_fifo_empty;
 
output           rx_fifo_rd_en;
 
input [7:0]      rx_fifo_data;
 
 
 
//----------------------------------
       // configuration
       // configuration
 
//----------------------------------
output        cfg_tx_enable       ; // Tx Enable
output        cfg_tx_enable       ; // Tx Enable
output        cfg_rx_enable       ; // Rx Enable
output        cfg_rx_enable       ; // Rx Enable
output        cfg_stop_bit        ; // 0 -> 1 Stop, 1 -> 2 Stop
output        cfg_stop_bit        ; // 0 -> 1 Stop, 1 -> 2 Stop
output  [1:0] cfg_pri_mod         ; // priority mode, 0 -> nop, 1 -> Even, 2 -> Odd
output  [1:0] cfg_pri_mod         ; // priority mode, 0 -> nop, 1 -> Even, 2 -> Odd
 
output  [11:0] cfg_baud_16x       ; // 16x Baud clock config
 
 
input         frm_error_o         ; // framing error
input         frm_error_o         ; // framing error
input         par_error_o         ; // par error
input         par_error_o         ; // par error
input         rx_fifo_full_err_o  ; // rx fifo full error
input         rx_fifo_full_err_o  ; // rx fifo full error
 
 
Line 301... Line 333...
                 );
                 );
 
 
assign reg_1[31:3] = 29'h0;
assign reg_1[31:3] = 29'h0;
 
 
 
 
 
//-----------------------------------------------------------------------
 
// Logic for Register 2 :  Baud Rate Control
 
//-----------------------------------------------------------------------
 
wire [11:0]   cfg_baud_16x    = reg_2[11:0];
 
 
 
generic_register #(12,0  ) u_uart_ctrl_reg2 (
 
              .we            ({12{sw_wr_en_2 &
 
                                 wr_be[0]   }}  ),
 
              .data_in       (reg_wdata[11:0]    ),
 
              .reset_n       (reset_n           ),
 
              .clk           (mclk              ),
 
 
 
              //List of Outs
 
              .data_out      (reg_2[11:0]        )
 
          );
 
 
 
 
 
assign reg_2[31:12] = 20'h0;
 
 
 
 
 
 
 
assign reg_3[31:0] = {30'h0,rx_fifo_empty,tx_fifo_full};
 
 
 
// reg_4 is tx_fifo wr
 
assign tx_fifo_wr_en  = sw_wr_en_4;
 
assign tx_fifo_data   = reg_wdata[7:0];
 
 
 
// reg_5 is rx_fifo read
 
// rx_fifo read data
 
assign reg_5[31:0] = {24'h0,rx_fifo_data};
 
assign  rx_fifo_rd_en = sw_rd_en_5;
 
 
 
 
endmodule
endmodule
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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