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

Subversion Repositories wb_async_mem_bridge

[/] [wb_async_mem_bridge/] [trunk/] [src/] [top.v] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 qaztronic
// --------------------------------------------------------------------
2
//
3
// --------------------------------------------------------------------
4
 
5
`include "timescale.v"
6
 
7
 
8
module top(
9
  ////////////////////////  Clock Input     ////////////////////////
10
  input [1:0]       clock_24,               //  24 MHz
11
  input [1:0]       clock_27,               //  27 MHz
12
  input             clock_50,               //  50 MHz
13
  input             ext_clock,              //  External Clock
14
  ////////////////////////  Push Button     ////////////////////////
15
  input [3:0]       key,                    //  Pushbutton[3:0]
16
  ////////////////////////  DPDT Switch     ////////////////////////
17
  input [9:0]       sw,                     //  Toggle Switch[9:0]
18
  ////////////////////////  7-SEG Dispaly   ////////////////////////
19
  output    [6:0]   hex0,                   //  Seven Segment Digit 0
20
  output    [6:0]   hex1,                   //  Seven Segment Digit 1
21
  output    [6:0]   hex2,                   //  Seven Segment Digit 2
22
  output    [6:0]   hex3,                   //  Seven Segment Digit 3
23
  ////////////////////////////  LED     ////////////////////////////
24
  output    [7:0]   ledg,                   //  LED Green[7:0]
25
  output    [9:0]   ledr,                   //  LED Red[9:0]
26
  ////////////////////////////  UART    ////////////////////////////
27
  output            uart_txd,               //  UART Transmitter
28
  input             uart_rxd,               //  UART Receiver
29
  ///////////////////////       SDRAM Interface ////////////////////////
30
  inout [15:0]      dram_dq,                //  SDRAM Data bus 16 Bits
31
  output    [11:0]  dram_addr,              //  SDRAM Address bus 12 Bits
32
  output            dram_ldqm,              //  SDRAM Low-byte Data Mask 
33
  output            dram_udqm,              //  SDRAM High-byte Data Mask
34
  output            dram_we_n,              //  SDRAM Write Enable
35
  output            dram_cas_n,             //  SDRAM Column Address Strobe
36
  output            dram_ras_n,             //  SDRAM Row Address Strobe
37
  output            dram_cs_n,              //  SDRAM Chip Select
38
  output            dram_ba_0,              //  SDRAM Bank Address 0
39
  output            dram_ba_1,              //  SDRAM Bank Address 0
40
  output            dram_clk,               //  SDRAM Clock
41
  output            dram_cke,               //  SDRAM Clock Enable
42
  ////////////////////////  Flash Interface ////////////////////////
43
  inout [7:0]       fl_dq,                  //  FLASH Data bus 8 Bits
44
  output    [21:0]  fl_addr,                //  FLASH Address bus 22 Bits
45
  output            fl_we_n,                //  FLASH Write Enable
46
  output            fl_rst_n,               //  FLASH Reset
47
  output            fl_oe_n,                //  FLASH Output Enable
48
  output            fl_ce_n,                //  FLASH Chip Enable
49
  ////////////////////////  SRAM Interface  ////////////////////////
50
  inout   [15:0]    sram_dq,                //  SRAM Data bus 16 Bits
51
  output  [17:0]    sram_addr,              //  SRAM Address bus 18 Bits
52
  output            sram_ub_n,              //  SRAM High-byte Data Mask 
53
  output            sram_lb_n,              //  SRAM Low-byte Data Mask 
54
  output            sram_we_n,              //  SRAM Write Enable
55
  output            sram_ce_n,              //  SRAM Chip Enable
56
  output            sram_oe_n,              //  SRAM Output Enable
57
  ////////////////////  SD Card Interface   ////////////////////////
58
  inout             sd_dat,                 //  SD Card Data
59
  inout             sd_dat3,                //  SD Card Data 3
60
  inout             sd_cmd,                 //  SD Card Command Signal
61
  output            sd_clk,                 //  SD Card Clock
62
  ////////////////////////  I2C     ////////////////////////////////
63
  inout             i2c_sdat,               //  I2C Data
64
  output            i2c_sclk,               //  I2C Clock
65
  ////////////////////////  PS2     ////////////////////////////////
66
  input             ps2_dat,                //  PS2 Data
67
  input             ps2_clk,                //  PS2 Clock
68
  ////////////////////  USB JTAG link   ////////////////////////////
69
  input             tdi,                    // CPLD -> FPGA (data in)
70
  input             tck,                    // CPLD -> FPGA (clk)
71
  input             tcs,                    // CPLD -> FPGA (CS)
72
  output            tdo,                    // FPGA -> CPLD (data out)
73
  ////////////////////////  VGA         ////////////////////////////
74
  output            vga_hs,                 //  VGA H_SYNC
75
  output            vga_vs,                 //  VGA V_SYNC
76
  output    [3:0]   vga_r,                  //  VGA Red[3:0]
77
  output    [3:0]   vga_g,                  //  VGA Green[3:0]
78
  output    [3:0]   vga_b,                  //  VGA Blue[3:0]
79
  ////////////////////  Audio CODEC     ////////////////////////////
80
  inout             aud_adclrck,            //  Audio CODEC ADC LR Clock
81
  input             aud_adcdat,             //  Audio CODEC ADC Data
82
  inout             aud_daclrck,            //  Audio CODEC DAC LR Clock
83
  output            aud_dacdat,             //  Audio CODEC DAC Data
84
  inout             aud_bclk,               //  Audio CODEC Bit-Stream Clock
85
  output            aud_xck,                //  Audio CODEC Chip Clock
86
  ////////////////////////  GPIO    ////////////////////////////////
87
  inout [35:0]      gpio_0,                 //  GPIO Connection 0
88
  inout [35:0]      gpio_1                  //  GPIO Connection 1
89
);
90
 
91
 
92
  //---------------------------------------------------
93
  // system wires
94
        wire                            reset_switch;
95
        wire        sysclk        = clock_24[0];
96
 
97
 
98
  //---------------------------------------------------
99
  // sync reset
100
  sync
101
    i_sync_reset(
102
            .async_sig(~key[0]),
103
            .sync_out(reset_switch),
104
            .clk(sysclk)
105
          );
106
 
107
 
108
  //---------------------------------------------------
109
  // FLED
110
        reg [24:0] counter;
111
        wire [7:0]  fled;
112
 
113
        always @(posedge sysclk or posedge reset_switch)
114
          if(reset_switch)
115
                counter <= 25'b0;
116
        else
117
                counter <= counter + 1;
118
 
119
        assign fled[0]  = sw[0];
120
        assign fled[1]  = sw[1];
121
        assign fled[2]  = sw[2];
122
        assign fled[3]  = sw[3];
123
        assign fled[4]  = sw[4];
124
        assign fled[5]  = sw[5];
125
        assign fled[6]  = sw[6];
126
        assign fled[7]  = counter[24];
127
 
128
 
129
  //---------------------------------------------------
130
  // test_harness
131
  test_harness i_test_harness(
132
    .gpio_0(gpio_0),
133
    .gpio_1(gpio_1),
134
 
135
    .sys_clk_i(sysclk),
136
    .sys_rst_i(reset_switch)
137
  );
138
 
139
 
140
  //---------------------------------------------------
141
  // outputs
142
 
143
  //  Turn off all display
144
  assign  hex0        =   7'h7f;
145
  assign  hex1        =   7'h7f;
146
  assign  hex2        =   7'h7f;
147
  assign  hex3        =   7'h7f;
148
//   assign  ledg        =   8'hff;
149
  assign  ledg        =   fled;
150
  assign  ledr        =   10'h000;
151
 
152
  //  All inout port turn to tri-state
153
  assign  dram_dq     =   16'hzzzz;
154
  assign  fl_dq       =   8'hzz;
155
  assign  sram_dq     =   16'hzzzz;
156
  assign  sd_dat      =   1'bz;
157
  assign  i2c_sdat    =   1'bz;
158
  assign  aud_adclrck =   1'bz;
159
  assign  aud_daclrck =   1'bz;
160
  assign  aud_bclk    =   1'bz;
161
  assign  gpio_0      =   36'hzzzzzzzzz;
162
  assign  gpio_1      =   36'hzzzzzzzzz;
163
 
164
 
165
endmodule
166
 

powered by: WebSVN 2.1.0

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