123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- module `TOP
- (
-
- input clock_16,
- input board_id,
-
- inout abc_clk,
- inout [15:0] abc_a,
- inout [7:0] abc_d,
- output abc_d_oe,
- inout abc_rst_n,
- inout abc_cs_n,
- inout [4:0] abc_out_n,
- inout [1:0] abc_inp_n,
- inout abc_xmemfl_n,
- inout abc_xmemw800_n,
- inout abc_xmemw80_n,
- inout abc_xinpstb_n,
- inout abc_xoutpstb_n,
-
-
- inout abc_rdy_x,
- inout abc_resin_x,
- inout abc_int80_x,
- inout abc_int800_x,
- inout abc_nmi_x,
- inout abc_xm_x,
-
- output abc_host,
-
-
-
- inout exth_ha,
- inout exth_hb,
- input exth_hc,
- inout exth_hd,
- inout exth_he,
- inout exth_hf,
- inout exth_hg,
- input exth_hh,
-
- output sr_clk,
- output [1:0] sr_ba,
- output [12:0] sr_a,
- inout [15:0] sr_dq,
- output [1:0] sr_dqm,
- output sr_cs_n,
- output sr_we_n,
- output sr_cas_n,
- output sr_ras_n,
-
- input sd_cd_n,
- output sd_cs_n,
- output sd_clk,
- output sd_di,
- input sd_do,
-
- output flash_cs_n,
- output flash_sck,
- inout [1:0] flash_io,
-
- inout spi_clk,
- inout [1:0] spi_io,
- inout spi_cs_esp_n,
- inout spi_cs_flash_n,
-
- inout esp_io0,
- inout esp_int,
-
- inout i2c_scl,
- inout i2c_sda,
- input rtc_32khz,
- input rtc_int_n,
-
- output [2:0] led,
-
- inout usb_dp,
- inout usb_dn,
- output usb_pu,
- input usb_rx,
-
- inout [5:0] gpio,
-
- output [2:0] hdmi_d,
- output hdmi_clk,
- inout hdmi_scl,
- inout hdmi_sda,
- inout hdmi_hpd,
-
- inout [2:0] rngio
- );
-
-
-
-
-
- wire reset_plls;
- wire master_pll_locked;
- wire master_clk;
- wire slow_clk;
- pll2_16 pll2 (
- .areset ( reset_plls ),
- .locked ( master_pll_locked ),
- .inclk0 ( clock_16 ),
- .c0 ( master_clk ),
- .c1 ( slow_clk )
- );
- wire usb_clk;
- wire sys_clk;
- `MAIN #(.x_mosfet(6'b000000),
- .fpga_ver(8'd2))
- `MAIN (
- .master_clk ( master_clk ),
- .slow_clk ( slow_clk ),
- .master_pll_locked ( master_pll_locked ),
- .reset_plls ( reset_plls ),
- .board_id ( board_id ),
- .abc_clk ( abc_clk ),
- .abc_a ( abc_a ),
- .abc_d ( abc_d ),
- .abc_d_oe ( abc_d_oe ),
- .abc_rst_n ( abc_rst_n ),
- .abc_cs_n ( abc_cs_n ),
- .abc_out_n ( abc_out_n ),
- .abc_inp_n ( abc_inp_n ),
- .abc_xmemfl_n ( abc_xmemfl_n ),
- .abc_xmemw800_n ( abc_xmemw800_n ),
- .abc_xmemw80_n ( abc_xmemw80_n ),
- .abc_xinpstb_n ( abc_xinpstb_n ),
- .abc_xoutpstb_n ( abc_xoutpstb_n ),
- .abc_rdy_x ( abc_rdy_x ),
- .abc_resin_x ( abc_resin_x ),
- .abc_int80_x ( abc_int80_x ),
- .abc_int800_x ( abc_int800_x ),
- .abc_nmi_x ( abc_nmi_x ),
- .abc_xm_x ( abc_xm_x ),
- .abc_host ( abc_host ),
- .exth_ha ( exth_ha ),
- .exth_hb ( exth_hb ),
- .exth_hc ( exth_hc ),
- .exth_hd ( exth_hd ),
- .exth_he ( exth_he ),
- .exth_hf ( exth_hf ),
- .exth_hg ( exth_hg ),
- .exth_hh ( exth_hh ),
- .sr_clk ( sr_clk ),
- .sr_ba ( sr_ba ),
- .sr_a ( sr_a ),
- .sr_dq ( sr_dq ),
- .sr_dqm ( sr_dqm ),
- .sr_cs_n ( sr_cs_n ),
- .sr_we_n ( sr_we_n ),
- .sr_cas_n ( sr_cas_n ),
- .sr_ras_n ( sr_ras_n ),
- .sd_cd_n ( 1'b0 ),
- .sd_cs_n ( sd_cs_n ),
- .sd_clk ( sd_clk ),
- .sd_di ( sd_di ),
- .sd_do ( sd_do ),
- .tty_txd ( gpio[0] ),
- .tty_rxd ( gpio[2] ),
- .tty_rts ( 1'b0 ),
- .tty_cts ( ),
- .tty_dtr ( gpio[4] ),
- .flash_cs_n ( flash_cs_n ),
- .flash_sck ( flash_sck ),
- .flash_io ( flash_io ),
- .spi_clk ( spi_clk ),
- .spi_io ( spi_io ),
- .spi_cs_esp_n ( spi_cs_esp_n ),
- .spi_cs_flash_n ( spi_cs_flash_n ),
- .esp_io0 ( esp_io0 ),
- .esp_int ( esp_int ),
- .i2c_scl ( i2c_scl ),
- .i2c_sda ( i2c_sda ),
- .rtc_32khz ( rtc_32khz ),
- .rtc_int_n ( rtc_int_n ),
- .led ( led ),
- .usb_dp ( usb_dp ),
- .usb_dn ( usb_dn ),
- .usb_rx ( usb_rx ),
- .usb_rx_ok ( 1'b1 ),
- .usb_pu ( usb_pu ),
- .hdmi_d ( hdmi_d ),
- .hdmi_clk ( hdmi_clk ),
- .hdmi_scl ( hdmi_scl ),
- .hdmi_sda ( hdmi_sda ),
- .hdmi_hpd ( hdmi_hpd ),
- .rngio ( rngio ),
- .sys_clk ( sys_clk ),
- .usb_clk ( usb_clk )
- );
-
- clk_buf sys_clk_buf ( .clk ( sys_clk ), .pin ( gpio[1] ) );
- clk_buf usb_clk_buf ( .clk ( usb_clk ), .pin ( gpio[3] ) );
-
- reg [23:0] ctr_8hz;
- reg test_4hz;
- always @(posedge sys_clk)
- begin
- if (ctr_8hz >= 24'd10_500_000)
- begin
- ctr_8hz <= 24'd1;
- test_4hz <= ~test_4hz;
- end
- else
- begin
- ctr_8hz <= ctr_8hz + 1'b1;
- end
- end
- assign gpio[5] = test_4hz;
- endmodule
|