data/full_repos/permissive/485295380/mealy-moore FSM/edge_detect.v
1: b'%Error: Cannot find file containing module: FSM,data/full_repos/permissive/485295380\n        ... Looked in:\n             data/full_repos/permissive/485295380/mealy-moore/FSM,data/full_repos/permissive/485295380\n             data/full_repos/permissive/485295380/mealy-moore/FSM,data/full_repos/permissive/485295380.v\n             data/full_repos/permissive/485295380/mealy-moore/FSM,data/full_repos/permissive/485295380.sv\n             FSM,data/full_repos/permissive/485295380\n             FSM,data/full_repos/permissive/485295380.v\n             FSM,data/full_repos/permissive/485295380.sv\n             obj_dir/FSM,data/full_repos/permissive/485295380\n             obj_dir/FSM,data/full_repos/permissive/485295380.v\n             obj_dir/FSM,data/full_repos/permissive/485295380.sv\n%Error: Cannot find file containing module: data/full_repos/permissive/485295380/mealy-moore\n%Error: Cannot find file containing module: FSM/edge_detect.v\n%Error: Exiting due to 3 error(s)\n'
module edgeDetector(
    input clk,
    input level,
    input rst,
    output reg mealy_tick,
    output reg moore_tick
    );

    localparam zeroMealy = 1'b0, oneMealy = 1'b1;

    localparam [1:0]
        zeroMoore = 2'b00,
        edgeMoore = 2'b01,
        oneMoore = 2'b11;

    reg stateMealy_reg, stateMealy_next;
    reg [1:0] stateMoore_reg, stateMoore_next ;

    always@(posedge clk, posedge rst) begin
        if (rst) begin
            stateMealy_reg <= zeroMealy;
            stateMoore_reg <= zeroMoore;
        end
        else begin
            stateMealy_reg <= stateMealy_next;
            stateMoore_reg <= stateMoore_next;
        end
    end
        

        always @(stateMealy_reg, level) begin

            stateMealy_next = stateMealy_next;

            mealy_tick <= 1'b0;
            case (stateMealy_reg)
                zeroMealy:
                    if(level) begin
                        stateMealy_next <= oneMealy;
                        mealy_tick <= 1'b1;
                    end
                oneMealy:
                    if (~level) begin
                        stateMealy_next <= zeroMealy;
                    end   
            endcase
        end


        always @(stateMoore_reg, level) begin

            stateMoore_next = stateMoore_reg;

            moore_tick <= 1'b0;
            case (stateMoore_reg)
                zeroMoore:
                if (level) begin
                    stateMoore_next <= edgeMoore;
                end
                edgeMoore: begin
                    moore_tick <= 1'b1;
                    if(level)
                    stateMoore_next <= oneMoore;
                    else
                        stateMoore_next <= zeroMoore;
                end
                oneMoore:
                if (~level) begin
                    stateMoore_reg <= zeroMoore;
                end
            endcase
        end
endmodule
module edgeDetector(
    input clk,
    input level,
    input rst,
    output reg mealy_tick,
    output reg moore_tick
    );


    localparam zeroMealy = 1'b0, oneMealy = 1'b1;

    localparam [1:0]
        zeroMoore = 2'b00,
        edgeMoore = 2'b01,
        oneMoore = 2'b11;

    reg stateMealy_reg, stateMealy_next;
    reg [1:0] stateMoore_reg, stateMoore_next ;

    always@(posedge clk, posedge rst) begin
        if (rst) begin
            stateMealy_reg <= zeroMealy;
            stateMoore_reg <= zeroMoore;
        end
        else begin
            stateMealy_reg <= stateMealy_next;
            stateMoore_reg <= stateMoore_next;
        end
    end
        

        always @(stateMealy_reg, level) begin

            stateMealy_next = stateMealy_next;

            mealy_tick <= 1'b0;
            case (stateMealy_reg)
                zeroMealy:
                    if(level) begin
                        stateMealy_next <= oneMealy;
                        mealy_tick <= 1'b1;
                    end
                oneMealy:
                    if (~level) begin
                        stateMealy_next <= zeroMealy;
                    end   
            endcase
        end


        always @(stateMoore_reg, level) begin

            stateMoore_next = stateMoore_reg;

            moore_tick <= 1'b0;
            case (stateMoore_reg)
                zeroMoore:
                if (level) begin
                    stateMoore_next <= edgeMoore;
                end
                edgeMoore: begin
                    moore_tick <= 1'b1;
                    if(level)
                    stateMoore_next <= oneMoore;
                    else
                        stateMoore_next <= zeroMoore;
                end
                oneMoore:
                if (~level) begin
                    stateMoore_reg <= zeroMoore;
                end
            endcase
        end
endmodule