data/full_repos/permissive/173670949/upduino/blink_led/rgb_blink.v
1: b'%Warning-MULTITOP: data/full_repos/permissive/173670949/upduino/blink_led/rgb_blink.v:55: Multiple top level modules\n                                                                                        : ... Suggest see manual; fix the duplicates, or use --top-module to select top.\n                   ... Use "/* verilator lint_off MULTITOP */" and lint_on around source to disable this message.\n                                                                                        : ... Top module \'rgb_blink\'\nmodule rgb_blink #(\n       ^~~~~~~~~\n                                                                                        : ... Top module \'Mux4In1Out\'\nmodule Mux4In1Out\n       ^~~~~~~~~~\n%Error: data/full_repos/permissive/173670949/upduino/blink_led/rgb_blink.v:18: Cannot find file containing module: \'SAWTOOTH\'\n    SAWTOOTH #(\n    ^~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/173670949/upduino/blink_led,data/full_repos/permissive/173670949/SAWTOOTH\n             data/full_repos/permissive/173670949/upduino/blink_led,data/full_repos/permissive/173670949/SAWTOOTH.v\n             data/full_repos/permissive/173670949/upduino/blink_led,data/full_repos/permissive/173670949/SAWTOOTH.sv\n             SAWTOOTH\n             SAWTOOTH.v\n             SAWTOOTH.sv\n             obj_dir/SAWTOOTH\n             obj_dir/SAWTOOTH.v\n             obj_dir/SAWTOOTH.sv\n%Error: data/full_repos/permissive/173670949/upduino/blink_led/rgb_blink.v:28: Cannot find file containing module: \'PWM\'\n    PWM #(\n    ^~~\n%Error: Exiting due to 2 error(s), 1 warning(s)\n'
module rgb_blink #(
    parameter COUNTER_BITS = 8,
    parameter PRESCALER    = 0
) (
    input  clk,
    output pwm_red,
    output pwm_blue,
    output pwm_green
);


    wire [COUNTER_BITS-1:0] pwm_level;
    wire direction;

    SAWTOOTH #(
        .PRESCALER(PRESCALER),
        .WIDTH(COUNTER_BITS)
    ) sawtooth (
        clk,
        pwm_level,
        direction
    );

    wire pwm_signal;
    PWM #(
        .BITS(COUNTER_BITS)
    ) LED_PWM (
        clk,
        pwm_level,
        pwm_signal
    );


    reg [1:0] color_select = 2'b0;
    always @(posedge direction) begin
        color_select <= color_select + 1;
    end


    wire [3:0] outputs;
    Mux4Out1In mux (
        outputs,
        color_select,
        pwm_signal
    );
    assign pwm_red   = outputs[0] | outputs[3];
    assign pwm_green = outputs[1];
    assign pwm_blue  = outputs[2];

endmodule
module rgb_blink #(
    parameter COUNTER_BITS = 8,
    parameter PRESCALER    = 0
) (
    input  clk,
    output pwm_red,
    output pwm_blue,
    output pwm_green
);



    wire [COUNTER_BITS-1:0] pwm_level;
    wire direction;

    SAWTOOTH #(
        .PRESCALER(PRESCALER),
        .WIDTH(COUNTER_BITS)
    ) sawtooth (
        clk,
        pwm_level,
        direction
    );

    wire pwm_signal;
    PWM #(
        .BITS(COUNTER_BITS)
    ) LED_PWM (
        clk,
        pwm_level,
        pwm_signal
    );


    reg [1:0] color_select = 2'b0;
    always @(posedge direction) begin
        color_select <= color_select + 1;
    end


    wire [3:0] outputs;
    Mux4Out1In mux (
        outputs,
        color_select,
        pwm_signal
    );
    assign pwm_red   = outputs[0] | outputs[3];
    assign pwm_green = outputs[1];
    assign pwm_blue  = outputs[2];

endmodule