data/full_repos/permissive/461569093/CodesForFSM/A2_RawatA.srcs/sources_1/imports/Provided code/debouncer.v
1: b'%Error: Cannot find file containing module: code,data/full_repos/permissive/461569093\n        ... Looked in:\n             data/full_repos/permissive/461569093/CodesForFSM/A2_RawatA.srcs/sources_1/imports/Provided/code,data/full_repos/permissive/461569093\n             data/full_repos/permissive/461569093/CodesForFSM/A2_RawatA.srcs/sources_1/imports/Provided/code,data/full_repos/permissive/461569093.v\n             data/full_repos/permissive/461569093/CodesForFSM/A2_RawatA.srcs/sources_1/imports/Provided/code,data/full_repos/permissive/461569093.sv\n             code,data/full_repos/permissive/461569093\n             code,data/full_repos/permissive/461569093.v\n             code,data/full_repos/permissive/461569093.sv\n             obj_dir/code,data/full_repos/permissive/461569093\n             obj_dir/code,data/full_repos/permissive/461569093.v\n             obj_dir/code,data/full_repos/permissive/461569093.sv\n%Error: Cannot find file containing module: data/full_repos/permissive/461569093/CodesForFSM/A2_RawatA.srcs/sources_1/imports/Provided\n%Error: Cannot find file containing module: code/debouncer.v\n%Error: Exiting due to 3 error(s)\n'
module debouncer
(input clk,
    input reset,
    input [4:0] button_in, 
    output reg [4:0] button_out
);

localparam threshold = 24'hFFFFFF;
reg [26:0] counter; 


reg [4:0] button_d1, button_d2; 
always @ (posedge clk) 
begin
    button_d1 <= button_in;
    button_d2 <= button_d1;
end

always @(posedge clk or posedge reset)
    begin
        if(reset==1) begin
            counter <= 1;
            button_out <= 0;
        end
        else begin
            button_out <= 0;
            if (|button_d2) begin
                 if(~&counter) 
                     counter <= counter + 1;
            end
            else begin
                if (|counter) 
                    counter <= counter - 1;
            end
            if (counter > threshold) begin
                button_out <= button_d2;
                counter <= 0;
            end
        end
    end 
 

 endmodule
module debouncer
(input clk,
    input reset,
    input [4:0] button_in, 
    output reg [4:0] button_out
);


localparam threshold = 24'hFFFFFF;
reg [26:0] counter; 


reg [4:0] button_d1, button_d2; 
always @ (posedge clk) 
begin
    button_d1 <= button_in;
    button_d2 <= button_d1;
end

always @(posedge clk or posedge reset)
    begin
        if(reset==1) begin
            counter <= 1;
            button_out <= 0;
        end
        else begin
            button_out <= 0;
            if (|button_d2) begin
                 if(~&counter) 
                     counter <= counter + 1;
            end
            else begin
                if (|counter) 
                    counter <= counter - 1;
            end
            if (counter > threshold) begin
                button_out <= button_d2;
                counter <= 0;
            end
        end
    end 
 

 endmodule