data/full_repos/permissive/472097485/Chu04/Banner_05/ModMCounter.v
1: b'%Warning-WIDTH: data/full_repos/permissive/472097485/Chu04/Banner_05/ModMCounter.v:19: Operator EQ expects 32 or 2 bits on the LHS, but LHS\'s VARREF \'counter\' generates 1 bits.\n                                                                                     : ... In instance ModMCounter\nassign next = en ? ( counter == M - 1 ? 0 : counter + 1 ) : counter;\n                             ^~\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error: Exiting due to 1 warning(s)\n'
module ModMCounter #( parameter M = 2, parameter N = 1 )( input clk, input reset, input en, output [N-1:0] count );

reg [N-1:0] counter;
wire [N-1:0] next;


always @( posedge clk, posedge reset )
begin
	if( reset )
		counter <= 0;
	else
		counter <= next;
end


assign next = en ? ( counter == M - 1 ? 0 : counter + 1 ) : counter;


assign count = counter;

endmodule
module ModMCounter #( parameter M = 2, parameter N = 1 )( input clk, input reset, input en, output [N-1:0] count );


reg [N-1:0] counter;
wire [N-1:0] next;


always @( posedge clk, posedge reset )
begin
	if( reset )
		counter <= 0;
	else
		counter <= next;
end


assign next = en ? ( counter == M - 1 ? 0 : counter + 1 ) : counter;


assign count = counter;

endmodule