当前位置:   article > 正文

Ultrascale selectio 仿真之 ISERDESE3和OSERDESE3

iserdese3

1 ISERDESE3

        ISERDESE3端口如下:

Port

I/O

Type

Description

CLK

Input

Clock

High-speed clock input. Clock Serial input data stream.

CLK_B

Input

Clock

Inverted version of CLK when IS_CLK_INVERTED = 0 and IS_CLK_B_INVERTED = 0.

CLKDIV

Input

Clock

Low-speed divided clock input.

D

Input

Data

Serial input data Synchronous to CLK/CLK_B

Q[7:0]

Output

Data

Registered outputs. Synchronous to FIFO_RD_CLK when FIFO_ENABLE is TRUE.

RST

Input

Reset

Asynchronous reset. Deassert synchronously.

FIFO_RD_CLK

Input

Clock

FIFO read clock.

FIFO_RD_EN

Input

Enable

Enables reading the FIFO when asserted.

FIFO_EMPTY

Output

Indicates the FIFO is empty when asserted.

INTERNAL_DIVCLK

Output

Clock

Reserved

注:ISERDESE3包含了一个数据位宽为8的FIFO,这个FIFO可以用于时钟域的转换。如果不使用FIFO,FIFO的控制信号接地。

        The ISERDESE3 also contains a shallow eight entry FIFO that can optionally be used for clock domain transfers. When not used, the FIFO control signals should be connected to GND. When using the FIFO, the FIFO_RD_EN should be driven by the inverted FIFO_EMPTY signal to ensure the FIFO_write and read pointers do not overlap every eight clock cycles.

        ISERDESE3属性如下:

Attribute

Values

Dfault

Type

Description

DATA_WIDTH

4 or 8

8

Decimal

Defines the serial-to-parrallel converter width

FIFO_ENABLE

TRUE/FALSE

FALSE

String

The FIFO is used when the attribute is set TRUE and bypassed when the attribute is set FALSE

FIFO_SYNC_MODE

TRUE/FALSE

FALSE

String

Set to FALSE when the ISERDES internal FIFO write clock and the FIFO read clock accessed from FPGA logic are from separate or common clock domains.

IS_CLK_INVERTED

1 or 0

0

Bit

Sets a local clock inversion for CLK input

IS_CLK_B_INVERTED

1 or 0

0

Bit

Sets a local clock inversion for CLK_B input . When IS_CLK_B_INVERTED=1,CLK and CLK_B must be driven by the same global clock buffer. When IS_CLK_B_INVERTED=0, CLK_B must be driven by the same global clock buffer as CLK through an inverter.

IS_RST_INVERTED

1 or 0

0

Bit

Sets a local inversion for RST input when 1.

SIM_DEVICE

ULTRASCALE

ULTRASCALE_PLUS

ULTRASCALE_PLUS_ES1

ULTRASCALE_PLUS_ES1

ULTRASCALE

String

Device family for behavioral simulation.

        ISERDESE3在SDR和DDR模式下的输出连接:

SDR or DDR

Required Ratio

DATA_WIDTH Attribute to Apply to ISERDESE3

SerDes Output Data Bits to Use

DDR

1:8

8

Q7,Q6,Q5,Q4,Q3,Q2,Q1,Q0

DDR

1:4

4

Q3,Q2,Q1,Q0

SDR

1:8

N/A

N/A

SDR

1:4

8

Q6,Q4,Q2,Q0

SDR

1:2

4

Q2,Q0

注:

        手册中关于DATA_RATE是DDR还是SDR专门进行了相关说明,使用selectio相关原语时,默认就是DDR模式。也可以在XDC文件中做如下约束

                set_property DATA_RATE_SDR|DDR [get_ports port_name]

         

        一个字节中最先接收到的Bit是Q0

        ISERDES 时序:

        DATA_WIDTH设置为8,DDR模式

        DATA_WIDTH设置为4,DDR模式

2 OSERDESE3

        OSERDES延时:下图中DATA_WIDTH=8,延时3个CLK;DATA_WIDTH=4,延时1个CLK。

        OSERDESE3在SDR和DDR模式下的输出连接:

SDR or DDR

Required Ratio

DATA_WIDTH Attribute to Apply to OSERDESE3

Data Bits to Connect to the SerDes

DDR

8:1

8

D7,D6,D5,D4,D3,D2,D1,D0

DDR

4:1

4

0,0,0,0,D3,D2,D1,D0

