// ---------------------------------------------------------------------- // "THE BEER-WARE LICENSE" (Revision 42): // wrote this file. As long as you retain this // notice you can do whatever you want with this stuff. If we meet // some day, and you think this stuff is worth it, you can buy me a // beer in return Yasunori Osana at University of the Ryukyus, // Japan. // ---------------------------------------------------------------------- // OpenFC project: an open FPGA accelerated cluster toolkit // Kyokko project: an open Multi-vendor Aurora 64B/66B-compatible link // // Modules in this file: // tb_au200: Testbench for Xilinx Alveo U200 simulation // ---------------------------------------------------------------------- `timescale 1ns/1ps `default_nettype none module tb_au200 # ( parameter BondingEnable=0, // Set to 1 to enable BondingCh=4, NumCh = 8 ) ( `ifdef NO_LOOPBACK output wire [3:0] QSFP0_TXP, QSFP0_TXN, QSFP1_TXP, QSFP1_TXN, input wire [3:0] QSFP0_RXP, QSFP0_RXN, QSFP1_RXP, QSFP1_RXN `endif ); parameter real Step300 = 1000.0/300.0; parameter real StepREF = 1000.0/156.25; parameter NumChB = ((BondingEnable==0) ? NumCh : NumCh/BondingCh); reg CLK300 = 1; reg CLKREF = 1; always # (Step300/2) CLK300 <= ~CLK300; always # (StepREF/2) CLKREF <= ~CLKREF; `ifndef NO_LOOPBACK wire [3:0] QSFP0_TXP, QSFP0_TXN, QSFP1_TXP, QSFP1_TXN; wire [3:0] QSFP0_RXP, QSFP0_RXN, QSFP1_RXP, QSFP1_RXN; assign {QSFP1_RXP, QSFP0_RXP} = {QSFP1_TXP, QSFP0_TXP}; assign {QSFP1_RXN, QSFP0_RXN} = {QSFP1_TXN, QSFP0_TXN}; `endif reg RST; au200 #(.BondingEnable(BondingEnable), .BondingCh(BondingCh)) uut ( .PCIE_RESET_N(~RST), .CLK300P(CLK300), .CLK300N(~CLK300), .CLK156P(CLKREF), .CLK156N(~CLKREF), .QSFP0_RXP(QSFP0_RXP), .QSFP0_RXN(QSFP0_RXN), .QSFP0_TXP(QSFP0_TXP), .QSFP0_TXN(QSFP0_TXN), .QSFP1_RXP(QSFP1_RXP), .QSFP1_RXN(QSFP1_RXN), .QSFP1_TXP(QSFP1_TXP), .QSFP1_TXN(QSFP1_TXN) ); `ifndef NO_LOOPBACK initial begin `include "wave-record.vh" #(300*1000) $finish; end `endif // `ifndef NO_LOOPBACK initial begin RST <= 1; #(100.1) RST <= 0; end genvar ch; for (ch=0; ch