data/full_repos/permissive/447976230/fpga/usrp3/top/n3xx/ip/aurora_64b66b_pcs_pma/aurora_phy_x1.v
1: b"%Error: data/full_repos/permissive/447976230/fpga/usrp3/top/n3xx/ip/aurora_64b66b_pcs_pma/aurora_phy_x1.v:93: Cannot find file containing module: 'synchronizer'\n   synchronizer #( .STAGES(3), .INITIAL_VAL(1'b1) ) input_rst_sync_i (\n   ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/447976230/fpga/usrp3/top/n3xx/ip/aurora_64b66b_pcs_pma,data/full_repos/permissive/447976230/synchronizer\n             data/full_repos/permissive/447976230/fpga/usrp3/top/n3xx/ip/aurora_64b66b_pcs_pma,data/full_repos/permissive/447976230/synchronizer.v\n             data/full_repos/permissive/447976230/fpga/usrp3/top/n3xx/ip/aurora_64b66b_pcs_pma,data/full_repos/permissive/447976230/synchronizer.sv\n             synchronizer\n             synchronizer.v\n             synchronizer.sv\n             obj_dir/synchronizer\n             obj_dir/synchronizer.v\n             obj_dir/synchronizer.sv\n%Error: data/full_repos/permissive/447976230/fpga/usrp3/top/n3xx/ip/aurora_64b66b_pcs_pma/aurora_phy_x1.v:97: Cannot find file containing module: 'synchronizer'\n   synchronizer #( .STAGES(3), .INITIAL_VAL(1'b0) ) gt_pll_lock_sync_i (\n   ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/447976230/fpga/usrp3/top/n3xx/ip/aurora_64b66b_pcs_pma/aurora_phy_x1.v:101: Cannot find file containing module: 'synchronizer'\n   synchronizer #( .STAGES(3), .INITIAL_VAL(1'b0) ) mmcm_locked_sync_i (\n   ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/447976230/fpga/usrp3/top/n3xx/ip/aurora_64b66b_pcs_pma/aurora_phy_x1.v:193: Cannot find file containing module: 'aurora_64b66b_pcs_pma'\naurora_64b66b_pcs_pma aurora_64b66b_pcs_pma_i (\n^~~~~~~~~~~~~~~~~~~~~\n%Error: Exiting due to 4 error(s)\n"
module aurora_phy_x1 #(
   parameter SIMULATION = 0
)(

   input             areset,
   input             refclk,
   input             user_clk,
   input             sync_clk,
   input             init_clk,
   input             qpllclk,
   input             qpllrefclk,
   output            user_rst,

   input             rx_p,
   input             rx_n,
   output            tx_p,
   output            tx_n,

   input  [63:0]     s_axis_tdata, 
   input             s_axis_tvalid,
   output            s_axis_tready,

   output [63:0]     m_axis_tdata,  
   output            m_axis_tvalid,

   input  [31:0]     s_axi_awaddr,
   input  [31:0]     s_axi_araddr,
   input  [31:0]     s_axi_wdata,
   input  [3:0]      s_axi_wstrb,
   input             s_axi_awvalid, 
   input             s_axi_rready, 
   output  [31:0]    s_axi_rdata,
   output            s_axi_awready,
   output            s_axi_wready, 
   output            s_axi_bvalid, 
   output  [1:0]     s_axi_bresp, 
   output  [1:0]     s_axi_rresp, 
   input             s_axi_bready, 
   output            s_axi_arready, 
   output            s_axi_rvalid, 
   input             s_axi_arvalid, 
   input             s_axi_wvalid, 

   output reg        channel_up,
   output reg        hard_err,
   output reg        soft_err,
   input             qplllock,
   input             qpllrefclklost,
   output            qpllreset,
   output            tx_out_clk,
   input             mmcm_locked,
   output            gt_pll_lock
);




   wire hard_err_i, soft_err_i, channel_up_i, lane_up_i;
   always @(posedge user_clk) begin
      hard_err   <= hard_err_i;
      soft_err   <= soft_err_i;
      channel_up <= channel_up_i && lane_up_i;
   end

















   localparam PWRON_PMA_INIT_CYC       = 32'd1024;
   localparam SYSRST_ASSERT_CYC        = 32'd128;
   localparam PMA_INIT_ASSERT_CYC_LOG2 = (SIMULATION == 1) ? 4 : 26;
   localparam SYSRST_DEASSERT_CYC      = 32'd20;

   wire reset_iclk, pma_init, reset_pb;
   wire gt_pll_lock_iclk, mmcm_locked_iclk;

   synchronizer #( .STAGES(3), .INITIAL_VAL(1'b1) ) input_rst_sync_i (
      .clk(init_clk), .rst(1'b0), .in(areset), .out(reset_iclk)
   );

   synchronizer #( .STAGES(3), .INITIAL_VAL(1'b0) ) gt_pll_lock_sync_i (
      .clk(init_clk), .rst(1'b0), .in(gt_pll_lock), .out(gt_pll_lock_iclk)
   );

   synchronizer #( .STAGES(3), .INITIAL_VAL(1'b0) ) mmcm_locked_sync_i (
      .clk(init_clk), .rst(1'b0), .in(mmcm_locked), .out(mmcm_locked_iclk)
   );

   localparam [2:0] RST_ST_PWRON_PMA_INIT    = 3'd0;
   localparam [2:0] RST_ST_PWRON_PMA_SYSRST  = 3'd1;
   localparam [2:0] RST_ST_IDLE              = 3'd2;
   localparam [2:0] RST_ST_SYSRST_PRE        = 3'd3;
   localparam [2:0] RST_ST_PMA_INIT          = 3'd4;
   localparam [2:0] RST_ST_SYSRST_POST       = 3'd5;

   reg [2:0]  rst_state = RST_ST_PWRON_PMA_INIT;
   reg [31:0] rst_counter = PWRON_PMA_INIT_CYC;

   always @(posedge init_clk) begin
      case (rst_state)
         RST_ST_PWRON_PMA_INIT: begin
            if (rst_counter == 32'd0) begin
               rst_state   <= RST_ST_PWRON_PMA_SYSRST;
               rst_counter <= SYSRST_DEASSERT_CYC;
            end else begin
               rst_counter <= rst_counter - 32'd1;
            end
         end
         RST_ST_PWRON_PMA_SYSRST: begin
            if (rst_counter == 32'd0) begin
               rst_state   <= RST_ST_IDLE;
            end else begin
               rst_counter <= rst_counter - 32'd1;
            end
         end
         RST_ST_IDLE: begin
            if (reset_iclk) begin
               rst_state   <= RST_ST_SYSRST_PRE;
               rst_counter <= SYSRST_ASSERT_CYC;
            end
         end
         RST_ST_SYSRST_PRE: begin
            if (rst_counter == 32'd0) begin
               rst_state   <= RST_ST_PMA_INIT;
               rst_counter <= {{(32-PMA_INIT_ASSERT_CYC_LOG2){1'b0}}, {PMA_INIT_ASSERT_CYC_LOG2{1'b1}}};
            end else if (mmcm_locked_iclk) begin
               rst_counter <= rst_counter - 32'd1;
            end
         end
         RST_ST_PMA_INIT: begin
            if (rst_counter == 32'd0) begin
               rst_state   <= RST_ST_SYSRST_POST;
               rst_counter <= SYSRST_DEASSERT_CYC;
            end else begin
               rst_counter <= rst_counter - 32'd1;
            end
         end
         RST_ST_SYSRST_POST: begin
            if (rst_counter == 32'd0) begin
               rst_state   <= RST_ST_IDLE;
            end else begin
               rst_counter <= rst_counter - 32'd1;
            end
         end
      endcase
   end

   assign reset_pb = (rst_state != RST_ST_IDLE);
   assign pma_init = (rst_state == RST_ST_PMA_INIT || rst_state == RST_ST_PWRON_PMA_INIT);




   wire gt_qpllclk_quad1_i;
   wire gt_qpllrefclk_quad1_i;
   wire gt_qpllclk_quad2_i;
   wire gt_qpllrefclk_quad2_i;
   wire gt_to_common_qpllreset_i;
   wire gt_qpllrefclklost_i; 
   wire gt_qplllock_i; 
   
   assign gt_qpllclk_quad1_i = qpllclk;
   assign gt_qpllrefclk_quad1_i =  qpllrefclk;
   assign gt_qpllclk_quad2_i = qpllclk;
   assign gt_qpllrefclk_quad2_i = qpllrefclk;
   assign gt_qplllock_i = qplllock;
   assign gt_qpllrefclklost_i = qpllrefclklost;
   assign qpllreset = gt_to_common_qpllreset_i;





   wire        gt_rxcdrovrden_i  = 1'b0;
   wire [2:0]  loopback_i        = 3'b000;
   wire        power_down_i      = 1'b0;
aurora_64b66b_pcs_pma aurora_64b66b_pcs_pma_i (
      .refclk1_in                (refclk),

      .s_axi_tx_tdata            (s_axis_tdata),
      .s_axi_tx_tvalid           (s_axis_tvalid),
      .s_axi_tx_tready           (s_axis_tready),

      .m_axi_rx_tdata            (m_axis_tdata),
      .m_axi_rx_tvalid           (m_axis_tvalid),

      .rxp                       (rx_p),
      .rxn                       (rx_n),
      .txp                       (tx_p),
      .txn                       (tx_n),

      .hard_err                  (hard_err_i),
      .soft_err                  (soft_err_i),
      .channel_up                (channel_up_i),
      .lane_up                   (lane_up_i),

      .mmcm_not_locked           (!mmcm_locked),
      .user_clk                  (user_clk),
      .sync_clk                  (sync_clk),
      .reset_pb                  (reset_pb),
      .gt_rxcdrovrden_in         (gt_rxcdrovrden_i),
      .power_down                (power_down_i),
      .loopback                  (loopback_i),
      .pma_init                  (pma_init),
      .gt_pll_lock               (gt_pll_lock),
      .drp_clk_in                (init_clk),
      .gt_qpllclk_quad1_in       (gt_qpllclk_quad1_i),
      .gt_qpllrefclk_quad1_in    (gt_qpllrefclk_quad1_i),
      .gt_to_common_qpllreset_out(gt_to_common_qpllreset_i),
      .gt_qplllock_in            (gt_qplllock_i), 
      .gt_qpllrefclklost_in      (gt_qpllrefclklost_i),

      .s_axi_awaddr              (s_axi_awaddr),
      .s_axi_awvalid             (s_axi_awvalid), 
      .s_axi_awready             (s_axi_awready), 
      .s_axi_wdata               (s_axi_wdata),
      .s_axi_wstrb               (s_axi_wstrb),
      .s_axi_wvalid              (s_axi_wvalid), 
      .s_axi_wready              (s_axi_wready), 
      .s_axi_bvalid              (s_axi_bvalid), 
      .s_axi_bresp               (s_axi_bresp), 
      .s_axi_bready              (s_axi_bready), 
      .s_axi_araddr              (s_axi_araddr),
      .s_axi_arvalid             (s_axi_arvalid), 
      .s_axi_arready             (s_axi_arready), 
      .s_axi_rdata               (s_axi_rdata),
      .s_axi_rvalid              (s_axi_rvalid), 
      .s_axi_rresp               (s_axi_rresp), 
      .s_axi_rready              (s_axi_rready), 

      .qpll_drpaddr_in           (qpll_drpaddr_in_i),
      .qpll_drpdi_in             (qpll_drpdi_in_i),
      .qpll_drpdo_out            (), 
      .qpll_drprdy_out           (), 
      .qpll_drpen_in             (qpll_drpen_in_i), 
      .qpll_drpwe_in             (qpll_drpwe_in_i), 
      .init_clk                  (init_clk),
      .link_reset_out            (),
      .sys_reset_out             (user_rst),
      .tx_out_clk                (tx_out_clk)
   );
endmodule
module aurora_phy_x1 #(
   parameter SIMULATION = 0
)(

   input             areset,
   input             refclk,
   input             user_clk,
   input             sync_clk,
   input             init_clk,
   input             qpllclk,
   input             qpllrefclk,
   output            user_rst,

   input             rx_p,
   input             rx_n,
   output            tx_p,
   output            tx_n,

   input  [63:0]     s_axis_tdata, 
   input             s_axis_tvalid,
   output            s_axis_tready,

   output [63:0]     m_axis_tdata,  
   output            m_axis_tvalid,

   input  [31:0]     s_axi_awaddr,
   input  [31:0]     s_axi_araddr,
   input  [31:0]     s_axi_wdata,
   input  [3:0]      s_axi_wstrb,
   input             s_axi_awvalid, 
   input             s_axi_rready, 
   output  [31:0]    s_axi_rdata,
   output            s_axi_awready,
   output            s_axi_wready, 
   output            s_axi_bvalid, 
   output  [1:0]     s_axi_bresp, 
   output  [1:0]     s_axi_rresp, 
   input             s_axi_bready, 
   output            s_axi_arready, 
   output            s_axi_rvalid, 
   input             s_axi_arvalid, 
   input             s_axi_wvalid, 

   output reg        channel_up,
   output reg        hard_err,
   output reg        soft_err,
   input             qplllock,
   input             qpllrefclklost,
   output            qpllreset,
   output            tx_out_clk,
   input             mmcm_locked,
   output            gt_pll_lock
);





   wire hard_err_i, soft_err_i, channel_up_i, lane_up_i;
   always @(posedge user_clk) begin
      hard_err   <= hard_err_i;
      soft_err   <= soft_err_i;
      channel_up <= channel_up_i && lane_up_i;
   end

















   localparam PWRON_PMA_INIT_CYC       = 32'd1024;
   localparam SYSRST_ASSERT_CYC        = 32'd128;
   localparam PMA_INIT_ASSERT_CYC_LOG2 = (SIMULATION == 1) ? 4 : 26;
   localparam SYSRST_DEASSERT_CYC      = 32'd20;

   wire reset_iclk, pma_init, reset_pb;
   wire gt_pll_lock_iclk, mmcm_locked_iclk;

   synchronizer #( .STAGES(3), .INITIAL_VAL(1'b1) ) input_rst_sync_i (
      .clk(init_clk), .rst(1'b0), .in(areset), .out(reset_iclk)
   );

   synchronizer #( .STAGES(3), .INITIAL_VAL(1'b0) ) gt_pll_lock_sync_i (
      .clk(init_clk), .rst(1'b0), .in(gt_pll_lock), .out(gt_pll_lock_iclk)
   );

   synchronizer #( .STAGES(3), .INITIAL_VAL(1'b0) ) mmcm_locked_sync_i (
      .clk(init_clk), .rst(1'b0), .in(mmcm_locked), .out(mmcm_locked_iclk)
   );

   localparam [2:0] RST_ST_PWRON_PMA_INIT    = 3'd0;
   localparam [2:0] RST_ST_PWRON_PMA_SYSRST  = 3'd1;
   localparam [2:0] RST_ST_IDLE              = 3'd2;
   localparam [2:0] RST_ST_SYSRST_PRE        = 3'd3;
   localparam [2:0] RST_ST_PMA_INIT          = 3'd4;
   localparam [2:0] RST_ST_SYSRST_POST       = 3'd5;

   reg [2:0]  rst_state = RST_ST_PWRON_PMA_INIT;
   reg [31:0] rst_counter = PWRON_PMA_INIT_CYC;

   always @(posedge init_clk) begin
      case (rst_state)
         RST_ST_PWRON_PMA_INIT: begin
            if (rst_counter == 32'd0) begin
               rst_state   <= RST_ST_PWRON_PMA_SYSRST;
               rst_counter <= SYSRST_DEASSERT_CYC;
            end else begin
               rst_counter <= rst_counter - 32'd1;
            end
         end
         RST_ST_PWRON_PMA_SYSRST: begin
            if (rst_counter == 32'd0) begin
               rst_state   <= RST_ST_IDLE;
            end else begin
               rst_counter <= rst_counter - 32'd1;
            end
         end
         RST_ST_IDLE: begin
            if (reset_iclk) begin
               rst_state   <= RST_ST_SYSRST_PRE;
               rst_counter <= SYSRST_ASSERT_CYC;
            end
         end
         RST_ST_SYSRST_PRE: begin
            if (rst_counter == 32'd0) begin
               rst_state   <= RST_ST_PMA_INIT;
               rst_counter <= {{(32-PMA_INIT_ASSERT_CYC_LOG2){1'b0}}, {PMA_INIT_ASSERT_CYC_LOG2{1'b1}}};
            end else if (mmcm_locked_iclk) begin
               rst_counter <= rst_counter - 32'd1;
            end
         end
         RST_ST_PMA_INIT: begin
            if (rst_counter == 32'd0) begin
               rst_state   <= RST_ST_SYSRST_POST;
               rst_counter <= SYSRST_DEASSERT_CYC;
            end else begin
               rst_counter <= rst_counter - 32'd1;
            end
         end
         RST_ST_SYSRST_POST: begin
            if (rst_counter == 32'd0) begin
               rst_state   <= RST_ST_IDLE;
            end else begin
               rst_counter <= rst_counter - 32'd1;
            end
         end
      endcase
   end

   assign reset_pb = (rst_state != RST_ST_IDLE);
   assign pma_init = (rst_state == RST_ST_PMA_INIT || rst_state == RST_ST_PWRON_PMA_INIT);




   wire gt_qpllclk_quad1_i;
   wire gt_qpllrefclk_quad1_i;
   wire gt_qpllclk_quad2_i;
   wire gt_qpllrefclk_quad2_i;
   wire gt_to_common_qpllreset_i;
   wire gt_qpllrefclklost_i; 
   wire gt_qplllock_i; 
   
   assign gt_qpllclk_quad1_i = qpllclk;
   assign gt_qpllrefclk_quad1_i =  qpllrefclk;
   assign gt_qpllclk_quad2_i = qpllclk;
   assign gt_qpllrefclk_quad2_i = qpllrefclk;
   assign gt_qplllock_i = qplllock;
   assign gt_qpllrefclklost_i = qpllrefclklost;
   assign qpllreset = gt_to_common_qpllreset_i;





   wire        gt_rxcdrovrden_i  = 1'b0;
   wire [2:0]  loopback_i        = 3'b000;
   wire        power_down_i      = 1'b0;
aurora_64b66b_pcs_pma aurora_64b66b_pcs_pma_i (
      .refclk1_in                (refclk),

      .s_axi_tx_tdata            (s_axis_tdata),
      .s_axi_tx_tvalid           (s_axis_tvalid),
      .s_axi_tx_tready           (s_axis_tready),

      .m_axi_rx_tdata            (m_axis_tdata),
      .m_axi_rx_tvalid           (m_axis_tvalid),

      .rxp                       (rx_p),
      .rxn                       (rx_n),
      .txp                       (tx_p),
      .txn                       (tx_n),

      .hard_err                  (hard_err_i),
      .soft_err                  (soft_err_i),
      .channel_up                (channel_up_i),
      .lane_up                   (lane_up_i),

      .mmcm_not_locked           (!mmcm_locked),
      .user_clk                  (user_clk),
      .sync_clk                  (sync_clk),
      .reset_pb                  (reset_pb),
      .gt_rxcdrovrden_in         (gt_rxcdrovrden_i),
      .power_down                (power_down_i),
      .loopback                  (loopback_i),
      .pma_init                  (pma_init),
      .gt_pll_lock               (gt_pll_lock),
      .drp_clk_in                (init_clk),
      .gt_qpllclk_quad1_in       (gt_qpllclk_quad1_i),
      .gt_qpllrefclk_quad1_in    (gt_qpllrefclk_quad1_i),
      .gt_to_common_qpllreset_out(gt_to_common_qpllreset_i),
      .gt_qplllock_in            (gt_qplllock_i), 
      .gt_qpllrefclklost_in      (gt_qpllrefclklost_i),

      .s_axi_awaddr              (s_axi_awaddr),
      .s_axi_awvalid             (s_axi_awvalid), 
      .s_axi_awready             (s_axi_awready), 
      .s_axi_wdata               (s_axi_wdata),
      .s_axi_wstrb               (s_axi_wstrb),
      .s_axi_wvalid              (s_axi_wvalid), 
      .s_axi_wready              (s_axi_wready), 
      .s_axi_bvalid              (s_axi_bvalid), 
      .s_axi_bresp               (s_axi_bresp), 
      .s_axi_bready              (s_axi_bready), 
      .s_axi_araddr              (s_axi_araddr),
      .s_axi_arvalid             (s_axi_arvalid), 
      .s_axi_arready             (s_axi_arready), 
      .s_axi_rdata               (s_axi_rdata),
      .s_axi_rvalid              (s_axi_rvalid), 
      .s_axi_rresp               (s_axi_rresp), 
      .s_axi_rready              (s_axi_rready), 

      .qpll_drpaddr_in           (qpll_drpaddr_in_i),
      .qpll_drpdi_in             (qpll_drpdi_in_i),
      .qpll_drpdo_out            (), 
      .qpll_drprdy_out           (), 
      .qpll_drpen_in             (qpll_drpen_in_i), 
      .qpll_drpwe_in             (qpll_drpwe_in_i), 
      .init_clk                  (init_clk),
      .link_reset_out            (),
      .sys_reset_out             (user_rst),
      .tx_out_clk                (tx_out_clk)
   );
endmodule