data/full_repos/permissive/162874044/HDL Files/hdmiInterface.v
 line:82: before: "("
1: b'%Error: Cannot find file containing module: Files,data/full_repos/permissive/162874044\n        ... Looked in:\n             data/full_repos/permissive/162874044/HDL/Files,data/full_repos/permissive/162874044\n             data/full_repos/permissive/162874044/HDL/Files,data/full_repos/permissive/162874044.v\n             data/full_repos/permissive/162874044/HDL/Files,data/full_repos/permissive/162874044.sv\n             Files,data/full_repos/permissive/162874044\n             Files,data/full_repos/permissive/162874044.v\n             Files,data/full_repos/permissive/162874044.sv\n             obj_dir/Files,data/full_repos/permissive/162874044\n             obj_dir/Files,data/full_repos/permissive/162874044.v\n             obj_dir/Files,data/full_repos/permissive/162874044.sv\n%Error: Cannot find file containing module: data/full_repos/permissive/162874044/HDL\n%Error: Cannot find file containing module: Files/hdmiInterface.v\n%Error: Exiting due to 3 error(s)\n'
module hdmiInterface 



#(

	parameter hPlacement	= 88,
	parameter hDuration		= 44,
	parameter hDelay		= 192,
	parameter hPolarity		= 1,

	parameter vPlacement	= 4,
	parameter vDuration		= 5,
	parameter vDelay		= 41,
	parameter vPolarity		= 1,

	parameter width			= 1920,
	parameter height		= 1080
)

