data/full_repos/permissive/461069000/timer/src/timer_input_controller.v
1: b"%Error: data/full_repos/permissive/461069000/timer/src/timer_input_controller.v:20: Cannot find file containing module: 'prescaler'\n    prescaler prescaler_0(\n    ^~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/461069000/timer/src,data/full_repos/permissive/461069000/prescaler\n             data/full_repos/permissive/461069000/timer/src,data/full_repos/permissive/461069000/prescaler.v\n             data/full_repos/permissive/461069000/timer/src,data/full_repos/permissive/461069000/prescaler.sv\n             prescaler\n             prescaler.v\n             prescaler.sv\n             obj_dir/prescaler\n             obj_dir/prescaler.v\n             obj_dir/prescaler.sv\n%Error: Exiting due to 1 error(s)\n"
module timer_input_controller #(
    parameter PRESCALER_RESOLUTION_BITS=3
)(
    input clk,
    input ext_clk,
    input enable,
    input clock_selector,
    input [PRESCALER_RESOLUTION_BITS-1:0] prescaler_in, 
    output wire modified_ext_clk,
    output wire clock_valid
);

    localparam INTERNAL_CLOCK = 1'b0;
    localparam EXTERNAL_CLOCK = 1'b1;

    wire use_internal_clock = clock_selector == INTERNAL_CLOCK;    
    wire use_external_clock = clock_selector == EXTERNAL_CLOCK;

    prescaler prescaler_0(
        .clk_in(ext_clk),
        .scale_sel(prescaler_in),
        .clk_out(modified_ext_clk)
    );

    assign clock_valid = ((use_internal_clock & enable) 
        | (use_external_clock & enable & modified_ext_clk));

endmodule
module timer_input_controller #(
    parameter PRESCALER_RESOLUTION_BITS=3
)(
    input clk,
    input ext_clk,
    input enable,
    input clock_selector,
    input [PRESCALER_RESOLUTION_BITS-1:0] prescaler_in, 
    output wire modified_ext_clk,
    output wire clock_valid
);


    localparam INTERNAL_CLOCK = 1'b0;
    localparam EXTERNAL_CLOCK = 1'b1;

    wire use_internal_clock = clock_selector == INTERNAL_CLOCK;    
    wire use_external_clock = clock_selector == EXTERNAL_CLOCK;

    prescaler prescaler_0(
        .clk_in(ext_clk),
        .scale_sel(prescaler_in),
        .clk_out(modified_ext_clk)
    );

    assign clock_valid = ((use_internal_clock & enable) 
        | (use_external_clock & enable & modified_ext_clk));

endmodule