data/full_repos/permissive/203526788/GoBoard/SPI_master/Debounce_Single_Input.v
 line:15: before: ")"
1: b"%Error: data/full_repos/permissive/203526788/GoBoard/SPI_master/Debounce_Single_Input.v:15: syntax error, unexpected ')', expecting '['\n  );\n  ^\n%Error: data/full_repos/permissive/203526788/GoBoard/SPI_master/Debounce_Single_Input.v:20: syntax error, unexpected always\n  always @(posedge i_Clk)\n  ^~~~~~\n%Error: Exiting due to 2 error(s)\n"
module Debounce_Single_Input #(parameter DEBOUNCE_LIMIT = 250000)
 (input  i_Clk, 
  input  i_Switch, 
  output o_Switch,
  );

  reg [$clog2(DEBOUNCE_LIMIT)-1:0] r_Count = 0;
  reg r_State = 1'b0;

  always @(posedge i_Clk)
  begin


    if (i_Switch != r_State && r_Count < DEBOUNCE_LIMIT)
    begin
      r_Count <= r_Count + 1;
    end


    else if (r_Count == DEBOUNCE_LIMIT)
    begin
      r_State <= i_Switch;
      r_Count <= 0;
    end  


    else
      r_Count <= 0;
  end


  assign o_Switch = r_State;

endmodule
module Debounce_Single_Input #(parameter DEBOUNCE_LIMIT = 250000)
 (input  i_Clk, 
  input  i_Switch, 
  output o_Switch,
  );


  reg [$clog2(DEBOUNCE_LIMIT)-1:0] r_Count = 0;
  reg r_State = 1'b0;

  always @(posedge i_Clk)
  begin


    if (i_Switch != r_State && r_Count < DEBOUNCE_LIMIT)
    begin
      r_Count <= r_Count + 1;
    end


    else if (r_Count == DEBOUNCE_LIMIT)
    begin
      r_State <= i_Switch;
      r_Count <= 0;
    end  


    else
      r_Count <= 0;
  end


  assign o_Switch = r_State;

endmodule