Rev | Line | |
---|
[41] | 1 | module adc_lvds
|
---|
| 2 | (
|
---|
| 3 | input wire lvds_dco,
|
---|
| 4 | input wire lvds_fco,
|
---|
| 5 | input wire [2:0] lvds_d,
|
---|
| 6 |
|
---|
[42] | 7 | output reg [11:0] adc_db,
|
---|
| 8 | output reg [11:0] adc_dc,
|
---|
| 9 | output reg [11:0] adc_dd
|
---|
[41] | 10 | );
|
---|
| 11 |
|
---|
| 12 | wire [2:0] int_data_h, int_data_l;
|
---|
[42] | 13 | reg [11:0] int_data_next [2:0];
|
---|
[44] | 14 | reg [11:0] int_data_reg [2:0];
|
---|
[41] | 15 |
|
---|
| 16 | altddio_in #(
|
---|
| 17 | .intended_device_family("Cyclone III"),
|
---|
[42] | 18 | .invert_input_clocks("ON"),
|
---|
[41] | 19 | .lpm_type("altddio_in"),
|
---|
| 20 | .width(3)) altddio_in_unit (
|
---|
| 21 | .datain(lvds_d),
|
---|
| 22 | .inclock(lvds_dco),
|
---|
| 23 | .aclr(1'b0),
|
---|
| 24 | .dataout_h(int_data_h),
|
---|
| 25 | .dataout_l(int_data_l),
|
---|
| 26 | .aset(1'b0),
|
---|
| 27 | .inclocken(1'b1),
|
---|
| 28 | .sclr(1'b0),
|
---|
| 29 | .sset(1'b0));
|
---|
| 30 |
|
---|
| 31 | always @ (posedge lvds_dco)
|
---|
| 32 | begin
|
---|
[44] | 33 | int_data_reg[0] <= int_data_next[0];
|
---|
| 34 | int_data_reg[1] <= int_data_next[1];
|
---|
| 35 | int_data_reg[2] <= int_data_next[2];
|
---|
[42] | 36 | end
|
---|
[41] | 37 |
|
---|
[42] | 38 | always @ (posedge lvds_fco)
|
---|
| 39 | begin
|
---|
| 40 | adc_db <= int_data_next[0];
|
---|
| 41 | adc_dc <= int_data_next[1];
|
---|
| 42 | adc_dd <= int_data_next[2];
|
---|
[41] | 43 | end
|
---|
| 44 |
|
---|
[42] | 45 | always @*
|
---|
| 46 | begin
|
---|
[44] | 47 | int_data_next[0] = {int_data_reg[0][9:0], int_data_l[0], int_data_h[0]};
|
---|
| 48 | int_data_next[1] = {int_data_reg[1][9:0], int_data_l[1], int_data_h[1]};
|
---|
| 49 | int_data_next[2] = {int_data_reg[2][9:0], int_data_l[2], int_data_h[2]};
|
---|
[42] | 50 | end
|
---|
[41] | 51 |
|
---|
[58] | 52 | endmodule
|
---|
Note:
See
TracBrowser
for help on using the repository browser.