data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma/ten_gige_phy.v
1: b'%Error: data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma/ten_gige_phy.v:76: Cannot find file containing module: \'xge_pcs_pma\'\n  xge_pcs_pma xge_pcs_pma_i (\n  ^~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma,data/full_repos/permissive/447976230/xge_pcs_pma\n             data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma,data/full_repos/permissive/447976230/xge_pcs_pma.v\n             data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma,data/full_repos/permissive/447976230/xge_pcs_pma.sv\n             xge_pcs_pma\n             xge_pcs_pma.v\n             xge_pcs_pma.sv\n             obj_dir/xge_pcs_pma\n             obj_dir/xge_pcs_pma.v\n             obj_dir/xge_pcs_pma.sv\n%Error: data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma/ten_gige_phy.v:189: Cannot find file containing module: \'synchronizer\'\n  synchronizer sync_reset_tx_done (\n  ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma/ten_gige_phy.v:196: Cannot find file containing module: \'synchronizer\'\n  synchronizer sync_reset_rx_done (\n  ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma/ten_gige_phy.v:215: Cannot find file containing module: \'synchronizer\'\n  synchronizer sync_rx_serdes_reset (\n  ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma/ten_gige_phy.v:222: Cannot find file containing module: \'synchronizer\'\n  synchronizer sync_tx_reset (\n  ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma/ten_gige_phy.v:229: Cannot find file containing module: \'synchronizer\'\n  synchronizer sync_rx_reset (\n  ^~~~~~~~~~~~\n%Warning-WIDTH: data/full_repos/permissive/447976230/fpga/usrp3/top/x400/ip/xge_pcs_pma/ten_gige_phy.v:253: Operator EQ expects 32 or 27 bits on the LHS, but LHS\'s VARREF \'rst_count\' generates 26 bits.\n                                                                                                          : ... In instance ten_gige_phy\n            if (rst_count == RX_RST_WAIT-1) begin\n                          ^~\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error: Exiting due to 6 error(s), 1 warning(s)\n'
module ten_gige_phy (
  input wire areset,
  input wire dclk,
  output wire xgmii_clk,


  output wire txp,
  output wire txn,
  input  wire rxp,
  input  wire rxn,


  input  wire [63:0] xgmii_txd,
  input  wire [ 7:0] xgmii_txc,
  output wire [63:0] xgmii_rxd,
  output wire [ 7:0] xgmii_rxc,


  input  wire qpll0_refclk,
  input  wire qpll0_clk,
  input  wire qpll0_lock,
  output wire qpll0_reset,
  input  wire qpll1_refclk,
  input  wire qpll1_clk,
  input  wire qpll1_lock,
  output wire qpll1_reset,

  output wire rxrecclkout,
  output wire [7:0] core_status,
  output reg        reset_done
);

  localparam XGMII_FREQ      = 125_000_000;
  localparam RX_RST_WAIT     = XGMII_FREQ/2;
  localparam RX_RST_DURATION = 100;
  localparam RX_RST_COUNT_W  = $clog2(RX_RST_WAIT);

  wire rx_serdes_reset;
  wire tx_reset;
  wire rx_reset;

  wire a_gt_reset_tx_done, gt_reset_tx_done;
  wire a_gt_reset_rx_done, gt_reset_rx_done;

  wire stat_rx_status_tmp;
  reg  stat_rx_status;

  reg [RX_RST_COUNT_W-1:0] rst_count;
  reg                      gt_rx_reset_in;











  assign qpll1_reset = 1'b0;

  xge_pcs_pma xge_pcs_pma_i (
    .gt_rxp_in_0                         (rxp),
    .gt_rxn_in_0                         (rxn),
    .gt_txp_out_0                        (txp),
    .gt_txn_out_0                        (txn),
    .rx_core_clk_0                       (xgmii_clk),
    .rx_serdes_reset_0                   (rx_serdes_reset),
    .txoutclksel_in_0                    (3'b101),
    .rxoutclksel_in_0                    (3'b101),
    .gt_dmonitorout_0                    (),
    .gt_eyescandataerror_0               (),
    .gt_eyescanreset_0                   (1'b0),
    .gt_eyescantrigger_0                 (1'b0),
    .gt_pcsrsvdin_0                      (16'b0),
    .gt_rxbufreset_0                     (1'b0),
    .gt_rxbufstatus_0                    (),
    .gt_rxcdrhold_0                      (1'b0),
    .gt_rxcommadeten_0                   (1'b0),
    .gt_rxdfeagchold_0                   (1'b0),
    .gt_rxdfelpmreset_0                  (1'b0),
    .gt_rxlatclk_0                       (1'b0),
    .gt_rxlpmen_0                        (1'b0),
    .gt_rxpcsreset_0                     (1'b0),
    .gt_rxpmareset_0                     (1'b0),
    .gt_rxpolarity_0                     (1'b0),
    .gt_rxprbscntreset_0                 (1'b0),
    .gt_rxprbserr_0                      (),
    .gt_rxprbssel_0                      (4'b0),
    .gt_rxrate_0                         (3'b0),
    .gt_rxslide_in_0                     (1'b0),
    .gt_rxstartofseq_0                   (),
    .gt_txbufstatus_0                    (),
    .gt_txdiffctrl_0                     (5'h18),
    .gt_txinhibit_0                      (1'b0),
    .gt_txlatclk_0                       (1'b0),
    .gt_txmaincursor_0                   (7'h50),
    .gt_txpcsreset_0                     (1'b0),
    .gt_txpmareset_0                     (1'b0),
    .gt_txpolarity_0                     (1'b0),
    .gt_txpostcursor_0                   (5'b0),
    .gt_txprbsforceerr_0                 (1'b0),
    .gt_txprbssel_0                      (4'b0),
    .gt_txprecursor_0                    (5'b0),
    .rxrecclkout_0                       (rxrecclkout),
    .gt_drpclk_0                         (dclk),
    .gt_drpdo_0                          (),
    .gt_drprdy_0                         (),
    .gt_drpen_0                          (1'b0),
    .gt_drpwe_0                          (1'b0),
    .gt_drpaddr_0                        (10'b0),
    .gt_drpdi_0                          (16'b0),
    .sys_reset                           (areset),
    .dclk                                (dclk),
    .tx_mii_clk_0                        (xgmii_clk),
    .rx_clk_out_0                        (),
    .gtpowergood_out_0                   (),
    .qpll0clk_in                         (qpll0_clk),
    .qpll0refclk_in                      (qpll0_refclk),
    .qpll1clk_in                         (qpll1_clk),
    .qpll1refclk_in                      (qpll1_refclk),
    .gtwiz_reset_qpll0lock_in            (qpll0_lock),
    .gtwiz_reset_qpll1lock_in            (qpll1_lock),
    .gtwiz_reset_qpll0reset_out          (qpll0_reset),
    .gtwiz_reset_qpll1reset_out          (),
    .gt_reset_tx_done_out_0              (a_gt_reset_tx_done),
    .gt_reset_rx_done_out_0              (a_gt_reset_rx_done),
    .gt_reset_all_in_0                   (areset),
    .gt_tx_reset_in_0                    (1'b0),
    .gt_rx_reset_in_0                    (gt_rx_reset_in),
    .rx_reset_0                          (rx_reset),
    .rx_mii_d_0                          (xgmii_rxd),
    .rx_mii_c_0                          (xgmii_rxc),
    .ctl_rx_test_pattern_0               (1'b0),
    .ctl_rx_test_pattern_enable_0        (1'b0),
    .ctl_rx_data_pattern_select_0        (1'b0),
    .ctl_rx_prbs31_test_pattern_enable_0 (1'b0),
    .stat_rx_framing_err_0               (),
    .stat_rx_framing_err_valid_0         (),
    .stat_rx_local_fault_0               (),
    .stat_rx_block_lock_0                (),
    .stat_rx_valid_ctrl_code_0           (),
    .stat_rx_status_0                    (stat_rx_status_tmp),
    .stat_rx_hi_ber_0                    (),
    .stat_rx_bad_code_0                  (),
    .stat_rx_bad_code_valid_0            (),
    .stat_rx_error_0                     (),
    .stat_rx_error_valid_0               (),
    .stat_rx_fifo_error_0                (),
    .tx_reset_0                          (tx_reset),
    .tx_mii_d_0                          (xgmii_txd),
    .tx_mii_c_0                          (xgmii_txc),
    .stat_tx_local_fault_0               (),
    .ctl_tx_test_pattern_0               (1'b0),
    .ctl_tx_test_pattern_enable_0        (1'b0),
    .ctl_tx_test_pattern_select_0        (1'b0),
    .ctl_tx_data_pattern_select_0        (1'b0),
    .ctl_tx_test_pattern_seed_a_0        (58'b0),
    .ctl_tx_test_pattern_seed_b_0        (58'b0),
    .ctl_tx_prbs31_test_pattern_enable_0 (1'b0),
    .gt_loopback_in_0                    (3'b0)
  );






  assign core_status[7:1] = 0;
  assign core_status[0]   = stat_rx_status;




  synchronizer sync_reset_tx_done (
    .clk (xgmii_clk),
    .rst (1'b0),
    .in  (a_gt_reset_tx_done),
    .out (gt_reset_tx_done)
  );

  synchronizer sync_reset_rx_done (
    .clk (xgmii_clk),
    .rst (1'b0),
    .in  (a_gt_reset_rx_done),
    .out (gt_reset_rx_done)
  );

  always @(posedge xgmii_clk) begin : ResetDoneProc
    reset_done <= gt_reset_tx_done & gt_reset_rx_done;
  end









  synchronizer sync_rx_serdes_reset (
    .clk (xgmii_clk),
    .rst (1'b0),
    .in  (~a_gt_reset_rx_done),
    .out (rx_serdes_reset)
  );

  synchronizer sync_tx_reset (
    .clk (xgmii_clk),
    .rst (1'b0),
    .in  (~a_gt_reset_tx_done),
    .out (tx_reset)
  );

  synchronizer sync_rx_reset (
    .clk (xgmii_clk),
    .rst (1'b0),
    .in  (~a_gt_reset_rx_done),
    .out (rx_reset)
  );



  always @(posedge xgmii_clk, posedge areset) begin
      if (areset) begin
        gt_rx_reset_in <= 0;
        rst_count      <= 0;
        stat_rx_status <= 0;
      end else begin
        stat_rx_status <= stat_rx_status_tmp;


        if (!stat_rx_status) begin
          rst_count <= rst_count + 1;

          if (!gt_rx_reset_in) begin


            if (rst_count == RX_RST_WAIT-1) begin
              rst_count     <= 0;
              gt_rx_reset_in <= 1;
            end
          end else begin


            if (rst_count == RX_RST_DURATION-1) begin
              rst_count      <= 0;
              gt_rx_reset_in <= 0;
            end
          end


        end else begin
          rst_count      <= 0;
          gt_rx_reset_in <= 0;
        end
      end
    end

endmodule
module ten_gige_phy (
  input wire areset,
  input wire dclk,
  output wire xgmii_clk,


  output wire txp,
  output wire txn,
  input  wire rxp,
  input  wire rxn,


  input  wire [63:0] xgmii_txd,
  input  wire [ 7:0] xgmii_txc,
  output wire [63:0] xgmii_rxd,
  output wire [ 7:0] xgmii_rxc,


  input  wire qpll0_refclk,
  input  wire qpll0_clk,
  input  wire qpll0_lock,
  output wire qpll0_reset,
  input  wire qpll1_refclk,
  input  wire qpll1_clk,
  input  wire qpll1_lock,
  output wire qpll1_reset,

  output wire rxrecclkout,
  output wire [7:0] core_status,
  output reg        reset_done
);


  localparam XGMII_FREQ      = 125_000_000;
  localparam RX_RST_WAIT     = XGMII_FREQ/2;
  localparam RX_RST_DURATION = 100;
  localparam RX_RST_COUNT_W  = $clog2(RX_RST_WAIT);

  wire rx_serdes_reset;
  wire tx_reset;
  wire rx_reset;

  wire a_gt_reset_tx_done, gt_reset_tx_done;
  wire a_gt_reset_rx_done, gt_reset_rx_done;

  wire stat_rx_status_tmp;
  reg  stat_rx_status;

  reg [RX_RST_COUNT_W-1:0] rst_count;
  reg                      gt_rx_reset_in;











  assign qpll1_reset = 1'b0;

  xge_pcs_pma xge_pcs_pma_i (
    .gt_rxp_in_0                         (rxp),
    .gt_rxn_in_0                         (rxn),
    .gt_txp_out_0                        (txp),
    .gt_txn_out_0                        (txn),
    .rx_core_clk_0                       (xgmii_clk),
    .rx_serdes_reset_0                   (rx_serdes_reset),
    .txoutclksel_in_0                    (3'b101),
    .rxoutclksel_in_0                    (3'b101),
    .gt_dmonitorout_0                    (),
    .gt_eyescandataerror_0               (),
    .gt_eyescanreset_0                   (1'b0),
    .gt_eyescantrigger_0                 (1'b0),
    .gt_pcsrsvdin_0                      (16'b0),
    .gt_rxbufreset_0                     (1'b0),
    .gt_rxbufstatus_0                    (),
    .gt_rxcdrhold_0                      (1'b0),
    .gt_rxcommadeten_0                   (1'b0),
    .gt_rxdfeagchold_0                   (1'b0),
    .gt_rxdfelpmreset_0                  (1'b0),
    .gt_rxlatclk_0                       (1'b0),
    .gt_rxlpmen_0                        (1'b0),
    .gt_rxpcsreset_0                     (1'b0),
    .gt_rxpmareset_0                     (1'b0),
    .gt_rxpolarity_0                     (1'b0),
    .gt_rxprbscntreset_0                 (1'b0),
    .gt_rxprbserr_0                      (),
    .gt_rxprbssel_0                      (4'b0),
    .gt_rxrate_0                         (3'b0),
    .gt_rxslide_in_0                     (1'b0),
    .gt_rxstartofseq_0                   (),
    .gt_txbufstatus_0                    (),
    .gt_txdiffctrl_0                     (5'h18),
    .gt_txinhibit_0                      (1'b0),
    .gt_txlatclk_0                       (1'b0),
    .gt_txmaincursor_0                   (7'h50),
    .gt_txpcsreset_0                     (1'b0),
    .gt_txpmareset_0                     (1'b0),
    .gt_txpolarity_0                     (1'b0),
    .gt_txpostcursor_0                   (5'b0),
    .gt_txprbsforceerr_0                 (1'b0),
    .gt_txprbssel_0                      (4'b0),
    .gt_txprecursor_0                    (5'b0),
    .rxrecclkout_0                       (rxrecclkout),
    .gt_drpclk_0                         (dclk),
    .gt_drpdo_0                          (),
    .gt_drprdy_0                         (),
    .gt_drpen_0                          (1'b0),
    .gt_drpwe_0                          (1'b0),
    .gt_drpaddr_0                        (10'b0),
    .gt_drpdi_0                          (16'b0),
    .sys_reset                           (areset),
    .dclk                                (dclk),
    .tx_mii_clk_0                        (xgmii_clk),
    .rx_clk_out_0                        (),
    .gtpowergood_out_0                   (),
    .qpll0clk_in                         (qpll0_clk),
    .qpll0refclk_in                      (qpll0_refclk),
    .qpll1clk_in                         (qpll1_clk),
    .qpll1refclk_in                      (qpll1_refclk),
    .gtwiz_reset_qpll0lock_in            (qpll0_lock),
    .gtwiz_reset_qpll1lock_in            (qpll1_lock),
    .gtwiz_reset_qpll0reset_out          (qpll0_reset),
    .gtwiz_reset_qpll1reset_out          (),
    .gt_reset_tx_done_out_0              (a_gt_reset_tx_done),
    .gt_reset_rx_done_out_0              (a_gt_reset_rx_done),
    .gt_reset_all_in_0                   (areset),
    .gt_tx_reset_in_0                    (1'b0),
    .gt_rx_reset_in_0                    (gt_rx_reset_in),
    .rx_reset_0                          (rx_reset),
    .rx_mii_d_0                          (xgmii_rxd),
    .rx_mii_c_0                          (xgmii_rxc),
    .ctl_rx_test_pattern_0               (1'b0),
    .ctl_rx_test_pattern_enable_0        (1'b0),
    .ctl_rx_data_pattern_select_0        (1'b0),
    .ctl_rx_prbs31_test_pattern_enable_0 (1'b0),
    .stat_rx_framing_err_0               (),
    .stat_rx_framing_err_valid_0         (),
    .stat_rx_local_fault_0               (),
    .stat_rx_block_lock_0                (),
    .stat_rx_valid_ctrl_code_0           (),
    .stat_rx_status_0                    (stat_rx_status_tmp),
    .stat_rx_hi_ber_0                    (),
    .stat_rx_bad_code_0                  (),
    .stat_rx_bad_code_valid_0            (),
    .stat_rx_error_0                     (),
    .stat_rx_error_valid_0               (),
    .stat_rx_fifo_error_0                (),
    .tx_reset_0                          (tx_reset),
    .tx_mii_d_0                          (xgmii_txd),
    .tx_mii_c_0                          (xgmii_txc),
    .stat_tx_local_fault_0               (),
    .ctl_tx_test_pattern_0               (1'b0),
    .ctl_tx_test_pattern_enable_0        (1'b0),
    .ctl_tx_test_pattern_select_0        (1'b0),
    .ctl_tx_data_pattern_select_0        (1'b0),
    .ctl_tx_test_pattern_seed_a_0        (58'b0),
    .ctl_tx_test_pattern_seed_b_0        (58'b0),
    .ctl_tx_prbs31_test_pattern_enable_0 (1'b0),
    .gt_loopback_in_0                    (3'b0)
  );






  assign core_status[7:1] = 0;
  assign core_status[0]   = stat_rx_status;




  synchronizer sync_reset_tx_done (
    .clk (xgmii_clk),
    .rst (1'b0),
    .in  (a_gt_reset_tx_done),
    .out (gt_reset_tx_done)
  );

  synchronizer sync_reset_rx_done (
    .clk (xgmii_clk),
    .rst (1'b0),
    .in  (a_gt_reset_rx_done),
    .out (gt_reset_rx_done)
  );

  always @(posedge xgmii_clk) begin : ResetDoneProc
    reset_done <= gt_reset_tx_done & gt_reset_rx_done;
  end









  synchronizer sync_rx_serdes_reset (
    .clk (xgmii_clk),
    .rst (1'b0),
    .in  (~a_gt_reset_rx_done),
    .out (rx_serdes_reset)
  );

  synchronizer sync_tx_reset (
    .clk (xgmii_clk),
    .rst (1'b0),
    .in  (~a_gt_reset_tx_done),
    .out (tx_reset)
  );

  synchronizer sync_rx_reset (
    .clk (xgmii_clk),
    .rst (1'b0),
    .in  (~a_gt_reset_rx_done),
    .out (rx_reset)
  );



  always @(posedge xgmii_clk, posedge areset) begin
      if (areset) begin
        gt_rx_reset_in <= 0;
        rst_count      <= 0;
        stat_rx_status <= 0;
      end else begin
        stat_rx_status <= stat_rx_status_tmp;


        if (!stat_rx_status) begin
          rst_count <= rst_count + 1;

          if (!gt_rx_reset_in) begin


            if (rst_count == RX_RST_WAIT-1) begin
              rst_count     <= 0;
              gt_rx_reset_in <= 1;
            end
          end else begin


            if (rst_count == RX_RST_DURATION-1) begin
              rst_count      <= 0;
              gt_rx_reset_in <= 0;
            end
          end


        end else begin
          rst_count      <= 0;
          gt_rx_reset_in <= 0;
        end
      end
    end

endmodule