[27] | 1 | module Paella
|
---|
| 2 | (
|
---|
| 3 | input wire CLK_50MHz,
|
---|
| 4 | output wire LED,
|
---|
| 5 |
|
---|
| 6 | inout wire [3:0] TRG,
|
---|
[68] | 7 | inout wire I2C_SDA,
|
---|
[72] | 8 | inout wire I2C_SCL,
|
---|
[68] | 9 | inout wire [4:0] CON_A,
|
---|
[159] | 10 | input wire [16:0] CON_B,
|
---|
[63] | 11 | input wire [12:0] CON_C,
|
---|
[159] | 12 | input wire CON_BCLK,
|
---|
[27] | 13 | input wire [1:0] CON_CCLK,
|
---|
| 14 |
|
---|
| 15 | input wire ADC_DCO,
|
---|
| 16 | input wire ADC_FCO,
|
---|
[41] | 17 | input wire [2:0] ADC_D,
|
---|
[27] | 18 |
|
---|
| 19 | output wire USB_SLRD,
|
---|
| 20 | output wire USB_SLWR,
|
---|
| 21 | input wire USB_IFCLK,
|
---|
| 22 | input wire USB_FLAGA, // EMPTY flag for EP6
|
---|
| 23 | input wire USB_FLAGB, // FULL flag for EP8
|
---|
| 24 | input wire USB_FLAGC,
|
---|
[30] | 25 | inout wire USB_PA0,
|
---|
| 26 | inout wire USB_PA1,
|
---|
| 27 | output wire USB_PA2,
|
---|
| 28 | inout wire USB_PA3,
|
---|
| 29 | output wire USB_PA4,
|
---|
| 30 | output wire USB_PA5,
|
---|
| 31 | output wire USB_PA6,
|
---|
| 32 | inout wire USB_PA7,
|
---|
[27] | 33 | inout wire [7:0] USB_PB,
|
---|
| 34 |
|
---|
| 35 | output wire RAM_CLK,
|
---|
| 36 | output wire RAM_CE1,
|
---|
| 37 | output wire RAM_WE,
|
---|
| 38 | output wire [19:0] RAM_ADDR,
|
---|
| 39 | inout wire RAM_DQAP,
|
---|
| 40 | inout wire [7:0] RAM_DQA,
|
---|
| 41 | inout wire RAM_DQBP,
|
---|
| 42 | inout wire [7:0] RAM_DQB
|
---|
| 43 | );
|
---|
| 44 |
|
---|
[72] | 45 | localparam N = 3;
|
---|
| 46 |
|
---|
[27] | 47 | // Turn output ports off
|
---|
[65] | 48 | /*
|
---|
[27] | 49 | assign RAM_CLK = 1'b0;
|
---|
| 50 | assign RAM_CE1 = 1'b0;
|
---|
| 51 | assign RAM_WE = 1'b0;
|
---|
| 52 | assign RAM_ADDR = 20'h00000;
|
---|
[65] | 53 | */
|
---|
[90] | 54 | assign RAM_CLK = sys_clock;
|
---|
[65] | 55 | assign RAM_CE1 = 1'b0;
|
---|
[27] | 56 |
|
---|
| 57 | // Turn inout ports to tri-state
|
---|
| 58 | assign TRG = 4'bz;
|
---|
[68] | 59 | assign CON_A = 5'bz;
|
---|
[30] | 60 | assign USB_PA0 = 1'bz;
|
---|
| 61 | assign USB_PA1 = 1'bz;
|
---|
| 62 | assign USB_PA3 = 1'bz;
|
---|
| 63 | assign USB_PA7 = 1'bz;
|
---|
[65] | 64 | // assign RAM_DQAP = 1'bz;
|
---|
| 65 | // assign RAM_DQA = 8'bz;
|
---|
| 66 | // assign RAM_DQBP = 1'bz;
|
---|
| 67 | // assign RAM_DQB = 8'bz;
|
---|
[27] | 68 |
|
---|
[30] | 69 | assign USB_PA2 = ~usb_rden;
|
---|
[159] | 70 | assign USB_PA5 = 1'b1;
|
---|
[30] | 71 | assign USB_PA6 = ~usb_pktend;
|
---|
| 72 |
|
---|
[27] | 73 | wire usb_wrreq, usb_rdreq, usb_rden, usb_pktend;
|
---|
[59] | 74 | wire usb_tx_wrreq, usb_rx_rdreq;
|
---|
| 75 | wire usb_tx_full, usb_rx_empty;
|
---|
| 76 | wire [7:0] usb_tx_data, usb_rx_data;
|
---|
[27] | 77 |
|
---|
| 78 | assign USB_SLRD = ~usb_rdreq;
|
---|
| 79 | assign USB_SLWR = ~usb_wrreq;
|
---|
| 80 |
|
---|
[59] | 81 | usb_fifo usb_unit
|
---|
[27] | 82 | (
|
---|
[159] | 83 | .usb_clock(USB_IFCLK),
|
---|
[27] | 84 | .usb_data(USB_PB),
|
---|
| 85 | .usb_full(~USB_FLAGB),
|
---|
| 86 | .usb_empty(~USB_FLAGA),
|
---|
| 87 | .usb_wrreq(usb_wrreq),
|
---|
| 88 | .usb_rdreq(usb_rdreq),
|
---|
| 89 | .usb_rden(usb_rden),
|
---|
| 90 | .usb_pktend(usb_pktend),
|
---|
[159] | 91 | .usb_addr(USB_PA4),
|
---|
[34] | 92 |
|
---|
[159] | 93 | .clock(sys_clock),
|
---|
[34] | 94 |
|
---|
[59] | 95 | .tx_full(usb_tx_full),
|
---|
| 96 | .tx_wrreq(usb_tx_wrreq),
|
---|
| 97 | .tx_data(usb_tx_data),
|
---|
[34] | 98 |
|
---|
[59] | 99 | .rx_empty(usb_rx_empty),
|
---|
| 100 | .rx_rdreq(usb_rx_rdreq),
|
---|
| 101 | .rx_q(usb_rx_data)
|
---|
[27] | 102 | );
|
---|
[159] | 103 | /*
|
---|
| 104 | reg [31:0] led_counter;
|
---|
| 105 | always @(posedge CLK_50MHz)
|
---|
| 106 | begin
|
---|
| 107 | led_counter = led_counter + 32'd1;
|
---|
| 108 | end
|
---|
| 109 | assign LED = led_counter[28];
|
---|
| 110 | */
|
---|
| 111 | wire [11:0] osc_mux_data [4:0];
|
---|
[44] | 112 |
|
---|
[90] | 113 | wire [11:0] trg_mux_data;
|
---|
| 114 | wire trg_flag;
|
---|
[72] | 115 |
|
---|
[159] | 116 | wire [4*12-1:0] int_mux_data [N-1:0];
|
---|
[72] | 117 |
|
---|
[159] | 118 | wire [1:0] amp_flag [2*N-1:0];
|
---|
| 119 | wire [11:0] amp_data [2*N-1:0];
|
---|
| 120 |
|
---|
[161] | 121 | wire [1:0] amp_mux_flag [1:0];
|
---|
| 122 | wire [11:0] amp_mux_data [1:0];
|
---|
| 123 |
|
---|
[159] | 124 | wire cnt_good [N-1:0];
|
---|
| 125 | wire [15:0] cnt_bits_wire;
|
---|
| 126 |
|
---|
[90] | 127 | wire sys_clock, sys_frame;
|
---|
[72] | 128 |
|
---|
[159] | 129 | wire [11:0] adc_data [N-1:0];
|
---|
[101] | 130 | wire [11:0] sys_data [N-1:0];
|
---|
[159] | 131 | wire [11:0] tst_data;
|
---|
[84] | 132 |
|
---|
[159] | 133 | wire [1:0] cmp_data;
|
---|
| 134 | wire [1:0] del_data;
|
---|
[63] | 135 |
|
---|
[159] | 136 | wire [19:0] cic_data [N-1:0];
|
---|
[63] | 137 |
|
---|
[159] | 138 | wire [11:0] dec_data [N-1:0];
|
---|
| 139 | wire [11:0] clp_data [N-1:0];
|
---|
| 140 | wire [11:0] tmp_data;
|
---|
[54] | 141 |
|
---|
[48] | 142 |
|
---|
[159] | 143 | wire i2c_reset;
|
---|
| 144 |
|
---|
[101] | 145 | sys_pll sys_pll_unit(
|
---|
| 146 | .inclk0(CLK_50MHz),
|
---|
| 147 | .c0(sys_clock));
|
---|
| 148 |
|
---|
[59] | 149 | test test_unit(
|
---|
[84] | 150 | .clk(ADC_FCO),
|
---|
[159] | 151 | .data(tst_data));
|
---|
[48] | 152 |
|
---|
[63] | 153 | adc_lvds #(
|
---|
[81] | 154 | .size(3),
|
---|
[63] | 155 | .width(12)) adc_lvds_unit (
|
---|
[159] | 156 | .clock(sys_clock),
|
---|
[41] | 157 | .lvds_dco(ADC_DCO),
|
---|
| 158 | .lvds_fco(ADC_FCO),
|
---|
[159] | 159 | .lvds_d(ADC_D),
|
---|
| 160 | .trig(TRG[1:0]),
|
---|
| 161 | .adc_frame(sys_frame),
|
---|
| 162 | .adc_data({cmp_data, adc_data[2], adc_data[1], adc_data[0]}));
|
---|
[101] | 163 |
|
---|
[159] | 164 | wire [15:0] cfg_bits [63:0];
|
---|
| 165 | wire [1023:0] int_cfg_bits;
|
---|
[72] | 166 |
|
---|
[159] | 167 | wire [39:0] cfg_mux_selector;
|
---|
[72] | 168 |
|
---|
| 169 | wire cfg_reset;
|
---|
| 170 |
|
---|
[159] | 171 | wire [11:0] bus_ssel;
|
---|
[90] | 172 | wire bus_wren;
|
---|
| 173 | wire [31:0] bus_addr;
|
---|
| 174 | wire [15:0] bus_mosi;
|
---|
[159] | 175 | wire [15:0] bus_miso [10:0];
|
---|
| 176 | wire [11:0] bus_busy;
|
---|
[72] | 177 |
|
---|
[90] | 178 | wire [15:0] mrg_bus_miso;
|
---|
| 179 | wire mrg_bus_busy;
|
---|
[72] | 180 |
|
---|
[159] | 181 | wire [11*16-1:0] int_bus_miso;
|
---|
[84] | 182 |
|
---|
[90] | 183 | genvar j;
|
---|
[72] | 184 |
|
---|
[44] | 185 | generate
|
---|
[159] | 186 | for (j = 0; j < 64; j = j + 1)
|
---|
[90] | 187 | begin : CONFIGURATION_OUTPUT
|
---|
| 188 | assign cfg_bits[j] = int_cfg_bits[j*16+15:j*16];
|
---|
| 189 | end
|
---|
| 190 | endgenerate
|
---|
[72] | 191 |
|
---|
[90] | 192 | configuration configuration_unit (
|
---|
| 193 | .clock(sys_clock),
|
---|
| 194 | .reset(cfg_reset),
|
---|
| 195 | .bus_ssel(bus_ssel[0]),
|
---|
| 196 | .bus_wren(bus_wren),
|
---|
[101] | 197 | .bus_addr(bus_addr[4:0]),
|
---|
[90] | 198 | .bus_mosi(bus_mosi),
|
---|
| 199 | .bus_miso(bus_miso[0]),
|
---|
| 200 | .bus_busy(bus_busy[0]),
|
---|
| 201 | .cfg_bits(int_cfg_bits));
|
---|
[72] | 202 |
|
---|
[90] | 203 | generate
|
---|
| 204 | for (j = 0; j < 3; j = j + 1)
|
---|
| 205 | begin : MUX_DATA
|
---|
| 206 | assign int_mux_data[j] = {
|
---|
[159] | 207 | {4'd0, amp_flag[0+2*j][0], 7'd0},
|
---|
| 208 | amp_data[0+2*j],
|
---|
| 209 | clp_data[j],
|
---|
[101] | 210 | sys_data[j]};
|
---|
[90] | 211 | end
|
---|
| 212 | endgenerate
|
---|
[72] | 213 |
|
---|
[159] | 214 | assign cfg_mux_selector = {cfg_bits[4][7:0], cfg_bits[3], cfg_bits[2]};
|
---|
[75] | 215 |
|
---|
[90] | 216 | lpm_mux #(
|
---|
[159] | 217 | .lpm_size(4*3),
|
---|
[90] | 218 | .lpm_type("LPM_MUX"),
|
---|
| 219 | .lpm_width(12),
|
---|
[159] | 220 | .lpm_widths(4)) trg_mux_unit (
|
---|
| 221 | .sel(cfg_bits[4][11:8]),
|
---|
[90] | 222 | .data({int_mux_data[2], int_mux_data[1], int_mux_data[0]}),
|
---|
| 223 | .result(trg_mux_data));
|
---|
[72] | 224 |
|
---|
[161] | 225 | lpm_mux #(
|
---|
| 226 | .lpm_size(3),
|
---|
| 227 | .lpm_type("LPM_MUX"),
|
---|
| 228 | .lpm_width(14),
|
---|
| 229 | .lpm_widths(2)) amp_mux_unit_1 (
|
---|
| 230 | .sel(cfg_bits[8][1:0]),
|
---|
| 231 | .data({
|
---|
| 232 | {amp_flag[4], amp_data[4]},
|
---|
| 233 | {amp_flag[2], amp_data[2]},
|
---|
| 234 | {amp_flag[0], amp_data[0]}}),
|
---|
| 235 | .result({amp_mux_flag[0], amp_mux_data[0]}));
|
---|
| 236 |
|
---|
| 237 | lpm_mux #(
|
---|
| 238 | .lpm_size(3),
|
---|
| 239 | .lpm_type("LPM_MUX"),
|
---|
| 240 | .lpm_width(14),
|
---|
| 241 | .lpm_widths(2)) amp_mux_unit_2 (
|
---|
| 242 | .sel(cfg_bits[8][5:4]),
|
---|
| 243 | .data({
|
---|
| 244 | {amp_flag[5], amp_data[5]},
|
---|
| 245 | {amp_flag[3], amp_data[3]},
|
---|
| 246 | {amp_flag[1], amp_data[1]}}),
|
---|
| 247 | .result({amp_mux_flag[1], amp_mux_data[1]}));
|
---|
| 248 |
|
---|
[90] | 249 | generate
|
---|
[159] | 250 | for (j = 0; j < 5; j = j + 1)
|
---|
[90] | 251 | begin : OSC_CHAIN
|
---|
[72] | 252 |
|
---|
| 253 | lpm_mux #(
|
---|
[159] | 254 | .lpm_size(4*3),
|
---|
[72] | 255 | .lpm_type("LPM_MUX"),
|
---|
| 256 | .lpm_width(12),
|
---|
[159] | 257 | .lpm_widths(4)) osc_mux_unit (
|
---|
| 258 | .sel(cfg_mux_selector[j*8+3:j*8]),
|
---|
[90] | 259 | .data({int_mux_data[2], int_mux_data[1], int_mux_data[0]}),
|
---|
| 260 | .result(osc_mux_data[j]));
|
---|
| 261 |
|
---|
| 262 | end
|
---|
| 263 | endgenerate
|
---|
[72] | 264 |
|
---|
[90] | 265 | trigger trigger_unit (
|
---|
| 266 | .clock(sys_clock),
|
---|
| 267 | .frame(sys_frame),
|
---|
[101] | 268 | .reset(cfg_bits[0][0]),
|
---|
| 269 | .cfg_data(cfg_bits[5][11:0]),
|
---|
[90] | 270 | .trg_data(trg_mux_data),
|
---|
| 271 | .trg_flag(trg_flag));
|
---|
[27] | 272 |
|
---|
[90] | 273 | oscilloscope oscilloscope_unit (
|
---|
| 274 | .clock(sys_clock),
|
---|
| 275 | .frame(sys_frame),
|
---|
[101] | 276 | .reset(cfg_bits[0][1]),
|
---|
[159] | 277 | .cfg_data(cfg_bits[5][12]),
|
---|
[90] | 278 | .trg_flag(trg_flag),
|
---|
[159] | 279 | .osc_data({2'd0, cmp_data, osc_mux_data[4], osc_mux_data[3], osc_mux_data[2], osc_mux_data[1], osc_mux_data[0]}),
|
---|
[90] | 280 | .ram_wren(RAM_WE),
|
---|
| 281 | .ram_addr(RAM_ADDR),
|
---|
| 282 | .ram_data({RAM_DQA, RAM_DQAP, RAM_DQB, RAM_DQBP}),
|
---|
| 283 | .bus_ssel(bus_ssel[1]),
|
---|
| 284 | .bus_wren(bus_wren),
|
---|
| 285 | .bus_addr(bus_addr[19:0]),
|
---|
| 286 | .bus_mosi(bus_mosi),
|
---|
| 287 | .bus_miso(bus_miso[1]),
|
---|
| 288 | .bus_busy(bus_busy[1]));
|
---|
[72] | 289 |
|
---|
[159] | 290 | filter #(.size(3), .width(12)) filter_unit (
|
---|
| 291 | .clock(sys_clock),
|
---|
| 292 | .frame(sys_frame),
|
---|
| 293 | .reset(1'b0),
|
---|
| 294 | .inp_data({sys_data[2], sys_data[1], sys_data[0]}),
|
---|
| 295 | .out_data({cic_data[2], cic_data[1], cic_data[0]}));
|
---|
| 296 |
|
---|
[101] | 297 |
|
---|
[159] | 298 | /*
|
---|
| 299 | clip #(.shift(19), .width(19), .widthr(12)) clip_unit (
|
---|
| 300 | .clock(sys_clock),
|
---|
| 301 | .frame(sys_frame),
|
---|
| 302 | .reset(1'b0),
|
---|
| 303 | .del_data({cfg_bits[39][5:0], cfg_bits[37][5:0], cfg_bits[35+8][5:0], cfg_bits[33][5:0]}),
|
---|
| 304 | .amp_data({6'd6, 6'd6, 6'd6, 6'd6}),
|
---|
| 305 | .tau_data({cfg_bits[38], cfg_bits[36], cfg_bits[34], cfg_bits[32]}),
|
---|
| 306 | .inp_data({
|
---|
| 307 | 19'd0, cic_data[2][18:0],
|
---|
| 308 | cic_data[1][18:0], cic_data[0][18:0]}),
|
---|
| 309 | .out_data({
|
---|
| 310 | tmp_data, clp_data[2],
|
---|
| 311 | clp_data[1], clp_data[0]}));
|
---|
| 312 | */
|
---|
[90] | 313 | generate
|
---|
| 314 | for (j = 0; j < 3; j = j + 1)
|
---|
| 315 | begin : MCA_CHAIN
|
---|
[159] | 316 |
|
---|
| 317 | shift #(.shift(9), .width(19), .widthr(12)) shift_unit (
|
---|
[90] | 318 | .clock(sys_clock),
|
---|
| 319 | .frame(sys_frame),
|
---|
| 320 | .reset(1'b0),
|
---|
[159] | 321 | .amp_data(6'd5),
|
---|
| 322 | .inp_data(cic_data[j][18:0]),
|
---|
| 323 | .out_data(clp_data[j]));
|
---|
| 324 |
|
---|
| 325 | assign sys_data[j] = (cfg_bits[1][4*j]) ? (adc_data[j] ^ 12'hfff) : (adc_data[j]);
|
---|
| 326 |
|
---|
| 327 | amplitude #(.width(12)) amplitude_unit_1 (
|
---|
[90] | 328 | .clock(sys_clock),
|
---|
| 329 | .frame(sys_frame),
|
---|
| 330 | .reset(1'b0),
|
---|
[161] | 331 | .cfg_data(cfg_bits[6][11:0]),
|
---|
| 332 | // .cfg_data(cfg_bits[6+2*j][11:0]),
|
---|
[159] | 333 | .inp_data(clp_data[j]),
|
---|
| 334 | .out_flag(amp_flag[0+2*j]),
|
---|
| 335 | .out_data(amp_data[0+2*j]));
|
---|
| 336 |
|
---|
| 337 | amplitude #(.width(12)) amplitude_unit_2 (
|
---|
[90] | 338 | .clock(sys_clock),
|
---|
| 339 | .frame(sys_frame),
|
---|
| 340 | .reset(1'b0),
|
---|
[161] | 341 | .cfg_data(cfg_bits[7][11:0]),
|
---|
| 342 | // .cfg_data(cfg_bits[7+2*j][11:0]),
|
---|
[159] | 343 | .inp_data(clp_data[j]),
|
---|
| 344 | .out_flag(amp_flag[1+2*j]),
|
---|
| 345 | .out_data(amp_data[1+2*j]));
|
---|
[54] | 346 |
|
---|
[44] | 347 | end
|
---|
| 348 | endgenerate
|
---|
[27] | 349 |
|
---|
[159] | 350 | histogram32 histogram32_unit (
|
---|
| 351 | .clock(sys_clock),
|
---|
| 352 | .frame(sys_frame),
|
---|
| 353 | .reset(cfg_bits[0][5]),
|
---|
[161] | 354 | .hst_good((amp_mux_flag[0][0]) & (cnt_good[0]) & (cfg_bits[13][1])),
|
---|
| 355 | .hst_data(amp_mux_data[0]),
|
---|
[159] | 356 | .bus_ssel(bus_ssel[2]),
|
---|
| 357 | .bus_wren(bus_wren),
|
---|
| 358 | .bus_addr(bus_addr[12:0]),
|
---|
| 359 | .bus_mosi(bus_mosi),
|
---|
| 360 | .bus_miso(bus_miso[2]),
|
---|
| 361 | .bus_busy(bus_busy[2]));
|
---|
| 362 |
|
---|
| 363 | counter hst_counter_unit (
|
---|
| 364 | .clock(sys_clock),
|
---|
[161] | 365 | .frame((sys_frame) & (~amp_mux_flag[0][1])),
|
---|
[159] | 366 | // .frame(sys_frame),
|
---|
| 367 | .reset(cfg_bits[0][8]),
|
---|
| 368 | .setup(cfg_bits[13][0]),
|
---|
| 369 | .count(cfg_bits[13][1]),
|
---|
| 370 | .bus_ssel(bus_ssel[5]),
|
---|
| 371 | .bus_wren(bus_wren),
|
---|
| 372 | .bus_addr(bus_addr[1:0]),
|
---|
| 373 | .bus_mosi(bus_mosi),
|
---|
| 374 | .bus_miso(bus_miso[5]),
|
---|
| 375 | .bus_busy(bus_busy[5]),
|
---|
| 376 | .cnt_good(cnt_good[0]));
|
---|
| 377 |
|
---|
| 378 | histogram16 histogram16_unit (
|
---|
| 379 | .clock(sys_clock),
|
---|
| 380 | .frame(sys_frame),
|
---|
| 381 | .reset(cfg_bits[0][11]),
|
---|
| 382 | .hst_good((cnt_good[2]) & (~cnt_good[1])),
|
---|
| 383 | .hst_data(cnt_bits_wire),
|
---|
| 384 | .bus_ssel(bus_ssel[8]),
|
---|
| 385 | .bus_wren(bus_wren),
|
---|
| 386 | .bus_addr(bus_addr[13:0]),
|
---|
| 387 | .bus_mosi(bus_mosi),
|
---|
| 388 | .bus_miso(bus_miso[8]),
|
---|
| 389 | .bus_busy(bus_busy[8]));
|
---|
| 390 |
|
---|
| 391 | counter rmt_counter_1 (
|
---|
| 392 | .clock(sys_clock),
|
---|
[161] | 393 | .frame((sys_frame) & (~amp_mux_flag[1][1])),
|
---|
[159] | 394 | // .frame(sys_frame),
|
---|
| 395 | .reset(cfg_bits[0][12]),
|
---|
| 396 | .setup((sys_frame) & (~cnt_good[1])),
|
---|
| 397 | .count((cnt_good[2]) & (cfg_bits[16][1])),
|
---|
| 398 | .bus_ssel(bus_ssel[9]),
|
---|
| 399 | .bus_wren(bus_wren),
|
---|
| 400 | .bus_addr(bus_addr[1:0]),
|
---|
| 401 | .bus_mosi(bus_mosi),
|
---|
| 402 | .bus_miso(bus_miso[9]),
|
---|
| 403 | .bus_busy(bus_busy[9]),
|
---|
| 404 | .cnt_good(cnt_good[1]));
|
---|
| 405 |
|
---|
| 406 | counter rmt_counter_2 (
|
---|
| 407 | .clock(sys_clock),
|
---|
| 408 | .frame((sys_frame) & (~cnt_good[1])),
|
---|
| 409 | .reset(cfg_bits[0][13]),
|
---|
| 410 | .setup(cfg_bits[16][0]),
|
---|
| 411 | .count(cfg_bits[16][1]),
|
---|
| 412 | .bus_ssel(bus_ssel[10]),
|
---|
| 413 | .bus_wren(bus_wren),
|
---|
| 414 | .bus_addr(bus_addr[1:0]),
|
---|
| 415 | .bus_mosi(bus_mosi),
|
---|
| 416 | .bus_miso(bus_miso[10]),
|
---|
| 417 | .bus_busy(bus_busy[10]),
|
---|
| 418 | .cnt_good(cnt_good[2]));
|
---|
| 419 |
|
---|
| 420 | lpm_counter #(
|
---|
| 421 | .lpm_direction("UP"),
|
---|
| 422 | .lpm_port_updown("PORT_UNUSED"),
|
---|
| 423 | .lpm_type("LPM_COUNTER"),
|
---|
| 424 | .lpm_width(16)) lpm_counter_component (
|
---|
| 425 | .sclr(((sys_frame) & (cnt_good[2]) & (~cnt_good[1])) | (cfg_bits[0][11])),
|
---|
| 426 | .clock(sys_clock),
|
---|
[161] | 427 | .cnt_en((sys_frame) & (amp_mux_flag[1][0]) & (cnt_good[1]) & (cnt_good[2]) & (cfg_bits[16][1])),
|
---|
[159] | 428 | .q(cnt_bits_wire));
|
---|
| 429 |
|
---|
[68] | 430 | i2c_fifo i2c_unit(
|
---|
[90] | 431 | .clock(sys_clock),
|
---|
| 432 | .reset(i2c_reset),
|
---|
[70] | 433 | /*
|
---|
| 434 | normal connection
|
---|
[68] | 435 | .i2c_sda(I2C_SDA),
|
---|
[70] | 436 | .i2c_scl(I2C_SCL),
|
---|
[68] | 437 |
|
---|
[70] | 438 | following is a cross wire connection for EPT
|
---|
| 439 | */
|
---|
| 440 | .i2c_sda(I2C_SCL),
|
---|
[90] | 441 | .i2c_scl(I2C_SDA),
|
---|
| 442 |
|
---|
[159] | 443 | .bus_ssel(bus_ssel[11]),
|
---|
[90] | 444 | .bus_wren(bus_wren),
|
---|
| 445 | .bus_mosi(bus_mosi),
|
---|
[159] | 446 | .bus_busy(bus_busy[11]));
|
---|
[70] | 447 |
|
---|
[90] | 448 | generate
|
---|
[159] | 449 | for (j = 0; j < 11; j = j + 1)
|
---|
[90] | 450 | begin : BUS_OUTPUT
|
---|
| 451 | assign int_bus_miso[j*16+15:j*16] = bus_miso[j];
|
---|
| 452 | end
|
---|
| 453 | endgenerate
|
---|
| 454 |
|
---|
| 455 | lpm_mux #(
|
---|
[159] | 456 | .lpm_size(11),
|
---|
[90] | 457 | .lpm_type("LPM_MUX"),
|
---|
| 458 | .lpm_width(16),
|
---|
[159] | 459 | .lpm_widths(4)) bus_miso_mux_unit (
|
---|
| 460 | .sel(bus_addr[31:28]),
|
---|
[90] | 461 | .data(int_bus_miso),
|
---|
| 462 | .result(mrg_bus_miso));
|
---|
| 463 |
|
---|
| 464 | lpm_mux #(
|
---|
[159] | 465 | .lpm_size(12),
|
---|
[90] | 466 | .lpm_type("LPM_MUX"),
|
---|
| 467 | .lpm_width(1),
|
---|
[101] | 468 | .lpm_widths(4)) bus_busy_mux_unit (
|
---|
| 469 | .sel(bus_addr[31:28]),
|
---|
[90] | 470 | .data(bus_busy),
|
---|
| 471 | .result(mrg_bus_busy));
|
---|
| 472 |
|
---|
| 473 | lpm_decode #(
|
---|
[159] | 474 | .lpm_decodes(12),
|
---|
[90] | 475 | .lpm_type("LPM_DECODE"),
|
---|
[101] | 476 | .lpm_width(4)) lpm_decode_unit (
|
---|
| 477 | .data(bus_addr[31:28]),
|
---|
[159] | 478 | .eq(bus_ssel));
|
---|
[90] | 479 |
|
---|
[159] | 480 |
|
---|
[59] | 481 | control control_unit (
|
---|
[90] | 482 | .clock(sys_clock),
|
---|
[59] | 483 | .rx_empty(usb_rx_empty),
|
---|
| 484 | .tx_full(usb_tx_full),
|
---|
| 485 | .rx_data(usb_rx_data),
|
---|
| 486 | .rx_rdreq(usb_rx_rdreq),
|
---|
| 487 | .tx_wrreq(usb_tx_wrreq),
|
---|
| 488 | .tx_data(usb_tx_data),
|
---|
[90] | 489 | .bus_wren(bus_wren),
|
---|
| 490 | .bus_addr(bus_addr),
|
---|
| 491 | .bus_mosi(bus_mosi),
|
---|
| 492 | .bus_miso(mrg_bus_miso),
|
---|
| 493 | .bus_busy(mrg_bus_busy),
|
---|
[59] | 494 | .led(LED));
|
---|
[45] | 495 |
|
---|
[84] | 496 | /*
|
---|
| 497 | altserial_flash_loader #(
|
---|
| 498 | .enable_shared_access("OFF"),
|
---|
| 499 | .enhanced_mode(1),
|
---|
| 500 | .intended_device_family("Cyclone III")) sfl_unit (
|
---|
| 501 | .noe(1'b0),
|
---|
| 502 | .asmi_access_granted(),
|
---|
| 503 | .asmi_access_request(),
|
---|
| 504 | .data0out(),
|
---|
| 505 | .dclkin(),
|
---|
| 506 | .scein(),
|
---|
| 507 | .sdoin());
|
---|
| 508 | */
|
---|
| 509 |
|
---|
[54] | 510 | endmodule
|
---|