2015-05-13 23:33:26 -04:00
|
|
|
/*WARNING: INCOMPLETE MODEL, DON'T USE. I RECOMMEND AGAINST USING THIS
|
|
|
|
*BLOCK ALL TOGETHER. NOT OPEN SOURCE FRIENDLY /AO
|
|
|
|
*/
|
|
|
|
|
2014-12-14 22:21:01 -05:00
|
|
|
module ISERDESE2 (/*AUTOARG*/
|
|
|
|
// Outputs
|
2015-04-16 22:30:09 -04:00
|
|
|
O, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, SHIFTOUT1, SHIFTOUT2,
|
2014-12-14 22:21:01 -05:00
|
|
|
// Inputs
|
2015-04-16 22:30:09 -04:00
|
|
|
BITSLIP, CE1, CE2, CLK, CLKB, CLKDIV, CLKDIVP, D, DDLY,
|
|
|
|
DYNCLKDIVSEL, DYNCLKSEL, OCLK, OCLKB, OFB, RST, SHIFTIN1, SHIFTIN2
|
2014-12-14 22:21:01 -05:00
|
|
|
);
|
|
|
|
|
2015-04-16 22:30:09 -04:00
|
|
|
parameter DATA_RATE = 0; // "DDR" or "SDR"
|
|
|
|
parameter DATA_WIDTH = 0; // 4,2,3,5,6,7,8,10,14
|
|
|
|
parameter DYN_CLK_INV_EN = 0; // "FALSE", "TRUE"
|
|
|
|
parameter DYN_CLKDIV_INV_EN = 0; // "FALSE", "TRUE"
|
|
|
|
parameter INIT_Q1 = 0; // 1'b0 to 1'b1
|
|
|
|
parameter INIT_Q2 = 0; // 1'b0 to 1'b1
|
|
|
|
parameter INIT_Q3 = 0; // 1'b0 to 1'b1
|
|
|
|
parameter INIT_Q4 = 0; // 1'b0 to 1'b1
|
|
|
|
parameter INTERFACE_TYPE = 0; // "MEMORY","MEMORY_DDR3", "MEMORY_QDR",
|
|
|
|
// "NETWORKING", "OVERSAMPLE"
|
|
|
|
parameter IOBDELAY = 0; // "NONE", "BOTH", "IBUF", "IFD"
|
|
|
|
parameter NUM_CE = 0; // 2,1
|
|
|
|
parameter OFB_USED = 0; // "FALSE", "TRUE"
|
|
|
|
parameter SERDES_MODE = 0; // "MASTER" or "SLAVE"
|
|
|
|
parameter SRVAL_Q1 = 0; // 1'b0 or 1'b1
|
|
|
|
parameter SRVAL_Q2 = 0; // 1'b0 or 1'b1
|
|
|
|
parameter SRVAL_Q3 = 0; // 1'b0 or 1'b1
|
|
|
|
parameter SRVAL_Q4 = 0; // 1'b0 or 1'b1
|
2015-04-11 00:04:18 -04:00
|
|
|
|
2015-04-16 22:30:09 -04:00
|
|
|
input BITSLIP; // performs bitslip operation
|
|
|
|
input CE1; // clock enable
|
|
|
|
input CE2; // clock enable
|
|
|
|
input CLK; // high speed clock input
|
|
|
|
input CLKB; // high speed clock input (inverted)
|
2015-05-13 23:33:26 -04:00
|
|
|
input CLKDIV; // divided clock (for bitslip and CE module)
|
2015-04-16 22:30:09 -04:00
|
|
|
input CLKDIVP; // for MIG only
|
|
|
|
input D; // serial input data pin
|
|
|
|
input DDLY; // serial input data from IDELAYE2
|
|
|
|
input DYNCLKDIVSEL; // dynamically select CLKDIV inversion
|
|
|
|
input DYNCLKSEL; // dynamically select CLK and CLKB inversion.
|
|
|
|
input OCLK; // clock for strobe based memory interfaces
|
|
|
|
input OCLKB; // clock for strobe based memory interfaces
|
|
|
|
input OFB; // data feebdack from OSERDESE2?
|
|
|
|
input RST; // asynchronous reset
|
|
|
|
input SHIFTIN1; // slave of multie serdes
|
|
|
|
input SHIFTIN2; // slave of multie serdes
|
|
|
|
|
2015-04-11 00:04:18 -04:00
|
|
|
//outputs
|
2015-04-16 22:30:09 -04:00
|
|
|
output O; // pass through from D or DDLY
|
|
|
|
output Q1; // parallel data out (last bit)
|
2015-04-11 00:04:18 -04:00
|
|
|
output Q2;
|
|
|
|
output Q3;
|
|
|
|
output Q4;
|
|
|
|
output Q5;
|
|
|
|
output Q6;
|
|
|
|
output Q7;
|
2015-04-16 22:30:09 -04:00
|
|
|
output Q8; // first bit of D appears here
|
|
|
|
output SHIFTOUT1; // master of multi serdes
|
|
|
|
output SHIFTOUT2; // master of multi serdes
|
|
|
|
|
|
|
|
|
|
|
|
reg [3:0] even_samples;
|
|
|
|
reg [3:0] odd_samples;
|
2015-05-13 23:33:26 -04:00
|
|
|
reg Q1;
|
|
|
|
reg Q2;
|
|
|
|
reg Q3;
|
|
|
|
reg Q4;
|
|
|
|
reg Q5;
|
|
|
|
reg Q6;
|
|
|
|
reg Q7;
|
|
|
|
reg Q8;
|
2015-04-16 22:30:09 -04:00
|
|
|
always @ (posedge CLK)
|
2015-05-13 23:33:26 -04:00
|
|
|
odd_samples[3:0] <= {odd_samples[2:0],D};//#0.1
|
2015-04-16 22:30:09 -04:00
|
|
|
|
|
|
|
always @ (negedge CLK)
|
2015-05-13 23:33:26 -04:00
|
|
|
even_samples[3:0] <= {even_samples[2:0],D};//#0.1
|
2015-04-16 22:30:09 -04:00
|
|
|
|
2015-05-13 23:33:26 -04:00
|
|
|
always @ (posedge CLKDIV)
|
|
|
|
begin
|
|
|
|
Q1 <= odd_samples[0];
|
|
|
|
Q2 <= even_samples[0];
|
|
|
|
Q3 <= odd_samples[1];
|
|
|
|
Q4 <= even_samples[1];
|
|
|
|
Q5 <= odd_samples[2];
|
|
|
|
Q6 <= even_samples[2];
|
|
|
|
Q7 <= odd_samples[3];
|
|
|
|
Q8 <= even_samples[3];
|
|
|
|
end
|
2015-04-16 22:30:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
//pass through
|
|
|
|
assign O=D;
|
|
|
|
|
|
|
|
//not implemented
|
2015-04-08 23:40:16 -04:00
|
|
|
assign SHIFTOUT1=1'b0;
|
|
|
|
assign SHIFTOUT2=1'b0;
|
2014-12-14 22:21:01 -05:00
|
|
|
|
|
|
|
endmodule // ISERDESE2
|
|
|
|
|
2015-04-16 22:30:09 -04:00
|
|
|
|