data/full_repos/permissive/208741034/touch_led/rtl/touch_led.v
data/verilator_xmls/bf4e506d-5bf7-40e9-a530-24e5ee745c27.xml
module touch_led(
    input clk,
    input rst_n,

    input touch_key,
    output reg led     
);

reg touch_key_d0;
reg touch_key_d1;

wire touch_key_flag;



assign touch_key_flag = (~touch_key_d1) & touch_key_d0;

always @(posedge clk or negedge rst_n) begin
    if(!rst_n)begin
        touch_key_d0 <= 1'b0;
        touch_key_d1 <= 1'b1;
    end
    else begin

        touch_key_d0 <= touch_key;

        touch_key_d1 <= touch_key_d0;
    end
    
end



always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
    led <= 1'b0;
    else begin
        if(touch_key_flag)
          led <= ~led;
        else
          led <= led;
    end
    
end
endmodule
module touch_led(
    input clk,
    input rst_n,

    input touch_key,
    output reg led     
);


reg touch_key_d0;
reg touch_key_d1;

wire touch_key_flag;



assign touch_key_flag = (~touch_key_d1) & touch_key_d0;

always @(posedge clk or negedge rst_n) begin
    if(!rst_n)begin
        touch_key_d0 <= 1'b0;
        touch_key_d1 <= 1'b1;
    end
    else begin

        touch_key_d0 <= touch_key;

        touch_key_d1 <= touch_key_d0;
    end
    
end



always @(posedge clk or negedge rst_n) begin
    if(!rst_n)
    led <= 1'b0;
    else begin
        if(touch_key_flag)
          led <= ~led;
        else
          led <= led;
    end
    
end
endmodule