data/full_repos/permissive/18477150/lib/shared/sonic_rxtx_loopback.sv
data/verilator_xmls/7a06f23e-af6f-4c07-99c1-60ccdb0d563f.xml
module sonic_rxtx_loopback (

   data_out_xcvr, data_out_chan,

   clk_in, reset, loopback_en, data_in_chan, data_in_xcvr
   ) ;

   input clk_in;
   input reset;
   input loopback_en;
   input [39:0] data_in_chan;
   input [39:0] data_in_xcvr;
   output [39:0] data_out_xcvr;
   output [39:0] data_out_chan;

   logic 	 loopback_reg;

   always @ ( posedge clk_in or posedge reset) begin
      if (reset)
	loopback_reg <= 0;
      else if (loopback_en)
	loopback_reg <= 1;
      else
	loopback_reg <= 0;
   end
   
   assign data_out_chan = (loopback_reg == 1) ? data_in_chan : data_in_xcvr;
   assign data_out_xcvr = (loopback_reg == 1) ? data_in_xcvr : data_in_chan;
      
endmodule
module sonic_rxtx_loopback (

   data_out_xcvr, data_out_chan,

   clk_in, reset, loopback_en, data_in_chan, data_in_xcvr
   ) ;


   input clk_in;
   input reset;
   input loopback_en;
   input [39:0] data_in_chan;
   input [39:0] data_in_xcvr;
   output [39:0] data_out_xcvr;
   output [39:0] data_out_chan;

   logic 	 loopback_reg;

   always @ ( posedge clk_in or posedge reset) begin
      if (reset)
	loopback_reg <= 0;
      else if (loopback_en)
	loopback_reg <= 1;
      else
	loopback_reg <= 0;
   end
   
   assign data_out_chan = (loopback_reg == 1) ? data_in_chan : data_in_xcvr;
   assign data_out_xcvr = (loopback_reg == 1) ? data_in_xcvr : data_in_chan;
      
endmodule