data/full_repos/permissive/504478691/sound/harmony_and_scale/sound_pwm.v
1: b'%Warning-MULTITOP: data/full_repos/permissive/504478691/sound/harmony_and_scale/sound_pwm.v:14: 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 \'square\'\nmodule square(input [31:0] f_dHz, input clk, output reg soundbit = 0);\n       ^~~~~~\n                                                                                              : ... Top module \'harmonic_pwm\'\nmodule harmonic_pwm(input [31:0] f_dHz, input clk, output soundbit);\n       ^~~~~~~~~~~~\n%Warning-WIDTH: data/full_repos/permissive/504478691/sound/harmony_and_scale/sound_pwm.v:16: Operator DIV expects 64 bits on the RHS, but RHS\'s VARREF \'f_dHz\' generates 32 bits.\n                                                                                           : ... In instance harmonic_pwm\nassign N_0 = 100_000_000_0 / f_dHz;\n                           ^\n%Error: Exiting due to 2 warning(s)\n'
module square(input [31:0] f_dHz, input clk, output reg soundbit = 0);
reg [31:0] n = 0;
always @(posedge clk)
begin
    n = n + 1;
    if (n >= 500_000_000 / f_dHz)
    begin
        n = 1;
        soundbit = ~soundbit;
    end
end
endmodule
module square(input [31:0] f_dHz, input clk, output reg soundbit = 0);

reg [31:0] n = 0;
always @(posedge clk)
begin
    n = n + 1;
    if (n >= 500_000_000 / f_dHz)
    begin
        n = 1;
        soundbit = ~soundbit;
    end
end
endmodule