|
|
@ -124,35 +124,6 @@ module Top ( |
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************* |
|
|
|
* 调试器 * |
|
|
|
*******************************************************************************/ |
|
|
|
// wire [6:0] trig0_i; |
|
|
|
// JtagHubIst jtag_hub_ist ( |
|
|
|
// .resetn_i(sys_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(sys_rst_n), // input |
|
|
|
// .trig0_i (trig0_i) |
|
|
|
// ); |
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************* |
|
|
|
* DEBUG_LED * |
|
|
|
*******************************************************************************/ |
|
|
|
// zutils_debug_led #( |
|
|
@ -211,22 +182,22 @@ module Top ( |
|
|
|
*******************************************************************************/ |
|
|
|
zutils_register16 #( |
|
|
|
.REG_START_ADD(`REG_ADD_OFF_FPGA_TEST), |
|
|
|
.REG0_INIT(31'h0000_0000), |
|
|
|
.REG1_INIT(31'h1111_1111), |
|
|
|
.REG2_INIT(31'h2222_2222), |
|
|
|
.REG3_INIT(31'h3333_3333), |
|
|
|
.REG4_INIT(31'h4444_4444), |
|
|
|
.REG5_INIT(31'h5555_5555), |
|
|
|
.REG6_INIT(31'h6666_6666), |
|
|
|
.REG7_INIT(31'h7777_7777), |
|
|
|
.REG8_INIT(31'h8888_8888), |
|
|
|
.REG9_INIT(31'h9999_9999), |
|
|
|
.REGA_INIT(31'haaaa_aaaa), |
|
|
|
.REGB_INIT(31'hbbbb_bbbb), |
|
|
|
.REGC_INIT(31'hcccc_cccc), |
|
|
|
.REGD_INIT(31'hdddd_dddd), |
|
|
|
.REGE_INIT(31'heeee_eeee), |
|
|
|
.REGF_INIT(31'hffff_ffff) |
|
|
|
.REG0_INIT(31'h0000_0000_0000_0001), |
|
|
|
.REG1_INIT(31'h0000_0000_0000_0010), |
|
|
|
.REG2_INIT(31'h0000_0000_0000_0100), |
|
|
|
.REG3_INIT(31'h0000_0000_0000_1000), |
|
|
|
.REG4_INIT(31'h0000_0000_0001_0000), |
|
|
|
.REG5_INIT(31'h0000_0000_0010_0000), |
|
|
|
.REG6_INIT(31'h0000_0000_0100_0000), |
|
|
|
.REG7_INIT(31'h0000_0000_1000_0000), |
|
|
|
.REG8_INIT(31'h0000_0001_0000_0000), |
|
|
|
.REG9_INIT(31'h0000_0010_0000_0000), |
|
|
|
.REGA_INIT(31'h0000_0100_0000_0000), |
|
|
|
.REGB_INIT(31'h0000_1000_0000_0000), |
|
|
|
.REGC_INIT(31'h0001_0000_0000_0000), |
|
|
|
.REGD_INIT(31'h0010_0000_0000_0000), |
|
|
|
.REGE_INIT(31'h0100_0000_0000_0000), |
|
|
|
.REGF_INIT(31'h1000_0000_0000_0000) |
|
|
|
) test_reg ( |
|
|
|
.clk(sys_clk), |
|
|
|
.rst_n(sys_rst_n), |
|
|
@ -241,118 +212,132 @@ module Top ( |
|
|
|
* 输出组件 * |
|
|
|
*******************************************************************************/ |
|
|
|
|
|
|
|
wire [7:0] ttl_output_signal_in; |
|
|
|
wire [31:0] ttl_output_module_source_sig; |
|
|
|
wire [31:0] ttl_output_module_source_sig_af; |
|
|
|
|
|
|
|
// ttl_output #( |
|
|
|
// .REG_START_ADD(`REG_ADD_OFF_TTLIN1), |
|
|
|
// .TEST(HARDWARE_TEST_MODE), |
|
|
|
// .ID(1) |
|
|
|
// ) ttl_output_1 ( |
|
|
|
// .clk (sys_clk), |
|
|
|
// .rst_n(sys_rst_n), |
|
|
|
zutils_muti_debug_signal_gen ttl_sig_source ( |
|
|
|
.clk(sys_clk), |
|
|
|
.rst_n(sys_rst_n), |
|
|
|
|
|
|
|
// .addr(reg_reader_bus_addr), |
|
|
|
// .wr_data(reg_reader_bus_wr_data), |
|
|
|
// .wr_en(reg_reader_bus_wr_en), |
|
|
|
// .rd_data(ttlout1_rd_data), |
|
|
|
.testflag(HARDWARE_TEST_MODE), |
|
|
|
|
|
|
|
// .signal_in(ttl_output_signal_in), |
|
|
|
.rawsig(ttl_output_module_source_sig), |
|
|
|
.output_signal(ttl_output_module_source_sig_af) |
|
|
|
); |
|
|
|
|
|
|
|
// .ttloutput(sync_ttl_out1), |
|
|
|
// .ttloutput_state_led(sync_ttl_out1_state_led) |
|
|
|
// ); |
|
|
|
ttl_output #( |
|
|
|
.REG_START_ADD(`REG_ADD_OFF_TTLOUT1), |
|
|
|
.TEST(HARDWARE_TEST_MODE), |
|
|
|
.ID(1) |
|
|
|
) ttl_output_1 ( |
|
|
|
.clk (sys_clk), |
|
|
|
.rst_n(sys_rst_n), |
|
|
|
|
|
|
|
// ttl_output #( |
|
|
|
// .REG_START_ADD(`REG_ADD_OFF_TTLIN2), |
|
|
|
// .TEST(HARDWARE_TEST_MODE), |
|
|
|
// .ID(2) |
|
|
|
// ) ttl_output_2 ( |
|
|
|
// .clk (sys_clk), |
|
|
|
// .rst_n(sys_rst_n), |
|
|
|
.addr(reg_reader_bus_addr), |
|
|
|
.wr_data(reg_reader_bus_wr_data), |
|
|
|
.wr_en(reg_reader_bus_wr_en), |
|
|
|
.rd_data(ttlout1_rd_data), |
|
|
|
|
|
|
|
// .addr(reg_reader_bus_addr), |
|
|
|
// .wr_data(reg_reader_bus_wr_data), |
|
|
|
// .wr_en(reg_reader_bus_wr_en), |
|
|
|
// .rd_data(ttlout2_rd_data), |
|
|
|
.signal_in(ttl_output_module_source_sig_af), |
|
|
|
|
|
|
|
// .signal_in(ttl_output_signal_in), |
|
|
|
.ttloutput(sync_ttl_out1), |
|
|
|
.ttloutput_state_led(sync_ttl_out1_state_led) |
|
|
|
); |
|
|
|
|
|
|
|
// .ttloutput(sync_ttl_out2), |
|
|
|
// .ttloutput_state_led(sync_ttl_out2_state_led) |
|
|
|
// ); |
|
|
|
ttl_output #( |
|
|
|
.REG_START_ADD(`REG_ADD_OFF_TTLOUT2), |
|
|
|
.TEST(HARDWARE_TEST_MODE), |
|
|
|
.ID(2) |
|
|
|
) ttl_output_2 ( |
|
|
|
.clk (sys_clk), |
|
|
|
.rst_n(sys_rst_n), |
|
|
|
|
|
|
|
// ttl_output #( |
|
|
|
// .REG_START_ADD(`REG_ADD_OFF_TTLIN3), |
|
|
|
// .TEST(HARDWARE_TEST_MODE), |
|
|
|
// .ID(3) |
|
|
|
// ) ttl_output_3 ( |
|
|
|
// .clk (sys_clk), |
|
|
|
// .rst_n(sys_rst_n), |
|
|
|
.addr(reg_reader_bus_addr), |
|
|
|
.wr_data(reg_reader_bus_wr_data), |
|
|
|
.wr_en(reg_reader_bus_wr_en), |
|
|
|
.rd_data(ttlout2_rd_data), |
|
|
|
|
|
|
|
// .addr(reg_reader_bus_addr), |
|
|
|
// .wr_data(reg_reader_bus_wr_data), |
|
|
|
// .wr_en(reg_reader_bus_wr_en), |
|
|
|
// .rd_data(ttlout3_rd_data), |
|
|
|
.signal_in(ttl_output_module_source_sig_af), |
|
|
|
|
|
|
|
// .signal_in(ttl_output_signal_in), |
|
|
|
.ttloutput(sync_ttl_out2), |
|
|
|
.ttloutput_state_led(sync_ttl_out2_state_led) |
|
|
|
); |
|
|
|
|
|
|
|
// .ttloutput(sync_ttl_out3), |
|
|
|
// .ttloutput_state_led(sync_ttl_out3_state_led) |
|
|
|
// ); |
|
|
|
ttl_output #( |
|
|
|
.REG_START_ADD(`REG_ADD_OFF_TTLOUT3), |
|
|
|
.TEST(HARDWARE_TEST_MODE), |
|
|
|
.ID(3) |
|
|
|
) ttl_output_3 ( |
|
|
|
.clk (sys_clk), |
|
|
|
.rst_n(sys_rst_n), |
|
|
|
|
|
|
|
// ttl_output #( |
|
|
|
// .REG_START_ADD(`REG_ADD_OFF_TTLIN4), |
|
|
|
// .TEST(HARDWARE_TEST_MODE), |
|
|
|
// .ID(4) |
|
|
|
// ) ttl_output_4 ( |
|
|
|
// .clk (sys_clk), |
|
|
|
// .rst_n(sys_rst_n), |
|
|
|
.addr(reg_reader_bus_addr), |
|
|
|
.wr_data(reg_reader_bus_wr_data), |
|
|
|
.wr_en(reg_reader_bus_wr_en), |
|
|
|
.rd_data(ttlout3_rd_data), |
|
|
|
|
|
|
|
// .addr(reg_reader_bus_addr), |
|
|
|
// .wr_data(reg_reader_bus_wr_data), |
|
|
|
// .wr_en(reg_reader_bus_wr_en), |
|
|
|
// .rd_data(ttlout4_rd_data), |
|
|
|
.signal_in(ttl_output_module_source_sig_af), |
|
|
|
|
|
|
|
// .signal_in(ttl_output_signal_in), |
|
|
|
.ttloutput(sync_ttl_out3), |
|
|
|
.ttloutput_state_led(sync_ttl_out3_state_led) |
|
|
|
); |
|
|
|
|
|
|
|
// .ttloutput(sync_ttl_out4), |
|
|
|
// .ttloutput_state_led(sync_ttl_out4_state_led) |
|
|
|
// ); |
|
|
|
ttl_output #( |
|
|
|
.REG_START_ADD(`REG_ADD_OFF_TTLOUT4), |
|
|
|
.TEST(HARDWARE_TEST_MODE), |
|
|
|
.ID(4) |
|
|
|
) ttl_output_4 ( |
|
|
|
.clk (sys_clk), |
|
|
|
.rst_n(sys_rst_n), |
|
|
|
|
|
|
|
.addr(reg_reader_bus_addr), |
|
|
|
.wr_data(reg_reader_bus_wr_data), |
|
|
|
.wr_en(reg_reader_bus_wr_en), |
|
|
|
.rd_data(ttlout4_rd_data), |
|
|
|
|
|
|
|
// rd_data_router rd_data_router_inst ( |
|
|
|
// .addr(reg_reader_bus_addr), |
|
|
|
.signal_in(ttl_output_module_source_sig_af), |
|
|
|
|
|
|
|
// .stm32_rd_data(stm32_rd_data), |
|
|
|
// .fpga_test_rd_data(fpga_test_rd_data), |
|
|
|
// .control_sensor_rd_data(control_sensor_rd_data), |
|
|
|
// .ttlin1_rd_data(ttlin1_rd_data), |
|
|
|
// .ttlin2_rd_data(ttlin2_rd_data), |
|
|
|
// .ttlin3_rd_data(ttlin3_rd_data), |
|
|
|
// .ttlin4_rd_data(ttlin4_rd_data), |
|
|
|
// .timecode_in_rd_data(timecode_in_rd_data), |
|
|
|
// .genlock_in_rd_data(genlock_in_rd_data), |
|
|
|
.ttloutput(sync_ttl_out4), |
|
|
|
.ttloutput_state_led(sync_ttl_out4_state_led) |
|
|
|
); |
|
|
|
|
|
|
|
// .ttlout1_rd_data(ttlout1_rd_data), // ok |
|
|
|
// .ttlout2_rd_data(ttlout2_rd_data), // ok |
|
|
|
// .ttlout3_rd_data(ttlout3_rd_data), // ok |
|
|
|
// .ttlout4_rd_data(ttlout4_rd_data), // ok |
|
|
|
|
|
|
|
// .timecode_out_rd_data(timecode_out_rd_data), |
|
|
|
// .genlock_out_rd_data(genlock_out_rd_data), |
|
|
|
// .stm32_if_rd_data(stm32_if_rd_data), |
|
|
|
// .debuger_rd_data(debuger_rd_data), |
|
|
|
rd_data_router rd_data_router_inst ( |
|
|
|
.addr(reg_reader_bus_addr), |
|
|
|
|
|
|
|
// .rd_data_out(reg_reader_bus_rd_data) |
|
|
|
// ); |
|
|
|
assign reg_reader_bus_rd_data[31:0] = fpga_test_rd_data[31:0]; |
|
|
|
.stm32_rd_data(stm32_rd_data), |
|
|
|
.fpga_test_rd_data(fpga_test_rd_data), |
|
|
|
.control_sensor_rd_data(control_sensor_rd_data), |
|
|
|
.ttlin1_rd_data(ttlin1_rd_data), |
|
|
|
.ttlin2_rd_data(ttlin2_rd_data), |
|
|
|
.ttlin3_rd_data(ttlin3_rd_data), |
|
|
|
.ttlin4_rd_data(ttlin4_rd_data), |
|
|
|
.timecode_in_rd_data(timecode_in_rd_data), |
|
|
|
.genlock_in_rd_data(genlock_in_rd_data), |
|
|
|
|
|
|
|
.ttlout1_rd_data(ttlout1_rd_data), // ok |
|
|
|
.ttlout2_rd_data(ttlout2_rd_data), // ok |
|
|
|
.ttlout3_rd_data(ttlout3_rd_data), // ok |
|
|
|
.ttlout4_rd_data(ttlout4_rd_data), // ok |
|
|
|
|
|
|
|
.timecode_out_rd_data(timecode_out_rd_data), |
|
|
|
.genlock_out_rd_data(genlock_out_rd_data), |
|
|
|
.stm32_if_rd_data(stm32_if_rd_data), |
|
|
|
.debuger_rd_data(debuger_rd_data), |
|
|
|
|
|
|
|
.rd_data_out(reg_reader_bus_rd_data) |
|
|
|
); |
|
|
|
// assign reg_reader_bus_rd_data[31:0] = fpga_test_rd_data[31:0]; |
|
|
|
|
|
|
|
assign debug_signal_output[0] = spi2_cs_pin; |
|
|
|
assign debug_signal_output[1] = spi2_clk_pin; |
|
|
|
assign debug_signal_output[2] = spi2_rx_pin; |
|
|
|
assign debug_signal_output[3] = spi2_tx_pin; |
|
|
|
assign core_board_debug_led = 1; |
|
|
|
|
|
|
|
|
|
|
|
assign debug_signal_output[4] = sync_ttl_out1; |
|
|
|
assign debug_signal_output[5] = sync_ttl_out2; |
|
|
|
assign debug_signal_output[6] = sync_ttl_out3; |
|
|
|
assign debug_signal_output[7] = sync_ttl_out4; |
|
|
|
assign core_board_debug_led = 1; |
|
|
|
|
|
|
|
|
|
|
|
endmodule |