1 |
32 |
redbear |
module SPW_ULIGHT_FIFO(
|
2 |
|
|
input FPGA_CLK1_50,
|
3 |
|
|
input [1:0] KEY,
|
4 |
|
|
|
5 |
|
|
input din_a,
|
6 |
|
|
input sin_a,
|
7 |
|
|
//input din_b,
|
8 |
|
|
//input sin_b,
|
9 |
|
|
output dout_a,
|
10 |
|
|
output sout_a,
|
11 |
|
|
//output dout_b,
|
12 |
|
|
//output sout_b,
|
13 |
|
|
//////////// LED ////////////
|
14 |
|
|
/* 3.3-V LVTTL */
|
15 |
|
|
output [7:0] LED
|
16 |
|
|
|
17 |
|
|
);
|
18 |
|
|
|
19 |
|
|
wire reset_spw_n_b;
|
20 |
|
|
|
21 |
|
|
wire top_auto_start;
|
22 |
|
|
wire top_link_start;
|
23 |
|
|
wire top_link_disable;
|
24 |
|
|
|
25 |
|
|
wire read_enable_rx;
|
26 |
|
|
|
27 |
|
|
wire f_full_rx;
|
28 |
|
|
wire f_empty_rx;
|
29 |
|
|
|
30 |
|
|
wire f_empty_tx;
|
31 |
|
|
wire f_full_tx;
|
32 |
|
|
|
33 |
|
|
wire [2:0] clock_sel;
|
34 |
|
|
wire [5:0] top_fsm_i;
|
35 |
|
|
wire clk_400_mhz;
|
36 |
|
|
wire clk_pll_mhz;
|
37 |
|
|
wire ppll_100_MHZ;
|
38 |
|
|
wire pll_tx_locked_export;
|
39 |
|
|
|
40 |
|
|
wire [8:0] datarx_out_flag;
|
41 |
|
|
wire [13:0] monitor_a;
|
42 |
|
|
|
43 |
|
|
wire top_tx_tick;
|
44 |
|
|
wire [7:0] top_tx_time;
|
45 |
|
|
|
46 |
|
|
wire [5:0] counter_fifotx;
|
47 |
|
|
wire [5:0] counter_fiforx;
|
48 |
|
|
|
49 |
|
|
wire top_tx_write;
|
50 |
|
|
wire [8:0] top_tx_data;
|
51 |
|
|
|
52 |
|
|
wire [7:0] time_out;
|
53 |
|
|
wire tick_out;
|
54 |
|
|
|
55 |
40 |
redbear |
wire clk_250_sys;
|
56 |
|
|
|
57 |
32 |
redbear |
assign LED[7:7] = pll_tx_locked_export;
|
58 |
|
|
|
59 |
|
|
ulight_fifo u0 (
|
60 |
|
|
.auto_start_external_connection_export (top_auto_start), // auto_start_external_connection.export
|
61 |
|
|
.clk_clk (FPGA_CLK1_50), // clk.clk
|
62 |
|
|
.clock_sel_external_connection_export (clock_sel), // clock_sel_external_connection.export
|
63 |
|
|
.data_flag_rx_external_connection_export (datarx_out_flag), // data_flag_rx_external_connection.export
|
64 |
|
|
.data_info_external_connection_export (monitor_a), // data_info_external_connection.export
|
65 |
|
|
.data_read_en_rx_external_connection_export (read_enable_rx), // data_read_en_rx_external_connection.export
|
66 |
|
|
.fifo_empty_rx_status_external_connection_export (f_empty_rx), // fifo_empty_rx_status_external_connection.export
|
67 |
|
|
.fifo_empty_tx_status_external_connection_export (f_empty_tx), // fifo_empty_tx_status_external_connection.export
|
68 |
|
|
.fifo_full_rx_status_external_connection_export (f_full_rx), // fifo_full_rx_status_external_connection.export
|
69 |
|
|
.fifo_full_tx_status_external_connection_export (f_full_tx), // fifo_full_tx_status_external_connection.export
|
70 |
|
|
.led_pio_test_external_connection_export (LED[4:0]), // led_pio_test_external_connection.export
|
71 |
|
|
.link_disable_external_connection_export (top_link_disable), // link_disable_external_connection.export
|
72 |
|
|
.link_start_external_connection_export (top_link_start), // link_start_external_connection.export
|
73 |
|
|
/*
|
74 |
|
|
.memory_mem_a (<connected-to-memory_mem_a>), // memory.mem_a
|
75 |
|
|
.memory_mem_ba (<connected-to-memory_mem_ba>), // .mem_ba
|
76 |
|
|
.memory_mem_ck (<connected-to-memory_mem_ck>), // .mem_ck
|
77 |
|
|
.memory_mem_ck_n (<connected-to-memory_mem_ck_n>), // .mem_ck_n
|
78 |
|
|
.memory_mem_cke (<connected-to-memory_mem_cke>), // .mem_cke
|
79 |
|
|
.memory_mem_cs_n (<connected-to-memory_mem_cs_n>), // .mem_cs_n
|
80 |
|
|
.memory_mem_ras_n (<connected-to-memory_mem_ras_n>), // .mem_ras_n
|
81 |
|
|
.memory_mem_cas_n (<connected-to-memory_mem_cas_n>), // .mem_cas_n
|
82 |
|
|
.memory_mem_we_n (<connected-to-memory_mem_we_n>), // .mem_we_n
|
83 |
|
|
.memory_mem_reset_n (<connected-to-memory_mem_reset_n>), // .mem_reset_n
|
84 |
|
|
.memory_mem_dq (<connected-to-memory_mem_dq>), // .mem_dq
|
85 |
|
|
.memory_mem_dqs (<connected-to-memory_mem_dqs>), // .mem_dqs
|
86 |
|
|
.memory_mem_dqs_n (<connected-to-memory_mem_dqs_n>), // .mem_dqs_n
|
87 |
|
|
.memory_mem_odt (<connected-to-memory_mem_odt>), // .mem_odt
|
88 |
|
|
.memory_mem_dm (<connected-to-memory_mem_dm>), // .mem_dm
|
89 |
|
|
.memory_oct_rzqin (<connected-to-memory_oct_rzqin>), // .oct_rzqin
|
90 |
|
|
*/
|
91 |
|
|
.pll_0_locked_export (pll_tx_locked_export), // pll_0_locked.export
|
92 |
40 |
redbear |
.pll_0_outclk0_clk (clk_400_mhz),
|
93 |
|
|
//.pll_0_outclk1_clk (clk_250_sys), // pll_0_outclk0.clk
|
94 |
32 |
redbear |
.reset_reset_n (reset_spw_n_b), // reset.reset_n
|
95 |
|
|
.timecode_ready_rx_external_connection_export (tick_out), // timecode_ready_rx_external_connection.export
|
96 |
|
|
.timecode_rx_external_connection_export (time_out), // timecode_rx_external_connection.export
|
97 |
|
|
.timecode_tx_data_external_connection_export (top_tx_time), // timecode_tx_data_external_connection.export
|
98 |
|
|
.timecode_tx_enable_external_connection_export (top_tx_tick), // timecode_tx_enable_external_connection.export
|
99 |
|
|
.timecode_tx_ready_external_connection_export (top_tx_ready_tick), // timecode_tx_ready_external_connection.export
|
100 |
|
|
.write_data_fifo_tx_external_connection_export (top_tx_data), // write_data_fifo_tx_external_connection.export
|
101 |
|
|
.write_en_tx_external_connection_export (top_tx_write), // write_en_tx_external_connection.export
|
102 |
|
|
.fsm_info_external_connection_export (top_fsm_i), // fsm_info_external_connection.export
|
103 |
|
|
.counter_tx_fifo_external_connection_export (counter_fifotx), // counter_tx_fifo_external_connection.export
|
104 |
|
|
.counter_rx_fifo_external_connection_export (counter_fiforx) // counter_rx_fifo_external_connection.export
|
105 |
|
|
);
|
106 |
|
|
|
107 |
|
|
spw_ulight_con_top_x A_SPW_TOP(
|
108 |
|
|
.ppll_100_MHZ(ppll_100_MHZ),
|
109 |
|
|
.ppllclk(clk_pll_mhz),
|
110 |
|
|
.reset_spw_n_b(reset_spw_n_b),
|
111 |
40 |
redbear |
|
112 |
|
|
//.clk_sys_250_mhz(clk_250_sys),
|
113 |
32 |
redbear |
|
114 |
|
|
.top_sin(sin_a),
|
115 |
|
|
.top_din(din_a),
|
116 |
|
|
|
117 |
|
|
.top_auto_start(top_auto_start),
|
118 |
|
|
.top_link_start(top_link_start),
|
119 |
|
|
.top_link_disable(top_link_disable),
|
120 |
|
|
|
121 |
|
|
.top_tx_write(top_tx_write),
|
122 |
|
|
.top_tx_data(top_tx_data),
|
123 |
|
|
|
124 |
|
|
.top_tx_tick(top_tx_tick),
|
125 |
|
|
.top_tx_time(top_tx_time),
|
126 |
|
|
|
127 |
|
|
.read_rx_fifo_en(read_enable_rx),
|
128 |
|
|
|
129 |
|
|
.datarx_flag(datarx_out_flag),
|
130 |
|
|
|
131 |
|
|
.tick_out(tick_out),
|
132 |
|
|
.time_out(time_out),
|
133 |
|
|
|
134 |
|
|
.top_dout(dout_a),
|
135 |
|
|
.top_sout(sout_a),
|
136 |
|
|
|
137 |
|
|
.f_full(f_full_tx),
|
138 |
|
|
.f_empty(f_empty_tx),
|
139 |
|
|
.f_full_rx(f_full_rx),
|
140 |
|
|
.f_empty_rx(f_empty_rx),
|
141 |
|
|
.top_tx_ready_tick(top_tx_ready_tick),
|
142 |
|
|
|
143 |
|
|
.top_fsm(top_fsm_i),
|
144 |
|
|
|
145 |
|
|
//.data_info(data_a),
|
146 |
|
|
.counter_fifo_tx(counter_fifotx),
|
147 |
|
|
.counter_fifo_rx(counter_fiforx)
|
148 |
|
|
);
|
149 |
|
|
|
150 |
|
|
debounce_db db_system_spwulight_b(
|
151 |
|
|
.CLK(FPGA_CLK1_50),
|
152 |
|
|
.PB(KEY[1]),
|
153 |
|
|
.PB_state(reset_spw_n_b),
|
154 |
|
|
.PB_down(LED[5:5])
|
155 |
|
|
);
|
156 |
|
|
|
157 |
|
|
clock_reduce R_400_to_2_5_10_100_200_300MHZ(
|
158 |
|
|
.clk(clk_400_mhz),
|
159 |
|
|
.clock_sel(clock_sel),
|
160 |
|
|
.reset_n(pll_tx_locked_export),
|
161 |
|
|
.clk_reduced(clk_pll_mhz),
|
162 |
|
|
.clk_100_reduced(ppll_100_MHZ)
|
163 |
|
|
);
|
164 |
|
|
|
165 |
|
|
detector_tokens m_x(
|
166 |
|
|
.rx_din(dout_a),
|
167 |
|
|
.rx_sin(sout_a),
|
168 |
|
|
.rx_resetn(reset_spw_n_b),
|
169 |
|
|
.info(monitor_a)
|
170 |
|
|
);
|
171 |
|
|
|
172 |
|
|
endmodule
|