data/full_repos/permissive/180199545/PlaySound/speaker_driver.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b'%Warning-WIDTH: data/full_repos/permissive/180199545/PlaySound/speaker_driver.v:43: Value too large for 10 bit number: 1024\n   frequency <= 10\'d1024;\n                ^~~~~~~~\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/180199545/PlaySound/speaker_driver.v:54: syntax error, unexpected begin, expecting \',\' or \':\'\n     begin\n     ^~~~~\n%Error: data/full_repos/permissive/180199545/PlaySound/speaker_driver.v:62: syntax error, unexpected begin\n     begin\n     ^~~~~\n%Error: data/full_repos/permissive/180199545/PlaySound/speaker_driver.v:66: syntax error, unexpected begin, expecting assert or assume or cover or restrict\n     begin\n     ^~~~~\n%Warning-WIDTH: data/full_repos/permissive/180199545/PlaySound/speaker_driver.v:99: Value too large for 10 bit number: 1024\n      frequency <= 10\'d1024;\n                   ^~~~~~~~\n%Error: Exiting due to 3 error(s), 2 warning(s)\n'
module speaker_driver (
	input reset,
	input sys_clk,
	input [3:0] Tone,
	output Out
	);
	
	reg [9:0] frequency;
	wire wave_out;
	
	localparam Tone_C = 4'b0000, Tone_C_sh = 4'b0001, Tone_D = 4'b0010, Tone_D_sh = 4'b0011, Tone_E = 4'b0100,
	Tone_F = 4'b0101, Tone_F_sh = 4'b0110, Tone_G = 4'b0111, Tone_G_sh = 4'b1000, Tone_A = 4'b1001,
	Tone_A_sh = 4'b1010, Tone_B = 4'b1011;
	
	frequency_generator wave(
		.reset(reset),
		.sys_clk(sys_clk),
		.frequency(frequency),
		.Out(wave_out)
	);
	

	
	always @ (posedge sys_clk)
	begin
		if(reset)
		begin
			wave_out <= 1'b0;
			frequency <= 10'd1024;
		end
		else
		begin
			
			case(tone)
				Tone_C:
					begin
						frequency <= 10'd261;
					end
				Tone_C_sh
					begin
						frequency <= 10'd277;
					end
				Tone_D:
					begin
						frequency <= 10'd293;
					end
				Tone_D_sh
					begin
						frequency <= 10'd311;
					end
				Tone_E:
					begin
						frequency <= 10'd329;
					end
				Tone_F:
					begin
						frequency <= 10'd349;
					end
				Tone_F_sh
					begin
						frequency <= 10'd370;
					end
				Tone_G:
					begin
						frequency <= 10'd392;
					end
				Tone_G_sh
					begin
						frequency <= 10'd415;
					end
				Tone_A:
					begin
						frequency <= 10'd440;
					end
				Tone_A_sh
					begin
						frequency <= 10'd466;
					end
				Tone_C:
					begin
						frequency <= 10'd494;
					end
				default:
					begin
						frequency <= 10'd1024;
						wave_out <= 0;
					end
			endcase
		end
	end
	
	assign Out = wave_out;

endmodule
module speaker_driver (
	input reset,
	input sys_clk,
	input [3:0] Tone,
	output Out
	);

	
	reg [9:0] frequency;
	wire wave_out;
	
	localparam Tone_C = 4'b0000, Tone_C_sh = 4'b0001, Tone_D = 4'b0010, Tone_D_sh = 4'b0011, Tone_E = 4'b0100,
	Tone_F = 4'b0101, Tone_F_sh = 4'b0110, Tone_G = 4'b0111, Tone_G_sh = 4'b1000, Tone_A = 4'b1001,
	Tone_A_sh = 4'b1010, Tone_B = 4'b1011;
	
	frequency_generator wave(
		.reset(reset),
		.sys_clk(sys_clk),
		.frequency(frequency),
		.Out(wave_out)
	);
	

	
	always @ (posedge sys_clk)
	begin
		if(reset)
		begin
			wave_out <= 1'b0;
			frequency <= 10'd1024;
		end
		else
		begin
			
			case(tone)
				Tone_C:
					begin
						frequency <= 10'd261;
					end
				Tone_C_sh
					begin
						frequency <= 10'd277;
					end
				Tone_D:
					begin
						frequency <= 10'd293;
					end
				Tone_D_sh
					begin
						frequency <= 10'd311;
					end
				Tone_E:
					begin
						frequency <= 10'd329;
					end
				Tone_F:
					begin
						frequency <= 10'd349;
					end
				Tone_F_sh
					begin
						frequency <= 10'd370;
					end
				Tone_G:
					begin
						frequency <= 10'd392;
					end
				Tone_G_sh
					begin
						frequency <= 10'd415;
					end
				Tone_A:
					begin
						frequency <= 10'd440;
					end
				Tone_A_sh
					begin
						frequency <= 10'd466;
					end
				Tone_C:
					begin
						frequency <= 10'd494;
					end
				default:
					begin
						frequency <= 10'd1024;
						wave_out <= 0;
					end
			endcase
		end
	end
	
	assign Out = wave_out;

endmodule