1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-30 02:32:53 +08:00
oh/xilibs/dv/IDELAYE2.v

69 lines
2.3 KiB
Coq
Raw Permalink Normal View History

2015-11-09 21:57:25 -05:00
/* verilator lint_off WIDTH */
2015-05-16 22:07:17 -04:00
module IDELAYE2 (/*AUTOARG*/
// Outputs
CNTVALUEOUT, DATAOUT,
// Inputs
C, CE, CINVCTRL, CNTVALUEIN, DATAIN, IDATAIN, INC, LD, LDPIPEEN,
REGRST
);
2015-11-03 10:32:56 -05:00
parameter CINVCTRL_SEL = "FALSE"; // Enable clock inversion
parameter DELAY_SRC = "IDATAIN"; // Delay input
parameter HIGH_PERFORMANCE_MODE = "FALSE";// Reduced jitter
parameter IDELAY_TYPE = "FIXED"; // Type of delay line
parameter integer IDELAY_VALUE = 0; // Input delay tap setting
parameter [0:0] IS_C_INVERTED = 1'b0; //
parameter [0:0] IS_DATAIN_INVERTED = 1'b0; //
parameter [0:0] IS_IDATAIN_INVERTED = 1'b0; //
parameter PIPE_SEL = "FALSE"; // Select pipelined mode
parameter real REFCLK_FREQUENCY = 200.0; // Ref clock frequency
parameter SIGNAL_PATTERN = "DATA"; // Input signal type
2015-05-16 22:07:17 -04:00
`ifdef XIL_TIMING
parameter LOC = "UNPLACED";
parameter integer SIM_DELAY_D = 0;
localparam DELAY_D = (IDELAY_TYPE == "VARIABLE") ? SIM_DELAY_D : 0;
`endif // ifdef XIL_TIMING
`ifndef XIL_TIMING
integer DELAY_D=0;
`endif // ifndef XIL_TIMING
output [4:0] CNTVALUEOUT; // count value for monitoring tap value
output DATAOUT; // delayed data
input C; // clock input for variable mode
input CE; // enable increment/decrement function
input CINVCTRL; // dynamically inverts clock polarity
input [4:0] CNTVALUEIN; // counter value for tap delay
input DATAIN; // data input from FGPA logic
input IDATAIN; // data input from IBUF
input INC; // increment tap delay
input LD; // loads the delay primitive
input LDPIPEEN; // enables the pipeline register delay
input REGRST; // reset for pipeline register
2015-11-03 10:32:56 -05:00
parameter real tap = 1 / (32 * 2 * (REFCLK_FREQUENCY/1000));
2015-10-07 19:18:27 -04:00
reg [4:0] idelay_reg=5'b0;
2015-11-03 10:32:56 -05:00
reg DATAOUT;
2015-10-07 19:18:27 -04:00
always @ (posedge C)
if(LD)
begin
idelay_reg[4:0] <= CNTVALUEIN[4:0];
2015-11-03 10:32:56 -05:00
end
//Variable delay
always @ (IDATAIN)
DATAOUT <= #(idelay_reg * tap) IDATAIN;
2015-10-07 19:18:27 -04:00
2015-11-03 10:32:56 -05:00
//not modeled
assign CNTVALUEOUT=5'b0;
2015-05-16 22:07:17 -04:00
endmodule // IDELAYE2