data/full_repos/permissive/521337848/Hardware/BUZZER/buzzer.v
1: b"%Error: data/full_repos/permissive/521337848/Hardware/BUZZER/buzzer.v:146: Too many digits for 18 bit number: 18'hFFFFFFFF\n if(f_tim ==18'hFFFFFFFF) sig = 0;\n            ^~~~~~~~~~~~\n%Error: Exiting due to 1 error(s)\n"
module buzzerMan(
	input clk,
	input rst,
	
	input[23:0] in,
	input start,

	output reg[2:0] nsound,
	output reg startnoise,	
	
	output[1:0] vol,
	output reg[5:0] sig
);
reg[1:0] vvol = 3;
reg[5:0] f_sig;
reg[1:0] f_vol=3;

reg[19:0] f_tim;
reg[19:0] n_tim;

reg f_p;
reg n_p;

localparam NOP = 8'd0;
localparam SET = 8'd1;
localparam STOP = 8'd2;
localparam VOL = 8'd3;
localparam NOISE = 8'd4;
localparam PEAK = 8'd5;
localparam PEAKL = 8'd6;

always@(posedge clk or posedge rst)
	if(rst) begin
		f_sig <= 0;
		f_vol <= 3;
		f_tim <= 0;
		end
	else begin
		f_tim <= n_tim;
		f_sig <= sig;
		f_vol <= vvol;
		end

always@(*)begin
	n_tim = f_tim;
	
	if(f_tim != 0) n_tim = f_tim + 1;
	
	if(in[23:16] == PEAK) n_tim = 1;
end
		
always@(*)begin
	sig = f_sig;
	vvol = f_vol;
	
	nsound = 0;
	startnoise = 0;
	
	if(f_tim ==18'hFFFFFFFF) sig = 0;
	
	case(in[23:16])
		NOP:;
		SET: begin
			sig = in[5:0];
			nsound = 0;
			startnoise = 1;
			end
		STOP: begin
			sig = 0;
			nsound = 0;
			startnoise = 1;
			end
		VOL: vvol = in[1:0];
		NOISE: begin
			sig = 0;
			nsound = in[2:0];
			startnoise = 1;
		end
		PEAK: begin
			sig = in[5:0];
			nsound = 0;
			startnoise = 1;
		end
		default:;
	endcase
end

assign vol = f_vol;
endmodule
module buzzerMan(
	input clk,
	input rst,
	
	input[23:0] in,
	input start,

	output reg[2:0] nsound,
	output reg startnoise,	
	
	output[1:0] vol,
	output reg[5:0] sig
);

reg[1:0] vvol = 3;
reg[5:0] f_sig;
reg[1:0] f_vol=3;

reg[19:0] f_tim;
reg[19:0] n_tim;

reg f_p;
reg n_p;

localparam NOP = 8'd0;
localparam SET = 8'd1;
localparam STOP = 8'd2;
localparam VOL = 8'd3;
localparam NOISE = 8'd4;
localparam PEAK = 8'd5;
localparam PEAKL = 8'd6;

always@(posedge clk or posedge rst)
	if(rst) begin
		f_sig <= 0;
		f_vol <= 3;
		f_tim <= 0;
		end
	else begin
		f_tim <= n_tim;
		f_sig <= sig;
		f_vol <= vvol;
		end

always@(*)begin
	n_tim = f_tim;
	
	if(f_tim != 0) n_tim = f_tim + 1;
	
	if(in[23:16] == PEAK) n_tim = 1;
end
		
always@(*)begin
	sig = f_sig;
	vvol = f_vol;
	
	nsound = 0;
	startnoise = 0;
	
	if(f_tim ==18'hFFFFFFFF) sig = 0;
	
	case(in[23:16])
		NOP:;
		SET: begin
			sig = in[5:0];
			nsound = 0;
			startnoise = 1;
			end
		STOP: begin
			sig = 0;
			nsound = 0;
			startnoise = 1;
			end
		VOL: vvol = in[1:0];
		NOISE: begin
			sig = 0;
			nsound = in[2:0];
			startnoise = 1;
		end
		PEAK: begin
			sig = in[5:0];
			nsound = 0;
			startnoise = 1;
		end
		default:;
	endcase
end

assign vol = f_vol;
endmodule