//////////////////////////////////////////////////////////////////////
// Created by SmartDesign Thu Apr  1 12:06:52 2021
// Version: v12.6 12.900.20.24
//////////////////////////////////////////////////////////////////////

`timescale 1ns / 100ps

// top
module top(
    // Inputs
    DEVRST_N,
    MDDR_DQS_TMATCH_0_IN,
    MMUART_1_RXD,
    // Outputs
    INIT_DONE,
    MDDR_ADDR,
    MDDR_BA,
    MDDR_CAS_N,
    MDDR_CKE,
    MDDR_CLK,
    MDDR_CLK_N,
    MDDR_CS_N,
    MDDR_DQS_TMATCH_0_OUT,
    MDDR_ODT,
    MDDR_RAS_N,
    MDDR_RESET_N,
    MDDR_WE_N,
    MMUART_1_TXD,
    // Inouts
    MDDR_DM_RDQS,
    MDDR_DQ,
    MDDR_DQS
);

//--------------------------------------------------------------------
// Input
//--------------------------------------------------------------------
input         DEVRST_N;
input         MDDR_DQS_TMATCH_0_IN;
input         MMUART_1_RXD;
//--------------------------------------------------------------------
// Output
//--------------------------------------------------------------------
output        INIT_DONE;
output [15:0] MDDR_ADDR;
output [2:0]  MDDR_BA;
output        MDDR_CAS_N;
output        MDDR_CKE;
output        MDDR_CLK;
output        MDDR_CLK_N;
output        MDDR_CS_N;
output        MDDR_DQS_TMATCH_0_OUT;
output        MDDR_ODT;
output        MDDR_RAS_N;
output        MDDR_RESET_N;
output        MDDR_WE_N;
output        MMUART_1_TXD;
//--------------------------------------------------------------------
// Inout
//--------------------------------------------------------------------
inout  [1:0]  MDDR_DM_RDQS;
inout  [15:0] MDDR_DQ;
inout  [1:0]  MDDR_DQS;
//--------------------------------------------------------------------
// Nets
//--------------------------------------------------------------------
wire          DEVRST_N;
wire          INIT_DONE_net_0;
wire   [15:0] MDDR_ADDR_net_0;
wire   [2:0]  MDDR_BA_net_0;
wire          MDDR_CAS_N_net_0;
wire          MDDR_CKE_net_0;
wire          MDDR_CLK_net_0;
wire          MDDR_CLK_N_net_0;
wire          MDDR_CS_N_net_0;
wire   [63:0] MDDR_Demo_top_0_AMBA_MASTER_0_RDATA_M0;
wire          MDDR_Demo_top_0_AMBA_MASTER_0_RLAST_M0;
wire          MDDR_Demo_top_0_AMBA_MASTER_0_RVALID_M0;
wire   [31:0] MDDR_Demo_top_0_AMBA_SLAVE_0_PADDR;
wire          MDDR_Demo_top_0_AMBA_SLAVE_0_PENABLE;
wire   [31:0] MDDR_Demo_top_0_AMBA_SLAVE_0_PRDATA;
wire          MDDR_Demo_top_0_AMBA_SLAVE_0_PREADY;
wire          MDDR_Demo_top_0_AMBA_SLAVE_0_PSELx;
wire          MDDR_Demo_top_0_AMBA_SLAVE_0_PSLVERR;
wire   [31:0] MDDR_Demo_top_0_AMBA_SLAVE_0_PWDATA;
wire          MDDR_Demo_top_0_AMBA_SLAVE_0_PWRITE;
wire          MDDR_Demo_top_0_AXI_RBUSY;
wire          MDDR_Demo_top_0_AXI_WBUSY;
wire          MDDR_Demo_top_0_BREADY;
wire          MDDR_Demo_top_0_FIC_0_CLK;
wire          MDDR_Demo_top_0_MSS_DDR_FIC_SUBSYSTEM_CLK;
wire          MDDR_Demo_top_0_RREADY;
wire   [1:0]  MDDR_DM_RDQS;
wire   [15:0] MDDR_DQ;
wire   [1:0]  MDDR_DQS;
wire          MDDR_DQS_TMATCH_0_IN;
wire          MDDR_DQS_TMATCH_0_OUT_net_0;
wire          MDDR_ODT_net_0;
wire          MDDR_RAS_N_net_0;
wire          MDDR_RESET_N_net_0;
wire          MDDR_WE_N_net_0;
wire          MMUART_1_RXD;
wire          MMUART_1_TXD_net_0;
wire   [63:0] UART_IF_0_DATA_INPUT;
wire          UART_IF_0_READ;
wire   [31:0] UART_IF_0_READ_ADDRESS;
wire   [3:0]  UART_IF_0_RLEN;
wire   [3:0]  UART_IF_0_WLEN;
wire          UART_IF_0_WRITE;
wire   [31:0] UART_IF_0_WRITE_ADDRESS;
wire          MMUART_1_TXD_net_1;
wire          MDDR_DQS_TMATCH_0_OUT_net_1;
wire          MDDR_CAS_N_net_1;
wire          MDDR_CLK_net_1;
wire          MDDR_CLK_N_net_1;
wire          MDDR_CKE_net_1;
wire          MDDR_CS_N_net_1;
wire          MDDR_ODT_net_1;
wire          MDDR_RAS_N_net_1;
wire          MDDR_RESET_N_net_1;
wire          MDDR_WE_N_net_1;
wire          INIT_DONE_net_1;
wire   [15:0] MDDR_ADDR_net_1;
wire   [2:0]  MDDR_BA_net_1;
//--------------------------------------------------------------------
// Top level output port assignments
//--------------------------------------------------------------------
assign MMUART_1_TXD_net_1          = MMUART_1_TXD_net_0;
assign MMUART_1_TXD                = MMUART_1_TXD_net_1;
assign MDDR_DQS_TMATCH_0_OUT_net_1 = MDDR_DQS_TMATCH_0_OUT_net_0;
assign MDDR_DQS_TMATCH_0_OUT       = MDDR_DQS_TMATCH_0_OUT_net_1;
assign MDDR_CAS_N_net_1            = MDDR_CAS_N_net_0;
assign MDDR_CAS_N                  = MDDR_CAS_N_net_1;
assign MDDR_CLK_net_1              = MDDR_CLK_net_0;
assign MDDR_CLK                    = MDDR_CLK_net_1;
assign MDDR_CLK_N_net_1            = MDDR_CLK_N_net_0;
assign MDDR_CLK_N                  = MDDR_CLK_N_net_1;
assign MDDR_CKE_net_1              = MDDR_CKE_net_0;
assign MDDR_CKE                    = MDDR_CKE_net_1;
assign MDDR_CS_N_net_1             = MDDR_CS_N_net_0;
assign MDDR_CS_N                   = MDDR_CS_N_net_1;
assign MDDR_ODT_net_1              = MDDR_ODT_net_0;
assign MDDR_ODT                    = MDDR_ODT_net_1;
assign MDDR_RAS_N_net_1            = MDDR_RAS_N_net_0;
assign MDDR_RAS_N                  = MDDR_RAS_N_net_1;
assign MDDR_RESET_N_net_1          = MDDR_RESET_N_net_0;
assign MDDR_RESET_N                = MDDR_RESET_N_net_1;
assign MDDR_WE_N_net_1             = MDDR_WE_N_net_0;
assign MDDR_WE_N                   = MDDR_WE_N_net_1;
assign INIT_DONE_net_1             = INIT_DONE_net_0;
assign INIT_DONE                   = INIT_DONE_net_1;
assign MDDR_ADDR_net_1             = MDDR_ADDR_net_0;
assign MDDR_ADDR[15:0]             = MDDR_ADDR_net_1;
assign MDDR_BA_net_1               = MDDR_BA_net_0;
assign MDDR_BA[2:0]                = MDDR_BA_net_1;
//--------------------------------------------------------------------
// Component instances
//--------------------------------------------------------------------
//--------MDDR_Demo_top
MDDR_Demo_top MDDR_Demo_top_0(
        // Inputs
        .MMUART_1_RXD              ( MMUART_1_RXD ),
        .MDDR_DQS_TMATCH_0_IN      ( MDDR_DQS_TMATCH_0_IN ),
        .DEVRST_N                  ( DEVRST_N ),
        .read_start                ( UART_IF_0_READ ),
        .write_start               ( UART_IF_0_WRITE ),
        .AMBA_SLAVE_0_PREADYS0     ( MDDR_Demo_top_0_AMBA_SLAVE_0_PREADY ),
        .AMBA_SLAVE_0_PSLVERRS0    ( MDDR_Demo_top_0_AMBA_SLAVE_0_PSLVERR ),
        .ARADDR_int                ( UART_IF_0_READ_ADDRESS ),
        .WLEN                      ( UART_IF_0_WLEN ),
        .AWADDR_int                ( UART_IF_0_WRITE_ADDRESS ),
        .RLEN                      ( UART_IF_0_RLEN ),
        .WDATA_int_input           ( UART_IF_0_DATA_INPUT ),
        .AMBA_SLAVE_0_PRDATAS0     ( MDDR_Demo_top_0_AMBA_SLAVE_0_PRDATA ),
        // Outputs
        .MMUART_1_TXD              ( MMUART_1_TXD_net_0 ),
        .MDDR_DQS_TMATCH_0_OUT     ( MDDR_DQS_TMATCH_0_OUT_net_0 ),
        .MDDR_CAS_N                ( MDDR_CAS_N_net_0 ),
        .MDDR_CLK                  ( MDDR_CLK_net_0 ),
        .MDDR_CLK_N                ( MDDR_CLK_N_net_0 ),
        .MDDR_CKE                  ( MDDR_CKE_net_0 ),
        .MDDR_CS_N                 ( MDDR_CS_N_net_0 ),
        .MDDR_ODT                  ( MDDR_ODT_net_0 ),
        .MDDR_RAS_N                ( MDDR_RAS_N_net_0 ),
        .MDDR_RESET_N              ( MDDR_RESET_N_net_0 ),
        .MDDR_WE_N                 ( MDDR_WE_N_net_0 ),
        .AXI_RBUSY                 ( MDDR_Demo_top_0_AXI_RBUSY ),
        .AXI_WBUSY                 ( MDDR_Demo_top_0_AXI_WBUSY ),
        .FIC_0_CLK                 ( MDDR_Demo_top_0_FIC_0_CLK ),
        .INIT_DONE                 ( INIT_DONE_net_0 ),
        .MSS_DDR_FIC_SUBSYSTEM_CLK ( MDDR_Demo_top_0_MSS_DDR_FIC_SUBSYSTEM_CLK ),
        .AMBA_MASTER_0_RVALID_M0   ( MDDR_Demo_top_0_AMBA_MASTER_0_RVALID_M0 ),
        .AMBA_MASTER_0_RLAST_M0    ( MDDR_Demo_top_0_AMBA_MASTER_0_RLAST_M0 ),
        .AMBA_SLAVE_0_PSELS0       ( MDDR_Demo_top_0_AMBA_SLAVE_0_PSELx ),
        .AMBA_SLAVE_0_PENABLES     ( MDDR_Demo_top_0_AMBA_SLAVE_0_PENABLE ),
        .AMBA_SLAVE_0_PWRITES      ( MDDR_Demo_top_0_AMBA_SLAVE_0_PWRITE ),
        .RREADY                    ( MDDR_Demo_top_0_RREADY ),
        .BREADY                    ( MDDR_Demo_top_0_BREADY ),
        .MDDR_ADDR                 ( MDDR_ADDR_net_0 ),
        .MDDR_BA                   ( MDDR_BA_net_0 ),
        .AMBA_MASTER_0_RDATA_M0    ( MDDR_Demo_top_0_AMBA_MASTER_0_RDATA_M0 ),
        .AMBA_SLAVE_0_PADDRS       ( MDDR_Demo_top_0_AMBA_SLAVE_0_PADDR ),
        .AMBA_SLAVE_0_PWDATAS      ( MDDR_Demo_top_0_AMBA_SLAVE_0_PWDATA ),
        // Inouts
        .MDDR_DM_RDQS              ( MDDR_DM_RDQS ),
        .MDDR_DQ                   ( MDDR_DQ ),
        .MDDR_DQS                  ( MDDR_DQS ) 
        );

//--------UART_IF
UART_IF UART_IF_0(
        // Inputs
        .WEN           ( MDDR_Demo_top_0_AMBA_MASTER_0_RVALID_M0 ),
        .CLK           ( MDDR_Demo_top_0_MSS_DDR_FIC_SUBSYSTEM_CLK ),
        .PCLK          ( MDDR_Demo_top_0_FIC_0_CLK ),
        .RREADY        ( MDDR_Demo_top_0_RREADY ),
        .AXI_RBUSY     ( MDDR_Demo_top_0_AXI_RBUSY ),
        .BREADY        ( MDDR_Demo_top_0_BREADY ),
        .RVALID        ( MDDR_Demo_top_0_AMBA_MASTER_0_RVALID_M0 ),
        .RLAST         ( MDDR_Demo_top_0_AMBA_MASTER_0_RLAST_M0 ),
        .RESET_N       ( INIT_DONE_net_0 ),
        .AXI_WBUSY     ( MDDR_Demo_top_0_AXI_WBUSY ),
        .PRESETN       ( INIT_DONE_net_0 ),
        .PENABLE       ( MDDR_Demo_top_0_AMBA_SLAVE_0_PENABLE ),
        .PWRITE        ( MDDR_Demo_top_0_AMBA_SLAVE_0_PWRITE ),
        .PSEL          ( MDDR_Demo_top_0_AMBA_SLAVE_0_PSELx ),
        .WD            ( MDDR_Demo_top_0_AMBA_MASTER_0_RDATA_M0 ),
        .PADDR         ( MDDR_Demo_top_0_AMBA_SLAVE_0_PADDR ),
        .PWDATA        ( MDDR_Demo_top_0_AMBA_SLAVE_0_PWDATA ),
        // Outputs
        .start_read    (  ),
        .READ          ( UART_IF_0_READ ),
        .WRITE         ( UART_IF_0_WRITE ),
        .PREADY        ( MDDR_Demo_top_0_AMBA_SLAVE_0_PREADY ),
        .PSLVERR       ( MDDR_Demo_top_0_AMBA_SLAVE_0_PSLVERR ),
        .WRITE_ADDRESS ( UART_IF_0_WRITE_ADDRESS ),
        .DATA_INPUT    ( UART_IF_0_DATA_INPUT ),
        .WLEN          ( UART_IF_0_WLEN ),
        .READ_ADDRESS  ( UART_IF_0_READ_ADDRESS ),
        .RLEN          ( UART_IF_0_RLEN ),
        .PRDATA        ( MDDR_Demo_top_0_AMBA_SLAVE_0_PRDATA ) 
        );


endmodule
