You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
3.6 KiB
114 lines
3.6 KiB
`timescale 1ns / 1ns
|
|
module Top (
|
|
input sys_clk,
|
|
input rst_n,
|
|
|
|
//SPI 串行总线1
|
|
input wire spi1_cs_pin,
|
|
input wire spi1_clk_pin,
|
|
input wire spi1_rx_pin,
|
|
output wire spi1_tx_pin,
|
|
|
|
//SPI 串行总线2
|
|
input wire spi2_cs_pin,
|
|
input wire spi2_clk_pin,
|
|
input wire spi2_rx_pin,
|
|
output wire spi2_tx_pin,
|
|
|
|
output wire core_board_debug_led
|
|
);
|
|
|
|
SPLL spll (
|
|
.clkin1(sys_clk), // input
|
|
.pll_lock(pll_lock), // output
|
|
.clkout0(sys_clk_25m), // output
|
|
.clkout1(sys_clk_10m), // output
|
|
.clkout2(sys_clk_5m) // output
|
|
);
|
|
|
|
|
|
/*******************************************************************************
|
|
* 调试器 *
|
|
*******************************************************************************/
|
|
// wire [6:0] trig0_i;
|
|
// JtagHubIst jtag_hub_ist (
|
|
// .resetn_i(rst_n), // input
|
|
// .drck_o (drck_o), // output
|
|
// .hub_tdi (hub_tdi), // output
|
|
// .capt_o (capt_o), // output
|
|
// .shift_o (shift_o), // output
|
|
// .conf_sel(conf_sel), // output [14:0]
|
|
// .id_o (id_o), // output [4:0]
|
|
// .hub_tdo (hub_tdo) // input [14:0]
|
|
// );
|
|
|
|
// DebugCoreIst debug_core_ist (
|
|
// .hub_tdi (hub_tdi), // input
|
|
// .hub_tdo (hub_tdo[0]), // output
|
|
// .id_i (id_o), // input [4:0]
|
|
// .capt_i (capt_o), // input
|
|
// .shift_i (shift_o), // input
|
|
// .conf_sel(conf_sel[0]), // input
|
|
// .drck_in (drck_o), // input
|
|
// .clk (sys_clk), // input
|
|
// .resetn_i(rst_n), // input
|
|
// .trig0_i (trig0_i)
|
|
// );
|
|
|
|
|
|
/*******************************************************************************
|
|
* DEBUG_LED *
|
|
*******************************************************************************/
|
|
zutils_debug_led #(
|
|
.PERIOD_COUNT(10000000)
|
|
) core_board_debug_led_inst (
|
|
.clk(sys_clk),
|
|
.rst_n(rst_n),
|
|
.debug_led(core_board_debug_led)
|
|
);
|
|
|
|
/*******************************************************************************
|
|
* SPIREADER *
|
|
*******************************************************************************/
|
|
|
|
wire [31:0] reg_reader_bus_addr;
|
|
wire [31:0] reg_reader_bus_wr_data;
|
|
wire reg_reader_bus_wr_en;
|
|
wire [31:0] reg_reader_bus_rd_data;
|
|
spi_reg_reader spi1_reg_reader_inst (
|
|
.clk (sys_clk),
|
|
.rst_n(rst_n),
|
|
|
|
.addr(reg_reader_bus_addr),
|
|
.wr_data(reg_reader_bus_wr_data),
|
|
.wr_en(reg_reader_bus_wr_en),
|
|
.rd_data(reg_reader_bus_rd_data),
|
|
//
|
|
.spi_cs_pin(spi1_cs_pin),
|
|
.spi_clk_pin(spi1_clk_pin),
|
|
.spi_rx_pin(spi1_rx_pin),
|
|
.spi_tx_pin(spi1_tx_pin)
|
|
);
|
|
|
|
/*******************************************************************************
|
|
* TEST_SPI_REG *
|
|
*******************************************************************************/
|
|
zutils_register16 #(
|
|
.REG_START_ADD(16'h0020)
|
|
) core_board_debug_led_reg (
|
|
.clk(sys_clk),
|
|
.rst_n(rst_n),
|
|
.addr(reg_reader_bus_addr),
|
|
.wr_data(reg_reader_bus_wr_data),
|
|
.wr_en(reg_reader_bus_wr_en),
|
|
.rd_data(reg_reader_bus_rd_data)
|
|
);
|
|
|
|
assign trig0_i[0] = sys_clk_5m;
|
|
assign trig0_i[1] = spi2_clk_pin;
|
|
assign trig0_i[2] = spi1_rx_pin;
|
|
assign trig0_i[3] = spi1_tx_pin;
|
|
assign trig0_i[4] = spi1_cs_pin;
|
|
|
|
|
|
endmodule
|