(
	input 	pixelClock,
	output	DE,
	output 	HSYNC,
	output	VSYNC
);
	localparam lineWidth	= width + hPlacement + hDelay;
	localparam lineHeight	= height + vPlacement + vDelay;


	localparam deDelay		= ( hDelay - ( hDuration + hPlacement ) );
	
	reg de		= 1'b0;
	reg hsync	= 1'b0;
	reg vsync	= 1'b0;
	
	assign DE 		= de;
	assign HSYNC	= hsync;
	assign VSYNC	= vsync;
	
	reg [11:0]	pCounter		= 0;
	reg [11:0]	hCounter 		= 1;

	
	localparam resetState			= 0;
	localparam startFrame			= 1;
	localparam vSyncState			= 2;
	localparam endBlankHSync		= 3;
	localparam activeVideo			= 4;
	localparam startBlankFrame		= 5;
	
	reg[4:0]	currentState	= 0;
	reg[4:0]	nextState		= 0;
	


	always @( posedge( pixelClock ) )
		begin: currentStateTransition
			currentState <= nextState;	
		end
		

	always @( * )
		begin: nextStateLogic
			case( currentState )
				default:
					begin
						nextState = startFrame;
					end
				
				startFrame:
					begin



						if( pCounter == hDuration )
							begin
								nextState = vSyncState;
							end
						else if ( ( pCounter == hDuration ) && ( hCounter == vDuration ) )
							begin
								nextState = endBlankHSync;
							end
						else
							begin
								nextState = currentState;
							end
					end
					
				vSyncState:
					begin



						if ( ( hCounter == vDuration ) && ( pCounter == lineWidth ) )
							begin
								nextState = endBlankHSync;
							end
						else if ( ( pCounter == lineWidth ) && ( hCounter != vDuration ) )
							begin
								nextState = startFrame;
							end
						else
							begin
								nextState = currentState;
							end
					end
					
				endBlankHSync:
					begin

						if ( ( pCounter == lineWidth ) && ( hCounter == vDelay ) )
							begin
								nextState = activeVideo;
							end
						else
							begin
								nextState = currentState;
							end
					end
					
				activeVideo:
					begin

						if( hCounter > ( lineHeight - vPlacement ) )
							begin
								nextState = startBlankFrame;
							end
						else
							begin
								nextState = currentState;
							end
					end
					
				startBlankFrame:
					begin

						if ( ( pCounter == lineWidth ) && ( hCounter == lineHeight ) )
							begin
								nextState = startFrame;
							end
						else
							begin
								nextState = currentState;
							end
					end
				
			endcase
		end
			
	
	always @ ( posedge ( pixelClock ) )
		begin: currentStateLogic
			case( currentState )
				default:
					begin
						hsync 		<= 1'b0;
						vsync		<= 1'b0;
						de 			<= 1'b0;
						pCounter	<= 1'b0;
						hCounter	<= 1'b1;
					end
					
				resetState:
					begin
						hsync 		<= 1'b1;
						vsync		<= 1'b1;
						de 			<= 1'b0;
						pCounter	<= 1'b1;
						hCounter	<= 1'b1;
					end
					
				startFrame:
					begin
						vsync		<= 1'b1;
						de 			<= 1'b0;


						

						


						if ( pCounter >= hDuration )
							begin
								hsync 		<= 1'b0;
							end
						else if ( pCounter == lineWidth )
							begin
								hsync		<= 1'b1;
							end
						else
							begin
								hsync		<= 1'b1;
							end
							


						if ( pCounter >= lineWidth )
							begin
								pCounter <= 1;
								hCounter <= hCounter + 1'b1;
							end

						else if ( hCounter == ( lineHeight + 1 ) )
							begin
								pCounter <= 0;
								hCounter <= 1;
							end
						else
							begin
								pCounter <= pCounter + 1'b1;
								hCounter <= hCounter;
							end
						



						if ( hCounter > vDuration )
							begin
								vsync		<= 1'b0;
							end
						else
							begin
								vsync		<= 1'b1;
							end
					end
				
			vSyncState:
				begin

					vsync		<= 1'b1;
					de			<= 1'b0;
					
					


					if( pCounter == lineWidth )
						begin
							hsync 		<= 1'b1;
							hCounter 	<= hCounter + 1'b1;
							pCounter	<= 1;
						end						
					else
						begin
							hsync 		<= 1'b0;
							hCounter 	<= hCounter;
							pCounter	<= pCounter + 1'b1;
						end
						

					if ( ( pCounter == lineWidth ) && ( hCounter == vDuration ) )
						begin
							vsync	<= 1'b0;
						end
					else
						begin
							vsync	<= 1'b1;
						end
				end
				
			endBlankHSync:
				begin
					vsync		<= 1'b0;
					de			<= 1'b0;
					


						if ( ( pCounter >= hDuration ) && ( pCounter != lineWidth ) )
							begin
								hsync 		<= 1'b0;
							end
						else if ( pCounter == lineWidth )
							begin
								hsync		<= 1'b1;
							end
						else
							begin
								hsync		<= 1'b1;
							end
							


						if ( pCounter == lineWidth )
							begin
								pCounter <= 1;
								hCounter <= hCounter + 1'b1;
							end
						else
							begin
								pCounter <= pCounter + 1'b1;
								hCounter <= hCounter;
							end
				end
				
			activeVideo:
				begin
					vsync		<= 1'b0;
					


						if ( ( pCounter >= hDuration ) && ( pCounter != lineWidth ) )
							begin
								hsync 		<= 1'b0;
							end
						else if ( pCounter == lineWidth )
							begin
								hsync		<= 1'b1;
							end
						else
							begin
								hsync		<= 1'b1;
							end
							


						if ( pCounter == lineWidth )
							begin
								pCounter 	<= 1;
								hCounter 	<= hCounter + 1'b1;
							end
						else
							begin
								pCounter <= pCounter + 1'b1;
								hCounter <= hCounter;
							end
							



						if ( ( pCounter < hDelay ) || ( pCounter >= ( ( lineWidth - hPlacement ) - 1 ) ) )
							begin
								de			<= 1'b0;
							end
						else
							begin
								de			<= 1'b1;
							end			
				end
					
			startBlankFrame:
				begin

					de		<= 1'b0;


					



						if ( ( pCounter >= hDuration ) && ( pCounter != lineWidth ) )
							begin
								hsync 		<= 1'b0;
							end
						else if ( pCounter == lineWidth )
							begin
								hsync		<= 1'b1;
							end
						else
							begin
								hsync		<= 1'b1;
							end
						


					if ( ( pCounter >= lineWidth ) && ( hCounter != lineHeight ) )
						begin
							pCounter 	<= 1;
							hCounter 	<= hCounter + 1'b1;
							vsync		<= 1'b0;
						end
					else if ( ( pCounter >= lineWidth ) && ( hCounter == lineHeight ) )
						begin
							pCounter	<= 1;
							hCounter	<= 1;
							vsync		<= 1'b1;
						end
					else
						begin
							pCounter <= pCounter + 1'b1;
							hCounter <= hCounter;
							vsync		<= 1'b0;

						end	
				end
			
			endcase
		end

