Success! Subscription added.
Success! Subscription removed.
Sorry, you must verify to complete this action. Please click the verification link in your email. You may re-send via your profile.
This article descries how to simulate rate matching of the Rate Match FIFO in the Arria V standard PCS by hacking the simulation model.
This trick is useful to understand how the Rate Match FIFO work. But you need to understand the trick breaks the clock topology of the PHY IP, and this trick should not be used for other purposes.
On real devices, the write side of the rate match FIFO is clocked by the RX parallel recovered clock, and the read side of the rate match FIFO is clocked by the TX parallel clock. But in the simulation model, both write and read clocks are synchronous to the TX parallel clock due to the limitation of the CDR modeling. To generate clock compensation condition in the simulation model, the frequency of the FIFO read clock is needed to be higher / lower than the TX parallel clock frequency. You can find the FIFO read clock named 'txpmaclk' in '[instance name]_sim/altera_xcvr_native_av/av_hssi_8g_rx_pcs_rbc.sv', and the txpmaclk is fed to arriav_hssi_8g_rx_pcs module. To change the FIFO read clock frequency, add new clock txpmaclk_ppm, and feed the new clock to arriav_hssi_8g_rx_pcs module instead of txpmaclk. Now, you have the control of the FIFO read clock.
Here is an example of txpmaclk_ppm clock generation circuit. In this example, the period of the new FIFO read clock txpmaclk_ppm is set to 8.002 ns because the original clock period was 8.000 ns, and the clock frequency difference is - 250 ppm. Since the FIFO read clock is slower than the FIFO write clock, the rate match FIFO initiates SKIP code deletion. If you set the period of the txpmaclk_ppm to 7.998 ns, the FIFO initiates SKIP code insertion. Please note that the period of the txpmaclk depends on the PHY IP settings. You need to run simulation to know the txpmaclk period of your Native PHY IP.
// Rate Match FIFO Testing ------------------------------------------------------------------------
reg txpmaclk_ppm = 1'h0;
// - 250 ppm for deletion testing
always begin
#4.001 txpmaclk_ppm <= ~txpmaclk_ppm; // timescale 1 ns, This period must be almost same as txpmaclk
end
// + 250 ppm for insertion testing
// always begin
// #3.999 txpmaclk_ppm <= ~txpmaclk_ppm; // timescale 1 ns, This period must be almost same as txpmaclk
// end
// ------------------------------------------------------------------------- Rate Match FIFO Testing
If you need higher resolution than the simulation tool can handle (i.e. < 1 ps), you can generate discrete frequencies by creating a gated clock like below.
// Rate Match FIFO Testing ------------------------------------------------------------------------
reg txpmaclk_ppm = 1'h0;
reg clk = 1'h0;
reg [15:0] clk_cnt = 16'h0;
always begin
#2 clk <= ~clk; // timescale 1ns, This period must be a half of txpmaclk
end
always @(posedge clk or negedge clk) begin
if (clk_cnt == 16'd39999)
clk_cnt <= 16'h0;
else
clk_cnt <= clk_cnt + 1'h1;
end
// +100 ppm for insertion testing
always @(posedge clk or negedge clk) begin
if (clk_cnt == 16'd39999)
txpmaclk_ppm <= ~txpmaclk_ppm;
else if (clk_cnt == 16'd39997)
txpmaclk_ppm <= ~txpmaclk_ppm;
else if (clk_cnt[0] == 1'h0)
txpmaclk_ppm <= ~txpmaclk_ppm;
else
txpmaclk_ppm <= txpmaclk_ppm;
end
/*
// -100 ppm for deletion testing
always @(posedge clk or negedge clk) begin
if (clk_cnt >= 16'd39996)
txpmaclk_ppm <= txpmaclk_ppm;
else if (clk_cnt[0] == 1'h0)
txpmaclk_ppm <= ~txpmaclk_ppm;
else
txpmaclk_ppm <= txpmaclk_ppm;
end
*/
// ------------------------------------------------------------------------- Rate Match FIFO Testing
ArriaV NativePHY RMFIFO GIGEmode.zip
To run the testbench with ModelSim, follow instructions.
Altera Transceiver PHY IP Core User Guide (PDF)
Arria V Device Handbook, Volume 2: Transceivers (PDF)
Rate Matching, Rate Match FIFO, Insertion, Deletion, Clock Compensation, Arria V Native PHY IP
Community support is provided Monday to Friday. Other contact methods are available here.
Intel does not verify all solutions, including but not limited to any file transfers that may appear in this community. Accordingly, Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.
For more complete information about compiler optimizations, see our Optimization Notice.