SDR

8:1

N/A

N/A

SDR

4:1

8

D3,D3,D2,D2,D1,D1,D0,D0

SDR

2:1

4

0,0,0,0,D1,D1,D0,D0

注:

        给SerDes输入的D0在所有情况下都是最先传输的Bit,可参考下面的时序图理解

        SDR模式下,4:1的比例的Block图和时序图:

        OSERDESE3端口如下:

Port

I/O

Description

CLK

Input

High-speed clock input

CLKDIV

Input

Low-speed divided clock input

D[7:0]

Input

Parallel data inputs for serialization synchronous to CLKDIV

OQ

Output

datapath output

RST

Input

Asynchronous reset. Deassert synchronously.

T_OUT

Output

3-state control output to IOB

T

Input

3-state input from internal logic, combinational 3-state T to T_OUT path. A logic High means the data is 3-stated and a logic LOW means the data is not 3-stated.

        OSERDESE3属性如下:

Attribute

Values

Default

Type

Description

DATA_WIDTH

4 or 8

8

Decimal

Defines the parallel-to-serial data converter width

INIT

1 or 0

0

Binary

Initializes the OSERDESE3 flip-flops to the value specified.

ODDR_MODE

TRUE/FALSE

FALSE

String

OSERDES_D_BYPASS

TRUE/FALSE

FALSE

String

When TRUE,D[0] is passed onto OQ. When FALSE, serialized D[0] and D[5] is output on T_OUT.

OSERDES_T_BYPASS

TRUE/FALSE

FALSE

String

When TRUE, D[1] is passed onto T_OUT. When FALSE, serialized D[1] and D[5] is output on T_OUT.

IS_CLK_INVERTED

1 or 0

0

Bit

Sets a local clock inversion for CLK input when 1.

IS_CLKDIV_INVERTED

1 or 0

0

Bit

Sets a local clock inversion for CLKDIV input when 1.

IS_RST_INVERTED

1 or 0

0

Bit

Sets a local inversion for RST input when 1.

SIM_DEVICE

ULTRASCALE,

ULTRASCALE_PLUS,

ULTRASCALE_PLUS_ES1,

ULTRASCALE_PLUS_ES2

ULTRASCALE

String

Device family for behavioral simulation