endmodule
module hdmiInterface 



#(

	parameter hPlacement	= 88,
	parameter hDuration		= 44,
	parameter hDelay		= 192,
	parameter hPolarity		= 1,

	parameter vPlacement	= 4,
	parameter vDuration		= 5,
	parameter vDelay		= 41,
	parameter vPolarity		= 1,

	parameter width			= 1920,
	parameter height		= 1080
)

(
	input 	pixelClock,
	output	DE,
	output 	HSYNC,
	output	VSYNC
);

	localparam lineWidth	= width + hPlacement + hDelay;
	localparam lineHeight	= height + vPlacement + vDelay;


	localparam deDelay		= ( hDelay - ( hDuration + hPlacement ) );
	
	reg de		= 1'b0;
	reg hsync	= 1'b0;
	reg vsync	= 1'b0;
	
	assign DE 		= de;
	assign HSYNC	= hsync;
	assign VSYNC	= vsync;
	
	reg [11:0]	pCounter		= 0;
	reg [11:0]	hCounter 		= 1;

	
	localparam resetState			= 0;
	localparam startFrame			= 1;
	localparam vSyncState			= 2;
	localparam endBlankHSync		= 3;
	localparam activeVideo			= 4;
	localparam startBlankFrame		= 5;
	
	reg[4:0]	currentState	= 0;
	reg[4:0]	nextState		= 0;
	


	always @( posedge( pixelClock ) )
		begin: currentStateTransition
			currentState <= nextState;	
		end
		

	always @( * )
		begin: nextStateLogic
			case( currentState )
				default:
					begin
						nextState = startFrame;
					end
				
				startFrame:
					begin



						if( pCounter == hDuration )
							begin
								nextState = vSyncState;
							end
						else if ( ( pCounter == hDuration ) && ( hCounter == vDuration ) )
							begin
								nextState = endBlankHSync;
							end
						else
							begin
								nextState = currentState;
							end
					end
					
				vSyncState:
					begin



						if ( ( hCounter == vDuration ) && ( pCounter == lineWidth ) )
							begin
								nextState = endBlankHSync;
							end
						else if ( ( pCounter == lineWidth ) && ( hCounter != vDuration ) )
							begin
								nextState = startFrame;
							end
						else
							begin
								nextState = currentState;
							end
					end
					
				endBlankHSync:
					begin

						if ( ( pCounter == lineWidth ) && ( hCounter == vDelay ) )
							begin
								nextState = activeVideo;
							end
						else
							begin
								nextState = currentState;
							end
					end
					
				activeVideo:
					begin

						if( hCounter > ( lineHeight - vPlacement ) )
							begin
								nextState = startBlankFrame;
							end
						else
							begin
								nextState = currentState;
							end
					end
					
				startBlankFrame:
					begin

						if ( ( pCounter == lineWidth ) && ( hCounter == lineHeight ) )
							begin
								nextState = startFrame;
							end
						else
							begin
								nextState = currentState;
							end
					end
				
			endcase
		end
			
	
	always @ ( posedge ( pixelClock ) )
		begin: currentStateLogic
			case( currentState )
				default:
					begin
						hsync 		<= 1'b0;
						vsync		<= 1'b0;
						de 			<= 1'b0;
						pCounter	<= 1'b0;
						hCounter	<= 1'b1;
					end
					
				resetState:
					begin
						hsync 		<= 1'b1;
						vsync		<= 1'b1;
						de 			<= 1'b0;
						pCounter	<= 1'b1;
						hCounter	<= 1'b1;
					end
					
				startFrame:
					begin
						vsync		<= 1'b1;
						de 			<= 1'b0;


						

						


						if ( pCounter >= hDuration )
							begin
								hsync 		<= 1'b0;
							end
						else if ( pCounter == lineWidth )
							begin
								hsync		<= 1'b1;
							end
						else
							begin
								hsync		<= 1'b1;
							end
							


						if ( pCounter >= lineWidth )
							begin
								pCounter <= 1;
								hCounter <= hCounter + 1'b1;
							end

						else if ( hCounter == ( lineHeight + 1 ) )
							begin
								pCounter <= 0;
								hCounter <= 1;
							end
						else
							begin
								pCounter <= pCounter + 1'b1;
								hCounter <= hCounter;
							end
						



						if ( hCounter > vDuration )
							begin
								vsync		<= 1'b0;
							end
						else
							begin
								vsync		<= 1'b1;
							end
					end
				
			vSyncState:
				begin

					vsync		<= 1'b1;
					de			<= 1'b0;
					
					


					if( pCounter == lineWidth )
						begin
							hsync 		<= 1'b1;
							hCounter 	<= hCounter + 1'b1;
							pCounter	<= 1;
						end						
					else
						begin
							hsync 		<= 1'b0;
							hCounter 	<= hCounter;
							pCounter	<= pCounter + 1'b1;
						end
						

					if ( ( pCounter == lineWidth ) && ( hCounter == vDuration ) )
						begin
							vsync	<= 1'b0;
						end
					else
						begin
							vsync	<= 1'b1;
						end
				end
				
			endBlankHSync:
				begin
					vsync		<= 1'b0;
					de			<= 1'b0;
					


						if ( ( pCounter >= hDuration ) && ( pCounter != lineWidth ) )
							begin
								hsync 		<= 1'b0;
							end
						else if ( pCounter == lineWidth )
							begin
								hsync		<= 1'b1;
							end
						else
							begin
								hsync		<= 1'b1;
							end
							


						if ( pCounter == lineWidth )
							begin
								pCounter <= 1;
								hCounter <= hCounter + 1'b1;
							end
						else
							begin
								pCounter <= pCounter + 1'b1;
								hCounter <= hCounter;
							end
				end
				
			activeVideo:
				begin
					vsync		<= 1'b0;
					


						if ( ( pCounter >= hDuration ) && ( pCounter != lineWidth ) )
							begin
								hsync 		<= 1'b0;
							end
						else if ( pCounter == lineWidth )
							begin
								hsync		<= 1'b1;
							end
						else
							begin
								hsync		<= 1'b1;
							end
							


						if ( pCounter == lineWidth )
							begin
								pCounter 	<= 1;
								hCounter 	<= hCounter + 1'b1;
							end
						else
							begin
								pCounter <= pCounter + 1'b1;
								hCounter <= hCounter;
							end
							



						if ( ( pCounter < hDelay ) || ( pCounter >= ( ( lineWidth - hPlacement ) - 1 ) ) )
							begin
								de			<= 1'b0;
							end
						else
							begin
								de			<= 1'b1;
							end			
				end
					
			startBlankFrame:
				begin

					de		<= 1'b0;


					



						if ( ( pCounter >= hDuration ) && ( pCounter != lineWidth ) )
							begin
								hsync 		<= 1'b0;
							end
						else if ( pCounter == lineWidth )
							begin
								hsync		<= 1'b1;
							end
						else
							begin
								hsync		<= 1'b1;
							end
						


					if ( ( pCounter >= lineWidth ) && ( hCounter != lineHeight ) )
						begin
							pCounter 	<= 1;
							hCounter 	<= hCounter + 1'b1;
							vsync		<= 1'b0;
						end
					else if ( ( pCounter >= lineWidth ) && ( hCounter == lineHeight ) )
						begin
							pCounter	<= 1;
							hCounter	<= 1;
							vsync		<= 1'b1;
						end
					else
						begin
							pCounter <= pCounter + 1'b1;
							hCounter <= hCounter;
							vsync		<= 1'b0;

						end	
				end
			
			endcase
		end

endmodule