46 parameter SENS_PHASE_WIDTH=
8,
// number of bits for te phase counter (depends on divisors) 47 // parameter SENS_PCLK_PERIOD = 3.000, // input period in ns, 0..100.000 - MANDATORY, resolution down to 1 ps 50 parameter CLKIN_PERIOD_SENSOR =
3.000,
// input period in ns, 0..100.000 - MANDATORY, resolution down to 1 ps 52 parameter CLKFBOUT_PHASE_SENSOR =
0.000,
// CLOCK FEEDBACK phase in degrees (3 significant digits, -360.000...+360.000) 61 parameter SENS_SS_EN =
"FALSE",
// Enables Spread Spectrum mode 62 parameter SENS_SS_MODE =
"CENTER_HIGH",
//"CENTER_HIGH","CENTER_LOW","DOWN_HIGH","DOWN_LOW" 70 parameter HISPI_KEEP_IRST =
5,
// number of cycles to keep irst on after release of prst (small number - use 1 hot) 81 parameter HISPI_IOSTANDARD =
"DIFF_SSTL18_I" //"DIFF_SSTL18_II" for high current (13.4mA vs 8mA), 83 input pclk,
// global clock input, pixel rate (220MHz for MT9F002) 84 input prst,
// reset @pclk (add sensor reset here) 91 // output reg [11:0] pxd_out, 93 // output reg vact_out, 96 output reg eof,
// @pclk 98 // delay control inputs 109 // input wait_all_lanes, // when 0 allow some lanes missing sync (for easier phase adjustment) 110 // MMCP output status 118 wire ipclk;
// re-generated half HiSPi clock (165 MHz) 119 wire ipclk2x;
// re-generated HiSPi clock (330 MHz) 121 // localparam WAIT_ALL_LANES = 4'h8; // number of output pixel cycles to wait after the earliest lane 122 // localparam FIFO_DEPTH = 4; 137 //non-parametrized lane switch (4x4) 180 )
sens_hispi_clock_i (
221 //`ifdef REVERSE_LANES 222 // .din_p ({sns_dp[0],sns_dp[1],sns_dp[2],sns_dp[3]}), // input[3:0] 223 // .din_n ({sns_dn[0],sns_dn[1],sns_dn[2],sns_dn[3]}), // input[3:0] 240 // TODO - try to make that something will be recorded even if some lanes are bad (to simplify phase adjust 241 // possibly - extra control bit (wait_all_lanes) 251 // wire [HISPI_NUMLANES-1:0] sol_pclk = rd_run & ~rd_run_d; 283 // irst_r <= {irst_r[1:0], prst}; 312 // not using HISPI_NUMLANES here - fix? Will be 0 (not possible in hispi) when no data 313 /* pxd_out <= ({12 {fifo_re_r[0] & rd_run[0]}} & fifo_out[0 * 12 +:12]) | 314 ({12 {fifo_re_r[1] & rd_run[1]}} & fifo_out[1 * 12 +:12]) | 315 ({12 {fifo_re_r[2] & rd_run[2]}} & fifo_out[2 * 12 +:12]) | 316 ({12 {fifo_re_r[3] & rd_run[3]}} & fifo_out[3 * 12 +:12]); **/ 319 // else if (sol_pclk || (rd_line && fifo_re[HISPI_NUMLANES - 1])) fifo_re <= 1; 323 // if (prst || (hact_off && (|(good_lanes & ~rd_run)))) hact_r <= 0; 329 // vact_out <= vact_pclk_strt [0] || hact_r; 334 )
dly_16_start_line_i (
336 .
rst (
1'b0),
// input 346 .
rst (
1'b0),
// input 347 // .dly (4'h2), // input[3:0] 348 // .dly (4'h3), // input[3:0] 349 .
dly (
4'h1),
// input[3:0] 350 // .dly (4'h2), // input[3:0] 357 )
dly_16_hact_off_i (
359 .
rst (
1'b0),
// input 360 // .dly (4'h2), // input[3:0] 361 // .dly (4'h0), // input[3:0] 362 .
dly (
4'h1),
// input[3:0] 363 // .dly (4'h2), // input[3:0] 372 .
rst (
1'b0),
// input 373 // .dly (4'h2), // input[3:0] 374 .
dly (
4'h0),
// input[3:0] 375 // .dly (4'h1), // input[3:0] 382 for (
i=
0;
i <
4;
i=
i+
1)
begin:
hispi_lane 385 )
sens_hispi_lane_i (
398 // .COUNT_START (HISPI_FIFO_START), 401 )
sens_hispi_fifo_i (
7121fifo_out_dlyreg[HISPI_FIFO_DEPTH-1:0]
7115sns_dwire[HISPI_NUMLANES*4-1:0]
7066SENS_REF_JITTER10.010
7130vact_pclk_strtreg[1:0]
[HISPI_NUMLANES-1:0] 7091sns_dn
sens_hispi_fifo_i sens_hispi_fifo[generate]
7112clkfb_pxd_stopped_mmcm
sens_hispi_clock_i sens_hispi_clock
7067SENS_REF_JITTER20.010
7123hispi_dvwire[HISPI_NUMLANES-1:0]
7080HISPI_CAPACITANCE"DONT_CARE"
7060CLKFBOUT_PHASE_SENSOR0.000
7077HISPI_WAIT_ALL_LANES4'h8
[HISPI_NUMLANES-1:0] 7225din_n
7074HISPI_DELAY_CLK"FALSE"
7143fifo_outwire[HISPI_NUMLANES*12-1:0]
7131rd_runwire[HISPI_NUMLANES-1:0]
7191clkin_pxd_stopped_mmcm
7139good_lanesreg[HISPI_NUMLANES-1:0]
reg [DATA_WIDTH-1:0] 7241dout
7140fifo_rereg[HISPI_NUMLANES-1:0]
7120fifo_out_dly_mclkreg[HISPI_FIFO_DEPTH-1:0]
[HISPI_NUMLANES-1:0] 7219set_idelay
7141fifo_re_rreg[HISPI_NUMLANES-1:0]
7135rd_run_dreg[HISPI_NUMLANES-1:0]
7148pxd_out_prewire[11:0]
7052IODELAY_GRP"IODELAY_SENSOR"
7116irst_rreg[HISPI_KEEP_IRST-1:0]
7128hispi_eolwire[HISPI_NUMLANES-1:0]
7057SENS_BANDWIDTH"OPTIMIZED"
7087HISPI_IOSTANDARD"DIFF_SSTL18_I"
7127hispi_solwire[HISPI_NUMLANES-1:0]
7070SENS_SS_MOD_PERIOD10000
7126hispi_eofwire[HISPI_NUMLANES-1:0]
7085HISPI_IBUF_LOW_PWR"TRUE"
7081HISPI_DIFF_TERM"TRUE"
7146ignore_embedded_ipclkreg
7069SENS_SS_MODE"CENTER_HIGH"
[HISPI_NUMLANES * 8-1:0] 7218dly_data
7192clkfb_pxd_stopped_mmcm
7111clkin_pxd_stopped_mmcm
[HISPI_NUMLANES * 4-1:0] 7226dout
sens_hispi_lane_i sens_hispi_lane[generate]
7084HISPI_IBUF_DELAY_VALUE"0"
[HISPI_NUMLANES-1:0] 7224din_p
7122hispi_alignedwire[HISPI_NUMLANES*12-1:0]
7125hispi_sofwire[HISPI_NUMLANES-1:0]
7118lanes_mapreg[HISPI_NUMLANES*2-1:0]
7058CLKIN_PERIOD_SENSOR3.000
7055HIGH_PERFORMANCE_MODE"FALSE"
sens_hispi_din_i sens_hispi_din
7071DEFAULT_LANE_MAP8'b11100100
integer 7053IDELAY_VALUE0
[HISPI_NUMLANES * 8-1:0] 7100dly_data
[HISPI_NUMLANES-1:0] 7103set_idelay
[DATA_DEPTH-1:0] 7237out_dly
7059CLKFBOUT_MULT_SENSOR3
7086HISPI_IFD_DELAY_VALUE"AUTO"
7124hispi_embedwire[HISPI_NUMLANES-1:0]
real 7054REFCLK_FREQUENCY200.0
7119logical_lanes4reg[HISPI_NUMLANES*4-1:0]
[HISPI_NUMLANES-1:0] 7090sns_dp
7082HISPI_UNTUNED_SPLIT"FALSE"