3 ISERDESE3/OSERDESE3/IDELAYE3/ODELAYE3/IDELAYCTRL联合仿真

        框图如下:

        DATA_WIDTH设置为8,DDR模式:     

        verilog代码:

  1. `timescale 1ns / 1ps
  2. module ioserdes(
  3. input i_clk , //100MHz
  4. input i_rst ,
  5. input i_data_p ,
  6. input i_data_n ,
  7. input i_clk_200 ,
  8. input [8:0] i_cnt_value ,
  9. input i_en_vtc ,
  10. input i_ce ,
  11. input i_inc ,
  12. input i_load ,
  13. output [8:0] o_cnt_value ,
  14. output o_idelay_rdy
  15. );
  16. wire w_data_in ;
  17. wire w_clk_25 ;
  18. wire w_clk_100 ;
  19. // wire w_t_out ;
  20. wire w_iobuf_o ;
  21. wire w_iobuf_i ;
  22. wire w_idelay_o ;
  23. wire w_odelay_i ;
  24. wire [7:0] w_iserdes_o ;
  25. // wire w_i_o_data ;
  26. // assign w_i_o_data = w_t_out ? 1'dz : w_data_in;
  27. assign w_iobuf_o = w_data_in;
  28. BUFG BUFG_inst (
  29. .O (w_clk_100 ), // 1-bit output: Clock output
  30. .I (i_clk ) // 1-bit input: Clock input
  31. );
  32. BUFGCE_DIV #(
  33. .BUFGCE_DIVIDE (4 ), // 1-8
  34. // Programmable Inversion Attributes: Specifies built-in programmable inversion on specific pins
  35. .IS_CE_INVERTED (1'b0 ), // Optional inversion for CE
  36. .IS_CLR_INVERTED (1'b0 ), // Optional inversion for CLR
  37. .IS_I_INVERTED (1'b0 ) // Optional inversion for I
  38. )
  39. BUFGCE_DIV_inst (
  40. .O (w_clk_25 ), // 1-bit output: Buffer
  41. .CE (1'b1 ), // 1-bit input: Buffer enable
  42. .CLR (1'b0 ), // 1-bit input: Asynchronous clear
  43. .I (i_clk ) // 1-bit input: Buffer
  44. );
  45. IBUFDS IBUFDS_inst (
  46. .O (w_data_in ), // 1-bit output: Buffer output
  47. .I (i_data_p ), // 1-bit input: Diff_p buffer input (connect directly to top-level port)
  48. .IB (i_data_n ) // 1-bit input: Diff_n buffer input (connect directly to top-level port)
  49. );
  50. IDELAYCTRL #(
  51. .SIM_DEVICE ("ULTRASCALE" ) // Must be set to "ULTRASCALE"
  52. )
  53. IDELAYCTRL_inst (
  54. .RDY (o_idelay_rdy ), // 1-bit output: Ready output
  55. .REFCLK (i_clk_200 ), // 1-bit input: Reference clock input
  56. .RST (i_rst ) // 1-bit input: Active high reset input. Asynchronous assert, synchronous deassert to
  57. // REFCLK.
  58. );
  59. IDELAYE3 #(
  60. .CASCADE ("NONE" ), // Cascade setting (MASTER, NONE, SLAVE_END, SLAVE_MIDDLE)
  61. .DELAY_FORMAT ("TIME" ), // Units of the DELAY_VALUE (COUNT, TIME)
  62. .DELAY_SRC ("IDATAIN" ), // Delay input (DATAIN, IDATAIN)
  63. // .DELAY_TYPE ("FIXED" ), // Set the type of tap delay line (FIXED, VARIABLE, VAR_LOAD)
  64. // .DELAY_TYPE ("VARIABLE" ), // Set the type of tap delay line (FIXED, VARIABLE, VAR_LOAD)
  65. .DELAY_TYPE ("VAR_LOAD" ), // Set the type of tap delay line (FIXED, VARIABLE, VAR_LOAD)
  66. .DELAY_VALUE (0 ), // Input delay value setting
  67. .IS_CLK_INVERTED (1'b0 ), // Optional inversion for CLK
  68. .IS_RST_INVERTED (1'b0 ), // Optional inversion for RST
  69. .REFCLK_FREQUENCY (200.0 ), // IDELAYCTRL clock input frequency in MHz (200.0-2667.0)
  70. .SIM_DEVICE ("ULTRASCALE_PLUS" ), // Set the device version (ULTRASCALE, ULTRASCALE_PLUS,
  71. // ULTRASCALE_PLUS_ES1, ULTRASCALE_PLUS_ES2)
  72. .UPDATE_MODE ("ASYNC" ) // Determines when updates to the delay will take effect (ASYNC, MANUAL,
  73. // SYNC)
  74. )
  75. IDELAYE3_inst (
  76. .CASC_OUT ( ), // 1-bit output: Cascade delay output to ODELAY input cascade
  77. .CNTVALUEOUT (o_cnt_value ), // 9-bit output: Counter value output
  78. .DATAOUT (w_idelay_o ), // 1-bit output: Delayed data output
  79. .CASC_IN (1'b0 ), // 1-bit input: Cascade delay input from slave ODELAY CASCADE_OUT
  80. .CASC_RETURN (1'b0 ), // 1-bit input: Cascade delay returning from slave ODELAY DATAOUT
  81. .CE (i_ce ), // 1-bit input: Active high enable increment/decrement input
  82. .CLK (w_clk_25 ), // 1-bit input: Clock input
  83. .CNTVALUEIN (i_cnt_value ), // 9-bit input: Counter value input
  84. .DATAIN (1'b0 ), // 1-bit input: Data input from the logic
  85. .EN_VTC (i_en_vtc ), // 1-bit input: Keep delay constant over VT
  86. // .IDATAIN (w_data_in ), // 1-bit input: Data input from the IOBUF
  87. .IDATAIN (w_iobuf_o ), // 1-bit input: Data input from the IOBUF
  88. .INC (i_inc ), // 1-bit input: Increment / Decrement tap delay input
  89. .LOAD (i_load ), // 1-bit input: Load DELAY_VALUE input
  90. .RST (i_rst ) // 1-bit input: Asynchronous Reset to the DELAY_VALUE
  91. );
  92. //data 8bit fre 4:1 SDR q6 q4 q2 q0
  93. ISERDESE3 #(
  94. .DATA_WIDTH (8 ), // Parallel data width (4,8)
  95. .FIFO_ENABLE ("FALSE" ), // Enables the use of the FIFO
  96. .FIFO_SYNC_MODE ("FALSE" ), // Enables the use of internal 2-stage synchronizers on the FIFO
  97. .IS_CLK_B_INVERTED (1'b0 ), // Optional inversion for CLK_B
  98. .IS_CLK_INVERTED (1'b0 ), // Optional inversion for CLK
  99. .IS_RST_INVERTED (1'b0 ), // Optional inversion for RST
  100. .SIM_DEVICE ("ULTRASCALE_PLUS" ) // Set the device version (ULTRASCALE, ULTRASCALE_PLUS,
  101. // ULTRASCALE_PLUS_ES1, ULTRASCALE_PLUS_ES2)
  102. )
  103. ISERDESE3_inst (
  104. .FIFO_EMPTY ( ), // 1-bit output: FIFO empty flag
  105. .INTERNAL_DIVCLK ( ), // 1-bit output: Internally divided down clock used when FIFO is
  106. // disabled (do not connect)
  107. .Q (w_iserdes_o ), // 8-bit registered output
  108. .CLK (w_clk_100 ), // 1-bit input: High-speed clock
  109. .CLKDIV (w_clk_25 ), // 1-bit input: Divided Clock
  110. .CLK_B (~w_clk_100 ), // 1-bit input: Inversion of High-speed clock CLK
  111. .D (w_idelay_o ), // 1-bit input: Serial Data Input
  112. .FIFO_RD_CLK ( ), // 1-bit input: FIFO read clock
  113. .FIFO_RD_EN ( ), // 1-bit input: Enables reading the FIFO when asserted
  114. .RST (i_rst ) // 1-bit input: Asynchronous Reset
  115. );
  116. ODELAYE3 #(
  117. .CASCADE ("NONE" ), // Cascade setting (MASTER, NONE, SLAVE_END, SLAVE_MIDDLE)
  118. .DELAY_FORMAT ("TIME" ), // (COUNT, TIME)
  119. // .DELAY_TYPE ("FIXED" ), // Set the type of tap delay line (FIXED, VARIABLE, VAR_LOAD)
  120. // .DELAY_TYPE ("VARIABLE" ), // Set the type of tap delay line (FIXED, VARIABLE, VAR_LOAD)
  121. .DELAY_TYPE ("VAR_LOAD" ), // Set the type of tap delay line (FIXED, VARIABLE, VAR_LOAD)
  122. // .DELAY_VALUE (1000 ), // Output delay tap setting
  123. .DELAY_VALUE (0 ), // Output delay tap setting
  124. .IS_CLK_INVERTED (1'b0 ), // Optional inversion for CLK
  125. .IS_RST_INVERTED (1'b0 ), // Optional inversion for RST
  126. .REFCLK_FREQUENCY (200.0 ), // IDELAYCTRL clock input frequency in MHz (200.0-2667.0).
  127. // .REFCLK_FREQUENCY (500.0 ), // IDELAYCTRL clock input frequency in MHz (200.0-2667.0).
  128. .SIM_DEVICE ("ULTRASCALE_PLUS" ), // Set the device version (ULTRASCALE, ULTRASCALE_PLUS,
  129. // ULTRASCALE_PLUS_ES1, ULTRASCALE_PLUS_ES2)
  130. .UPDATE_MODE ("ASYNC" ) // Determines when updates to the delay will take effect (ASYNC, MANUAL,
  131. // SYNC)
  132. )
  133. ODELAYE3_inst (
  134. .CASC_OUT ( ), // 1-bit output: Cascade delay output to IDELAY input cascade
  135. .CNTVALUEOUT (o_cnt_value ), // 9-bit output: Counter value output
  136. .DATAOUT (w_iobuf_i ), // 1-bit output: Delayed data from ODATAIN input port
  137. .CASC_IN (1'b0 ), // 1-bit input: Cascade delay input from slave IDELAY CASCADE_OUT
  138. .CASC_RETURN (1'b0 ), // 1-bit input: Cascade delay returning from slave IDELAY DATAOUT
  139. .CE (i_ce ), // 1-bit input: Active high enable increment/decrement input
  140. .CLK (w_clk_25 ), // 1-bit input: Clock input
  141. .CNTVALUEIN (i_cnt_value ), // 9-bit input: Counter value input
  142. .EN_VTC (i_en_vtc ), // 1-bit input: Keep delay constant over VT
  143. .INC (i_inc ), // 1-bit input: Increment/Decrement tap delay input
  144. .LOAD (i_load ), // 1-bit input: Load DELAY_VALUE input
  145. .ODATAIN (w_odelay_i ), // 1-bit input: Data input
  146. .RST (i_rst ) // 1-bit input: Asynchronous Reset to the DELAY_VALUE
  147. );
  148. //data 8bit fre 4:1 SDR q6 q4 q2 q0
  149. OSERDESE3 #(
  150. .DATA_WIDTH (8 ), // Parallel Data Width (4-8)
  151. .INIT (1'b0 ), // Initialization value of the OSERDES flip-flops
  152. .IS_CLKDIV_INVERTED (1'b0 ), // Optional inversion for CLKDIV
  153. .IS_CLK_INVERTED (1'b0 ), // Optional inversion for CLK
  154. .IS_RST_INVERTED (1'b0 ), // Optional inversion for RST
  155. .SIM_DEVICE ("ULTRASCALE_PLUS" ) // Set the device version (ULTRASCALE, ULTRASCALE_PLUS,
  156. // ULTRASCALE_PLUS_ES1, ULTRASCALE_PLUS_ES2)
  157. )
  158. OSERDESE3_inst (
  159. .OQ (w_odelay_i ), // 1-bit output: Serial Output Data
  160. // .T_OUT (w_t_out ), // 1-bit output: 3-state control output to IOB
  161. .T_OUT ( ), // 1-bit output: 3-state control output to IOB
  162. .CLK (w_clk_100 ), // 1-bit input: High-speed clock
  163. .CLKDIV (w_clk_25 ), // 1-bit input: Divided Clock
  164. .D (w_iserdes_o ), // 8-bit input: Parallel Data Input
  165. .RST (i_rst ), // 1-bit input: Asynchronous Reset
  166. .T ( ) // 1-bit input: Tristate input from fabric
  167. );
  168. // IOBUF IOBUF_inst (
  169. // .O (w_iobuf_o ), // 1-bit output: Buffer output
  170. // .I (w_iobuf_i ), // 1-bit input: Buffer input
  171. // .IO (w_i_o_data ), // 1-bit inout: Buffer inout (connect directly to top-level port)
  172. // .T (w_t_out ) // 1-bit input: 3-state enable input
  173. // );
  174. endmodule

       仿真结果说明: 

        数据流,w_data_in为差分转单端后的输入串行数据,assign给w_iobuf_o,经过IDELAYE3延时后得到w_idelay_o;输入给ISERDESE3,得到并行数据w_iserdes_o(8bit);输入给OSERDESE3,得到串行数据w_odelay_i,经过ODELAYE3延时后得到w_iobuf_i。

        ISERDESE3输出的并行数据[7:0]w_iserdes_o,对应[7:0]Q   。

        数据率说明:100MHz * 2(DDR模式,双边沿采样) = 200M的数据率

       下图中蓝色的MARKER,依次编号1/2/3/4/5/6/7/8,1~2之间给到ISERDESE3的原始数据(串行输入之前的并行数据8’haa),3~4之间给到ISERDESE3的原始数据(串行输入之前的并行数据8’h11),5~6之间给到ISERDESE3的原始数据(串行输入之前的并行数据8’h33),7~8之间给到ISERDESE3的原始数据(串行输入之前的并行数据8’h55)。

        根据iserdes的8位宽DDR时序图,在CLK和CLKDIV上升沿之后,第一个CLK下降沿开始采样。

        测试工程中需要理清楚IDELAYCTRL的参考时钟(REFCLK,由IDELAYE3/ODELAYE3的属性REFCLK_FREQUENCY决定,测试工程中给200MHz)、IDELAYE3的输入时钟(CLK,与ISERDESE3的CLKDIV相同)、ISERDESE3的串行数据采样时钟(CLK)并行数据输出时钟(CLKDIV)、ODELAYE3的输入时钟(CLK,与OSERDESE3的CLKDIV相同)、OSERDESE3的并行数据采样时钟(CLKDIV)串行数据输出时钟(CLK)

        测试工程中输出采样为DDR模式。

     由于输入是小端模式输出是大端模式,因此8'haa(8'b1010_1010)给到iserdes,iserdes从低位开始取,即8'b0101_0101,输出按照大端,得到8'b1010_1010,即8'haa。后面依次输出8'h11,8'h33,8'h55

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/614493
推荐阅读
  

闽ICP备14008679号