[27] | 1 | module Paella
|
---|
| 2 | (
|
---|
| 3 | input wire CLK_50MHz,
|
---|
| 4 | output wire LED,
|
---|
| 5 |
|
---|
| 6 | inout wire [3:0] TRG,
|
---|
| 7 | inout wire [6:0] CON_A,
|
---|
| 8 | inout wire [15:0] CON_B,
|
---|
| 9 | inout wire [12:0] CON_C,
|
---|
| 10 | input wire [1:0] CON_BCLK,
|
---|
| 11 | input wire [1:0] CON_CCLK,
|
---|
| 12 |
|
---|
| 13 | input wire ADC_DCO,
|
---|
| 14 | input wire ADC_FCO,
|
---|
[41] | 15 | input wire [2:0] ADC_D,
|
---|
[27] | 16 |
|
---|
| 17 | output wire USB_SLRD,
|
---|
| 18 | output wire USB_SLWR,
|
---|
| 19 | input wire USB_IFCLK,
|
---|
| 20 | input wire USB_FLAGA, // EMPTY flag for EP6
|
---|
| 21 | input wire USB_FLAGB, // FULL flag for EP8
|
---|
| 22 | input wire USB_FLAGC,
|
---|
[30] | 23 | inout wire USB_PA0,
|
---|
| 24 | inout wire USB_PA1,
|
---|
| 25 | output wire USB_PA2,
|
---|
| 26 | inout wire USB_PA3,
|
---|
| 27 | output wire USB_PA4,
|
---|
| 28 | output wire USB_PA5,
|
---|
| 29 | output wire USB_PA6,
|
---|
| 30 | inout wire USB_PA7,
|
---|
[27] | 31 | inout wire [7:0] USB_PB,
|
---|
| 32 |
|
---|
| 33 | output wire RAM_CLK,
|
---|
| 34 | output wire RAM_CE1,
|
---|
| 35 | output wire RAM_WE,
|
---|
| 36 | output wire [19:0] RAM_ADDR,
|
---|
| 37 | inout wire RAM_DQAP,
|
---|
| 38 | inout wire [7:0] RAM_DQA,
|
---|
| 39 | inout wire RAM_DQBP,
|
---|
| 40 | inout wire [7:0] RAM_DQB
|
---|
| 41 | );
|
---|
| 42 |
|
---|
| 43 | // Turn output ports off
|
---|
| 44 | assign RAM_CLK = 1'b0;
|
---|
| 45 | assign RAM_CE1 = 1'b0;
|
---|
| 46 | assign RAM_WE = 1'b0;
|
---|
| 47 | assign RAM_ADDR = 20'h00000;
|
---|
| 48 |
|
---|
| 49 | // Turn inout ports to tri-state
|
---|
| 50 | assign TRG = 4'bz;
|
---|
| 51 | assign CON_A = 7'bz;
|
---|
| 52 | assign CON_B = 16'bz;
|
---|
| 53 | assign CON_C = 13'bz;
|
---|
[30] | 54 | assign USB_PA0 = 1'bz;
|
---|
| 55 | assign USB_PA1 = 1'bz;
|
---|
| 56 | assign USB_PA3 = 1'bz;
|
---|
| 57 | assign USB_PA7 = 1'bz;
|
---|
[27] | 58 | assign RAM_DQAP = 1'bz;
|
---|
| 59 | assign RAM_DQA = 8'bz;
|
---|
| 60 | assign RAM_DQBP = 1'bz;
|
---|
| 61 | assign RAM_DQB = 8'bz;
|
---|
| 62 |
|
---|
[30] | 63 |
|
---|
| 64 | assign USB_PA2 = ~usb_rden;
|
---|
| 65 | assign USB_PA4 = usb_addr[0];
|
---|
| 66 | assign USB_PA5 = usb_addr[1];
|
---|
| 67 | assign USB_PA6 = ~usb_pktend;
|
---|
| 68 |
|
---|
[27] | 69 | reg [31:0] counter;
|
---|
[31] | 70 | reg led_reg;
|
---|
[30] | 71 | // assign LED = counter[24];
|
---|
[31] | 72 | assign LED = led_reg;
|
---|
[27] | 73 |
|
---|
| 74 | wire usb_wrreq, usb_rdreq, usb_rden, usb_pktend;
|
---|
[35] | 75 | wire usb_fifo_aclr;
|
---|
[30] | 76 | reg usb_fifo_tx_wrreq;
|
---|
| 77 | reg usb_fifo_rx_rdreq;
|
---|
[27] | 78 | wire usb_fifo_tx_full, usb_fifo_rx_empty;
|
---|
[30] | 79 | reg [7:0] usb_fifo_tx_data;
|
---|
| 80 | wire [7:0] usb_fifo_rx_data;
|
---|
[27] | 81 | wire [1:0] usb_addr;
|
---|
| 82 |
|
---|
| 83 | assign USB_SLRD = ~usb_rdreq;
|
---|
| 84 | assign USB_SLWR = ~usb_wrreq;
|
---|
| 85 |
|
---|
| 86 | usb_fifo usb_fifo_unit
|
---|
| 87 | (
|
---|
| 88 | .usb_clk(USB_IFCLK),
|
---|
| 89 | .usb_data(USB_PB),
|
---|
| 90 | .usb_full(~USB_FLAGB),
|
---|
| 91 | .usb_empty(~USB_FLAGA),
|
---|
| 92 | .usb_wrreq(usb_wrreq),
|
---|
| 93 | .usb_rdreq(usb_rdreq),
|
---|
| 94 | .usb_rden(usb_rden),
|
---|
| 95 | .usb_pktend(usb_pktend),
|
---|
| 96 | .usb_addr(usb_addr),
|
---|
[34] | 97 |
|
---|
[27] | 98 | .clk(CLK_50MHz),
|
---|
| 99 | .aclr(usb_fifo_aclr),
|
---|
[34] | 100 |
|
---|
| 101 | .tx_full(usb_fifo_tx_full),
|
---|
| 102 | .tx_wrreq((~usb_fifo_tx_full) & usb_fifo_tx_wrreq),
|
---|
[27] | 103 | .tx_data(usb_fifo_tx_data),
|
---|
[34] | 104 |
|
---|
[27] | 105 | .rx_empty(usb_fifo_rx_empty),
|
---|
[37] | 106 | .rx_rdreq((~usb_fifo_rx_empty) & usb_fifo_rx_rdreq),
|
---|
[35] | 107 | .rx_q(usb_fifo_rx_data)
|
---|
[27] | 108 | );
|
---|
| 109 |
|
---|
[37] | 110 | reg [23:0] rx_counter;
|
---|
[35] | 111 | reg [10:0] tst_counter;
|
---|
| 112 |
|
---|
[45] | 113 | reg ana_reset [3:0];
|
---|
| 114 | wire ana_peak_ready [3:0];
|
---|
| 115 | wire [11:0] ana_peak [3:0];
|
---|
[44] | 116 |
|
---|
[35] | 117 | reg [9:0] osc_counter;
|
---|
[27] | 118 |
|
---|
[45] | 119 | reg osc_reset [3:0];
|
---|
| 120 | wire [9:0] osc_start_addr [3:0];
|
---|
| 121 | reg [9:0] osc_addr [3:0];
|
---|
| 122 | wire [15:0] osc_q [3:0];
|
---|
[44] | 123 | reg [15:0] osc_q_mux;
|
---|
| 124 |
|
---|
[45] | 125 | reg hst_reset [3:0];
|
---|
| 126 | reg [11:0] hst_addr [3:0];
|
---|
| 127 | wire [23:0] hst_q [3:0];
|
---|
[27] | 128 |
|
---|
[45] | 129 | reg mux_reset, mux_type;
|
---|
| 130 | reg [1:0] mux_chan, mux_byte, mux_max_byte;
|
---|
| 131 | reg [15:0] mux_addr, mux_min_addr, mux_max_addr;
|
---|
| 132 | reg [7:0] mux_q;
|
---|
[44] | 133 |
|
---|
[45] | 134 | reg [3:0] state1, state2;
|
---|
[27] | 135 | reg adc_fifo_aclr;
|
---|
| 136 |
|
---|
[45] | 137 | wire adc_clk [3:0];
|
---|
[41] | 138 |
|
---|
[45] | 139 | // reg [11:0] adc_data;
|
---|
[41] | 140 |
|
---|
[45] | 141 | wire adc_data_ready [3:0];
|
---|
| 142 | wire [11:0] adc_data [3:0];
|
---|
[41] | 143 |
|
---|
[45] | 144 | wire [11:0] raw_data [3:0];
|
---|
| 145 | wire [11:0] uwt_data [3:0];
|
---|
| 146 | wire [1:0] uwt_flag [3:0];
|
---|
| 147 |
|
---|
| 148 | assign adc_clk[0] = ADC_FCO;
|
---|
| 149 | assign adc_clk[1] = ADC_FCO;
|
---|
| 150 | assign adc_clk[2] = ADC_FCO;
|
---|
| 151 | assign adc_clk[3] = CON_B[0];
|
---|
| 152 | assign adc_data[3] = CON_B[12:1];
|
---|
| 153 | /*
|
---|
[27] | 154 | pll pll_unit(
|
---|
| 155 | .inclk0(CLK_50MHz),
|
---|
| 156 | .c0(adc_clk));
|
---|
[45] | 157 | */
|
---|
[41] | 158 | /*
|
---|
[38] | 159 | altserial_flash_loader #(
|
---|
| 160 | .enable_shared_access("OFF"),
|
---|
| 161 | .enhanced_mode(1),
|
---|
| 162 | .intended_device_family("Cyclone III")) sfl_unit (
|
---|
| 163 | .noe(1'b0),
|
---|
| 164 | .asmi_access_granted(),
|
---|
| 165 | .asmi_access_request(),
|
---|
| 166 | .data0out(),
|
---|
| 167 | .dclkin(),
|
---|
| 168 | .scein(),
|
---|
| 169 | .sdoin());
|
---|
[41] | 170 | */
|
---|
| 171 | adc_lvds adc_lvds_unit (
|
---|
| 172 | .lvds_dco(ADC_DCO),
|
---|
| 173 | .lvds_fco(ADC_FCO),
|
---|
| 174 | .lvds_d(ADC_D),
|
---|
[45] | 175 | .adc_db(adc_data[0]),
|
---|
| 176 | .adc_dc(adc_data[1]),
|
---|
| 177 | .adc_dd(adc_data[2]));
|
---|
[44] | 178 |
|
---|
| 179 | genvar i;
|
---|
| 180 | generate
|
---|
[45] | 181 | for (i = 0; i < 4; i = i + 1)
|
---|
[44] | 182 | begin : MCA_CHAIN
|
---|
| 183 | adc_fifo adc_fifo_unit (
|
---|
[45] | 184 | .adc_clk(adc_clk[i]),
|
---|
| 185 | .adc_data(adc_data[i]),
|
---|
[44] | 186 | .aclr(adc_fifo_aclr),
|
---|
| 187 | .rdclk(CLK_50MHz),
|
---|
| 188 | .ready(adc_data_ready[i]),
|
---|
| 189 | .raw_data(raw_data[i]),
|
---|
| 190 | .uwt_data({uwt_flag[i], uwt_data[i]}));
|
---|
[27] | 191 |
|
---|
[44] | 192 | analyser analyser_unit (
|
---|
| 193 | .clk(CLK_50MHz),
|
---|
| 194 | .reset(ana_reset[i]),
|
---|
| 195 | .data_ready(adc_data_ready[i]),
|
---|
| 196 | .uwt_flag(uwt_flag[i]),
|
---|
| 197 | .uwt_data(uwt_data[i]),
|
---|
| 198 | .peak_ready(ana_peak_ready[i]),
|
---|
| 199 | .peak(ana_peak[i]));
|
---|
| 200 | /*
|
---|
| 201 | histogram histogram_unit (
|
---|
| 202 | .clk(CLK_50MHz),
|
---|
| 203 | .reset(hst_reset[i]),
|
---|
| 204 | .data_ready(adc_data_ready[i]),
|
---|
| 205 | .data(raw_data[i]),
|
---|
| 206 | .address(hst_addr[i]),
|
---|
| 207 | .q(hst_q[i]));
|
---|
| 208 | */
|
---|
| 209 | histogram histogram_unit (
|
---|
| 210 | .clk(CLK_50MHz),
|
---|
| 211 | .reset(hst_reset[i]),
|
---|
| 212 | .data_ready(ana_peak_ready[i]),
|
---|
| 213 | .data(ana_peak[i]),
|
---|
| 214 | .address(hst_addr[i]),
|
---|
| 215 | .q(hst_q[i]));
|
---|
| 216 |
|
---|
| 217 | oscilloscope oscilloscope_unit (
|
---|
| 218 | .clk(CLK_50MHz),
|
---|
| 219 | .reset(osc_reset[i]),
|
---|
| 220 | .data_ready(adc_data_ready[i]),
|
---|
| 221 | .raw_data(raw_data[i]),
|
---|
| 222 | .uwt_data(uwt_data[i]),
|
---|
| 223 | .threshold(16'd100),
|
---|
| 224 | .address(osc_addr[i]),
|
---|
| 225 | .start_address(osc_start_addr[i]),
|
---|
| 226 | .q(osc_q[i]));
|
---|
| 227 | end
|
---|
| 228 | endgenerate
|
---|
[27] | 229 |
|
---|
[30] | 230 | /*
|
---|
[27] | 231 | always @ (posedge adc_clk)
|
---|
| 232 | begin
|
---|
| 233 | counter <= counter + 32'd1;
|
---|
| 234 | end
|
---|
[30] | 235 | */
|
---|
[27] | 236 |
|
---|
[44] | 237 | always @*
|
---|
[27] | 238 | begin
|
---|
[45] | 239 | osc_reset[0] = 1'b0;
|
---|
| 240 | osc_addr[0] = 10'b0;
|
---|
| 241 | osc_reset[1] = 1'b0;
|
---|
| 242 | osc_addr[1] = 10'b0;
|
---|
| 243 | osc_reset[2] = 1'b0;
|
---|
| 244 | osc_addr[2] = 10'b0;
|
---|
| 245 | osc_reset[3] = 1'b0;
|
---|
| 246 | osc_addr[3] = 10'b0;
|
---|
| 247 | hst_reset[0] = 1'b0;
|
---|
| 248 | hst_addr[0] = 12'b0;
|
---|
| 249 | hst_reset[1] = 1'b0;
|
---|
| 250 | hst_addr[1] = 12'b0;
|
---|
| 251 | hst_reset[2] = 1'b0;
|
---|
| 252 | hst_addr[2] = 12'b0;
|
---|
| 253 | hst_reset[3] = 1'b0;
|
---|
| 254 | hst_addr[3] = 12'b0;
|
---|
| 255 | case({mux_type,mux_chan})
|
---|
| 256 | 3'b000, 3'b001, 3'b010, 3'b011:
|
---|
[27] | 257 | begin
|
---|
[45] | 258 | osc_reset[mux_chan] = mux_reset;
|
---|
| 259 | osc_addr[mux_chan] = mux_addr[9:0];
|
---|
| 260 | mux_max_byte = 2'd1;
|
---|
| 261 | mux_min_addr = {6'd0, osc_start_addr[mux_chan]};
|
---|
| 262 | mux_max_addr = {6'd0, osc_start_addr[mux_chan]} + 16'd1023;
|
---|
[27] | 263 | end
|
---|
[45] | 264 |
|
---|
| 265 | 3'b100, 3'b101, 3'b110, 3'b111:
|
---|
[27] | 266 | begin
|
---|
[45] | 267 | hst_reset[mux_chan] = mux_reset;
|
---|
| 268 | hst_addr[mux_chan] = mux_addr[11:0];
|
---|
| 269 | mux_max_byte = 2'd2;
|
---|
| 270 | mux_min_addr = 16'd0;
|
---|
| 271 | mux_max_addr = 16'd4095;
|
---|
[27] | 272 | end
|
---|
| 273 | endcase
|
---|
| 274 | end
|
---|
[45] | 275 |
|
---|
| 276 | always @*
|
---|
| 277 | begin
|
---|
| 278 | case ({mux_type,mux_byte})
|
---|
| 279 | 5'b000: mux_q = osc_q[mux_chan][7:0];
|
---|
| 280 | 5'b001: mux_q = osc_q[mux_chan][15:8];
|
---|
[35] | 281 |
|
---|
[45] | 282 | 5'b100: mux_q = hst_q[mux_chan][7:0];
|
---|
| 283 | 5'b101: mux_q = hst_q[mux_chan][15:8];
|
---|
| 284 | 5'b110: mux_q = hst_q[mux_chan][23:16];
|
---|
| 285 |
|
---|
| 286 | default: mux_q = 8'd0;
|
---|
| 287 | endcase
|
---|
| 288 | end
|
---|
| 289 |
|
---|
| 290 |
|
---|
[30] | 291 | always @(posedge CLK_50MHz)
|
---|
| 292 | begin
|
---|
[37] | 293 | if (~usb_fifo_rx_empty)
|
---|
| 294 | begin
|
---|
| 295 | led_reg <= 1'b0;
|
---|
| 296 | rx_counter <= 24'd0;
|
---|
| 297 | end
|
---|
| 298 | else
|
---|
| 299 | begin
|
---|
| 300 | if (&rx_counter)
|
---|
| 301 | begin
|
---|
| 302 | led_reg <= 1'b1;
|
---|
| 303 | end
|
---|
| 304 | else
|
---|
| 305 | begin
|
---|
| 306 | rx_counter <= rx_counter + 24'd1;
|
---|
| 307 | end
|
---|
| 308 | end
|
---|
| 309 |
|
---|
[35] | 310 | case(state1)
|
---|
[30] | 311 | 1:
|
---|
| 312 | begin
|
---|
[37] | 313 | usb_fifo_rx_rdreq <= 1'b1;
|
---|
[30] | 314 | usb_fifo_tx_wrreq <= 1'b0;
|
---|
[45] | 315 | mux_type <= 1'b0;
|
---|
| 316 | mux_chan <= 2'd0;
|
---|
| 317 | mux_byte <= 2'd0;
|
---|
| 318 | mux_reset <= 1'b0;
|
---|
[35] | 319 | state1 <= 4'd2;
|
---|
[30] | 320 | end
|
---|
| 321 |
|
---|
| 322 | 2:
|
---|
| 323 | begin
|
---|
| 324 | if (~usb_fifo_rx_empty)
|
---|
| 325 | begin
|
---|
| 326 | case (usb_fifo_rx_data)
|
---|
[45] | 327 | 8'h40, 8'h41, 8'h42, 8'h43, 8'h50, 8'h51, 8'h52, 8'h53:
|
---|
[30] | 328 | begin
|
---|
[37] | 329 | usb_fifo_rx_rdreq <= 1'b0;
|
---|
[45] | 330 | mux_type <= usb_fifo_rx_data[4];
|
---|
| 331 | mux_chan <= usb_fifo_rx_data[1:0];
|
---|
| 332 | mux_reset <= 1'b1;
|
---|
[35] | 333 | state1 <= 4'd1;
|
---|
[30] | 334 | end
|
---|
[45] | 335 |
|
---|
| 336 | 8'h60, 8'h61, 8'h62, 8'h63, 8'h70, 8'h71, 8'h72, 8'h73:
|
---|
[30] | 337 | begin
|
---|
[37] | 338 | usb_fifo_rx_rdreq <= 1'b0;
|
---|
[45] | 339 | mux_type <= usb_fifo_rx_data[4];
|
---|
| 340 | mux_chan <= usb_fifo_rx_data[1:0];
|
---|
[35] | 341 | state1 <= 4'd3;
|
---|
[30] | 342 | end
|
---|
[45] | 343 |
|
---|
[44] | 344 | 8'h30:
|
---|
[35] | 345 | begin
|
---|
[37] | 346 | usb_fifo_rx_rdreq <= 1'b0;
|
---|
[35] | 347 | state1 <= 4'd1;
|
---|
| 348 | end
|
---|
[45] | 349 |
|
---|
[44] | 350 | 8'h31:
|
---|
[35] | 351 | begin
|
---|
[37] | 352 | usb_fifo_rx_rdreq <= 1'b0;
|
---|
[35] | 353 | tst_counter <= 11'd0;
|
---|
| 354 | state1 <= 4'd9;
|
---|
| 355 | end
|
---|
[30] | 356 | endcase
|
---|
| 357 | end
|
---|
| 358 | end
|
---|
[45] | 359 | // mux transfer
|
---|
[30] | 360 | 3:
|
---|
| 361 | begin
|
---|
[45] | 362 | mux_addr <= mux_min_addr;
|
---|
| 363 | mux_byte <= 2'd0;
|
---|
[35] | 364 | state1 <= 4'd4;
|
---|
| 365 | end
|
---|
| 366 | 4:
|
---|
| 367 | begin
|
---|
[45] | 368 | usb_fifo_tx_data <= mux_q;
|
---|
| 369 | usb_fifo_tx_wrreq <= 1'b1;
|
---|
| 370 | mux_byte <= 2'd1;
|
---|
| 371 | state1 <= 4'd5;
|
---|
[30] | 372 | end
|
---|
[34] | 373 | 5:
|
---|
| 374 | begin
|
---|
| 375 | if (~usb_fifo_tx_full)
|
---|
| 376 | begin
|
---|
[45] | 377 | usb_fifo_tx_data <= mux_q;
|
---|
| 378 | if ((mux_byte == mux_max_byte) && (mux_addr == mux_max_addr))
|
---|
[30] | 379 | begin
|
---|
[45] | 380 | state1 <= 4'd6;
|
---|
[30] | 381 | end
|
---|
[35] | 382 | else
|
---|
[34] | 383 | begin
|
---|
[45] | 384 | if (mux_byte == mux_max_byte)
|
---|
[35] | 385 | begin
|
---|
[45] | 386 | mux_addr <= mux_addr + 16'd1;
|
---|
| 387 | mux_byte <= 2'd0;
|
---|
[35] | 388 | end
|
---|
[45] | 389 | else
|
---|
| 390 | begin
|
---|
| 391 | mux_byte <= mux_byte + 2'd1;
|
---|
| 392 | end
|
---|
[34] | 393 | end
|
---|
[30] | 394 | end
|
---|
| 395 | end
|
---|
[45] | 396 | 6:
|
---|
[30] | 397 | begin
|
---|
[35] | 398 | if (~usb_fifo_tx_full)
|
---|
[30] | 399 | begin
|
---|
[35] | 400 | usb_fifo_tx_wrreq <= 1'b0;
|
---|
| 401 | state1 <= 4'd1;
|
---|
[30] | 402 | end
|
---|
[34] | 403 | end
|
---|
[35] | 404 | // tst transfer
|
---|
[45] | 405 | 7:
|
---|
[34] | 406 | begin
|
---|
[35] | 407 | usb_fifo_tx_data <= tst_counter;
|
---|
[34] | 408 | usb_fifo_tx_wrreq <= 1'b1;
|
---|
[35] | 409 | tst_counter <= tst_counter + 11'd1;
|
---|
[45] | 410 | state1 <= 4'd8;
|
---|
[34] | 411 | end
|
---|
[45] | 412 | 8:
|
---|
[34] | 413 | begin
|
---|
| 414 | if (~usb_fifo_tx_full)
|
---|
[30] | 415 | begin
|
---|
[35] | 416 | usb_fifo_tx_data <= tst_counter;
|
---|
| 417 | if (tst_counter == 11'd0) //(&osc_counter)
|
---|
[34] | 418 | begin
|
---|
[45] | 419 | state1 <= 4'd9;
|
---|
[34] | 420 | end
|
---|
| 421 | else
|
---|
| 422 | begin
|
---|
[35] | 423 | tst_counter <= tst_counter + 11'd1;
|
---|
[34] | 424 | end
|
---|
[30] | 425 | end
|
---|
| 426 | end
|
---|
[45] | 427 | 9:
|
---|
[30] | 428 | begin
|
---|
[34] | 429 | if (~usb_fifo_tx_full)
|
---|
[30] | 430 | begin
|
---|
[34] | 431 | usb_fifo_tx_wrreq <= 1'b0;
|
---|
[35] | 432 | state1 <= 4'd1;
|
---|
[30] | 433 | end
|
---|
| 434 | end
|
---|
[35] | 435 |
|
---|
| 436 | default:
|
---|
| 437 | begin
|
---|
| 438 | state1 <= 4'd1;
|
---|
| 439 | end
|
---|
[30] | 440 | endcase
|
---|
| 441 | end
|
---|
[45] | 442 | /*
|
---|
[27] | 443 | always @ (posedge adc_clk)
|
---|
| 444 | begin
|
---|
| 445 | case (state2)
|
---|
| 446 | 1:
|
---|
| 447 | begin
|
---|
| 448 | adc_data <= 12'd0;
|
---|
[35] | 449 | state2 <= 4'd2;
|
---|
[27] | 450 | end
|
---|
| 451 |
|
---|
| 452 | 2:
|
---|
| 453 | begin
|
---|
| 454 | adc_data <= 12'd1024;
|
---|
[35] | 455 | state2 <= 4'd3;
|
---|
[27] | 456 | end
|
---|
| 457 |
|
---|
| 458 | 3:
|
---|
| 459 | begin
|
---|
| 460 | adc_data <= 12'd2048;
|
---|
[35] | 461 | state2 <= 4'd4;
|
---|
[27] | 462 | end
|
---|
| 463 |
|
---|
| 464 | 4:
|
---|
| 465 | begin
|
---|
| 466 | adc_data <= 12'd3072;
|
---|
[35] | 467 | state2 <= 4'd5;
|
---|
[27] | 468 | end
|
---|
| 469 |
|
---|
| 470 | 5:
|
---|
| 471 | begin
|
---|
| 472 | adc_data <= 12'd4095;
|
---|
[35] | 473 | state2 <= 4'd1;
|
---|
[27] | 474 | end
|
---|
| 475 |
|
---|
| 476 | default:
|
---|
| 477 | begin
|
---|
[35] | 478 | state2 <= 4'd1;
|
---|
[27] | 479 | end
|
---|
| 480 | endcase
|
---|
| 481 | end
|
---|
[45] | 482 | */
|
---|
[27] | 483 | endmodule
|
---|