data/full_repos/permissive/105729488/state_machine_tbmod.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b'%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:94: Operator GT expects 28 bits on the RHS, but RHS\'s CONST \'3\'h6\' generates 3 bits.\n                                                                             : ... In instance state_machine\n     else if (count > 3\'b110) begin\n                    ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:89: Operator GTE expects 28 bits on the RHS, but RHS\'s CONST \'3\'h3\' generates 3 bits.\n                                                                             : ... In instance state_machine\n     if ((count >= 3\'b011) & (count <= 3\'b110) & la_rue_sensor_ff == 1\'b0) begin\n                ^~\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:89: Operator LTE expects 28 bits on the RHS, but RHS\'s CONST \'3\'h6\' generates 3 bits.\n                                                                             : ... In instance state_machine\n     if ((count >= 3\'b011) & (count <= 3\'b110) & la_rue_sensor_ff == 1\'b0) begin\n                                    ^~\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:116: Operator EQ expects 28 bits on the RHS, but RHS\'s CONST \'3\'h3\' generates 3 bits.\n                                                                              : ... In instance state_machine\n    if (count == 3\'b011) begin\n              ^~\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:145: Operator GTE expects 28 bits on the RHS, but RHS\'s CONST \'3\'h3\' generates 3 bits.\n                                                                              : ... In instance state_machine\n     if (count >= 3\'b011 & orchard_sensor_ff == 1\'b0) begin\n               ^~\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:159: Operator GT expects 28 bits on the RHS, but RHS\'s CONST \'3\'h6\' generates 3 bits.\n                                                                              : ... In instance state_machine\n     else if (count > 3\'b110) begin\n                    ^\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:153: Operator GTE expects 28 bits on the RHS, but RHS\'s CONST \'3\'h1\' generates 3 bits.\n                                                                              : ... In instance state_machine\n     if (count >= 3\'b001 & count <= 3\'b110 & orchard_sensor_ff == 1\'b0) begin  \n               ^~\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:153: Operator LTE expects 28 bits on the RHS, but RHS\'s CONST \'3\'h6\' generates 3 bits.\n                                                                              : ... In instance state_machine\n     if (count >= 3\'b001 & count <= 3\'b110 & orchard_sensor_ff == 1\'b0) begin  \n                                 ^~\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:180: Operator EQ expects 28 bits on the RHS, but RHS\'s CONST \'3\'h3\' generates 3 bits.\n                                                                              : ... In instance state_machine\n    if (count == 3\'b011) begin\n              ^~\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:208: Operator GT expects 28 bits on the RHS, but RHS\'s CONST \'3\'h6\' generates 3 bits.\n                                                                              : ... In instance state_machine\n    if (count > 3\'b110) begin\n              ^\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:233: Operator GTE expects 28 bits on the RHS, but RHS\'s CONST \'3\'h1\' generates 3 bits.\n                                                                              : ... In instance state_machine\n    if (count >= 3\'b001) begin\n              ^~\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:269: Operator GTE expects 28 bits on the RHS, but RHS\'s CONST \'3\'h1\' generates 3 bits.\n                                                                              : ... In instance state_machine\n    else if (count >= 3\'b001 & flash_count >= 3\'b101) begin\n                   ^~\n%Warning-WIDTH: data/full_repos/permissive/105729488/state_machine_tbmod.v:259: Operator GTE expects 28 bits on the RHS, but RHS\'s CONST \'3\'h1\' generates 3 bits.\n                                                                              : ... In instance state_machine\n    if (count >= 3\'b001 & flash_count < 3\'b101) begin\n              ^~\n%Error: Exiting due to 13 warning(s)\n'
module state_machine(

	clk, reset_n, la_rue_sensor, orchard_sensor, pedestrian_sensor, 
	la_rue_green, la_rue_yellow, la_rue_red, 
	orchard_green, orchard_yellow, orchard_red,
	pedestrian_walk, pedestrian_stop, count, count_c, state, state_c, x, x_c
	
);

	input reset_n;
	input clk;
	input la_rue_sensor, orchard_sensor, pedestrian_sensor;
	

	output reg la_rue_green, la_rue_yellow, la_rue_red;
	output reg orchard_green, orchard_yellow, orchard_red;
	output reg pedestrian_walk, pedestrian_stop;
	

	

	reg [2:0] flash_count, flash_count_c;
	reg pedestrian_queue, pedestrian_queue_c;
	
	reg la_rue_sensor_ff, orchard_sensor_ff, pedestrian_sensor_ff;
	reg la_rue_sensor_ff_c, orchard_sensor_ff_c, pedestrian_sensor_ff_c;
	

	output reg [2:0] state;
	output reg [2:0] state_c;
	

	output reg [27:0] count;
	output reg [27:0] count_c;
	
	output reg [27:0] x;
	output reg [27:0] x_c;
	

	parameter LA_RUE_GREEN_st = 3'b000;
	parameter LA_RUE_YELLOW_st = 3'b001;
	parameter PED_WALK_st = 3'b010;
	parameter PED_DONT_WALK_st = 3'b011;
	parameter PED_OFF_st = 3'b100;
	parameter ORCHARD_GREEN_st = 3'b101;
	parameter ORCHARD_YELLOW_st = 3'b110;
	
	always @(*) begin
		

		state_c = state;
		flash_count_c = flash_count;
		
		la_rue_sensor_ff_c = la_rue_sensor;
		orchard_sensor_ff_c = orchard_sensor;
		pedestrian_sensor_ff_c = pedestrian_sensor_ff; 
		

		count_c = count + 1;
		x_c = x + 1'b1;

		if (pedestrian_sensor == 0) begin
			pedestrian_sensor_ff_c = 1'b1;
		end

		

		case (state) 
			
			LA_RUE_GREEN_st: begin
			
				la_rue_green = 1'b1;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b0;
				
				orchard_green = 1'b0;
				orchard_yellow = 1'b0;
				orchard_red = 1'b1;
				
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b1;
			
				if (orchard_sensor_ff == 1'b1 | pedestrian_sensor_ff == 1'b1) begin
					if ((count >= 3'b011) & (count <= 3'b110) & la_rue_sensor_ff == 1'b0) begin
						state_c = LA_RUE_YELLOW_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
					else if (count > 3'b110) begin
						state_c = LA_RUE_YELLOW_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
				end
				
			end
			
			LA_RUE_YELLOW_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b1;
				la_rue_red = 1'b0;
				
				orchard_green = 1'b0;
				orchard_yellow = 1'b0;
				orchard_red = 1'b1;
				
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b1;
				
				if (count == 3'b011) begin
					if (pedestrian_sensor_ff == 1'b1) begin
						state_c = PED_WALK_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
					else if (pedestrian_sensor_ff == 1'b0 & orchard_sensor_ff == 1'b1) begin
						state_c = ORCHARD_GREEN_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
				end
				
			end
			
			ORCHARD_GREEN_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b1;
				
				orchard_green = 1'b1;
				orchard_yellow = 1'b0;
				orchard_red = 1'b0;
				
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b1;
				
				if (la_rue_sensor_ff == 1'b0 & pedestrian_sensor_ff == 1'b0) begin
					if (count >= 3'b011 & orchard_sensor_ff == 1'b0) begin
						state_c = ORCHARD_YELLOW_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
				end
				
				else if (la_rue_sensor_ff == 1'b1 | pedestrian_sensor_ff == 1'b1) begin
					if (count >= 3'b001 & count <= 3'b110 & orchard_sensor_ff == 1'b0) begin
						state_c = ORCHARD_YELLOW_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
					
					else if (count > 3'b110) begin
						state_c = ORCHARD_YELLOW_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
					
				end
				
			end
			
			ORCHARD_YELLOW_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b1;
				orchard_green = 1'b0;
				orchard_yellow = 1'b1;
				orchard_red = 1'b0;
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b1;
				
				if (count == 3'b011) begin
					
					state_c = LA_RUE_GREEN_st;
					
					if (la_rue_sensor_ff == 1'b0 & pedestrian_sensor_ff == 1'b1) begin
						state_c = PED_WALK_st;
					end
					
					count_c = 28'b0;
					x_c = 28'b0;
					
				end
			
			end
			
			PED_WALK_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b1;
				
				orchard_green = 1'b0;
				orchard_yellow = 1'b0;
				orchard_red = 1'b1;
				
				pedestrian_walk = 1'b1;
				pedestrian_stop = 1'b0;
			
				if (count > 3'b110) begin
					state_c = PED_DONT_WALK_st;
					flash_count_c = flash_count + 3'b001;
					count_c = 28'b0;
					x_c = 28'b0;
				end
			
			
			end
			
			PED_DONT_WALK_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b1;
				
				orchard_green = 1'b0;
				orchard_yellow = 1'b0;
				orchard_red = 1'b1;
				
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b1;
				
				
				
				if (count >= 3'b001) begin
					state_c = PED_OFF_st;
					flash_count_c = flash_count + 3'b001;
					count_c = 28'b0;
					x_c = 28'b0;
					
				end
				
			end
			
			PED_OFF_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b1;
				
				orchard_green = 1'b0;
				orchard_yellow = 1'b0;
				orchard_red = 1'b1;
				
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b0;
				
				


				if (count >= 3'b001 & flash_count < 3'b101) begin
					flash_count_c = flash_count + 3'b001;
					state_c = PED_DONT_WALK_st;
					count_c = 28'b0;
					x_c = 28'b0;
					
				end
				
				

				else if (count >= 3'b001 & flash_count >= 3'b101) begin
				
					if (orchard_sensor_ff == 1'b0) begin
						state_c = LA_RUE_GREEN_st;
						count_c = 28'b0;
						x_c = 28'b0;
						flash_count_c = 3'b000;
						pedestrian_sensor_ff_c = 1'b0;
					end
					else begin
						state_c = ORCHARD_GREEN_st;
						count_c = 28'b0;
						x_c = 28'b0;
						flash_count_c = 3'b000;
						pedestrian_sensor_ff_c = 1'b0;
					end
					
				end
				
			end
			
		endcase
		
		
		

		

		if (reset_n == 0) begin


			state_c = 3'b000;
			
			x_c = 28'd0;
			
			count_c = 28'd0;
			
			flash_count_c = 3'b000;
			
			orchard_sensor_ff_c = 1'b0;
			la_rue_sensor_ff_c = 1'b0;
			
			pedestrian_sensor_ff_c = 1'b0;
			
		end
		
	end
	

	always @( clk) begin

		state <= #1 state_c;
		count <= #1 count_c;
		x <= #1 x_c;
		flash_count <= #1 flash_count_c;
		
		orchard_sensor_ff <= #1 orchard_sensor_ff_c;
		la_rue_sensor_ff <= #1 la_rue_sensor_ff_c;
		pedestrian_sensor_ff <= #1 pedestrian_sensor_ff_c;
		
	end
	
	
endmodule
module state_machine(

	clk, reset_n, la_rue_sensor, orchard_sensor, pedestrian_sensor, 
	la_rue_green, la_rue_yellow, la_rue_red, 
	orchard_green, orchard_yellow, orchard_red,
	pedestrian_walk, pedestrian_stop, count, count_c, state, state_c, x, x_c
	
);


	input reset_n;
	input clk;
	input la_rue_sensor, orchard_sensor, pedestrian_sensor;
	

	output reg la_rue_green, la_rue_yellow, la_rue_red;
	output reg orchard_green, orchard_yellow, orchard_red;
	output reg pedestrian_walk, pedestrian_stop;
	

	

	reg [2:0] flash_count, flash_count_c;
	reg pedestrian_queue, pedestrian_queue_c;
	
	reg la_rue_sensor_ff, orchard_sensor_ff, pedestrian_sensor_ff;
	reg la_rue_sensor_ff_c, orchard_sensor_ff_c, pedestrian_sensor_ff_c;
	

	output reg [2:0] state;
	output reg [2:0] state_c;
	

	output reg [27:0] count;
	output reg [27:0] count_c;
	
	output reg [27:0] x;
	output reg [27:0] x_c;
	

	parameter LA_RUE_GREEN_st = 3'b000;
	parameter LA_RUE_YELLOW_st = 3'b001;
	parameter PED_WALK_st = 3'b010;
	parameter PED_DONT_WALK_st = 3'b011;
	parameter PED_OFF_st = 3'b100;
	parameter ORCHARD_GREEN_st = 3'b101;
	parameter ORCHARD_YELLOW_st = 3'b110;
	
	always @(*) begin
		

		state_c = state;
		flash_count_c = flash_count;
		
		la_rue_sensor_ff_c = la_rue_sensor;
		orchard_sensor_ff_c = orchard_sensor;
		pedestrian_sensor_ff_c = pedestrian_sensor_ff; 
		

		count_c = count + 1;
		x_c = x + 1'b1;

		if (pedestrian_sensor == 0) begin
			pedestrian_sensor_ff_c = 1'b1;
		end

		

		case (state) 
			
			LA_RUE_GREEN_st: begin
			
				la_rue_green = 1'b1;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b0;
				
				orchard_green = 1'b0;
				orchard_yellow = 1'b0;
				orchard_red = 1'b1;
				
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b1;
			
				if (orchard_sensor_ff == 1'b1 | pedestrian_sensor_ff == 1'b1) begin
					if ((count >= 3'b011) & (count <= 3'b110) & la_rue_sensor_ff == 1'b0) begin
						state_c = LA_RUE_YELLOW_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
					else if (count > 3'b110) begin
						state_c = LA_RUE_YELLOW_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
				end
				
			end
			
			LA_RUE_YELLOW_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b1;
				la_rue_red = 1'b0;
				
				orchard_green = 1'b0;
				orchard_yellow = 1'b0;
				orchard_red = 1'b1;
				
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b1;
				
				if (count == 3'b011) begin
					if (pedestrian_sensor_ff == 1'b1) begin
						state_c = PED_WALK_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
					else if (pedestrian_sensor_ff == 1'b0 & orchard_sensor_ff == 1'b1) begin
						state_c = ORCHARD_GREEN_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
				end
				
			end
			
			ORCHARD_GREEN_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b1;
				
				orchard_green = 1'b1;
				orchard_yellow = 1'b0;
				orchard_red = 1'b0;
				
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b1;
				
				if (la_rue_sensor_ff == 1'b0 & pedestrian_sensor_ff == 1'b0) begin
					if (count >= 3'b011 & orchard_sensor_ff == 1'b0) begin
						state_c = ORCHARD_YELLOW_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
				end
				
				else if (la_rue_sensor_ff == 1'b1 | pedestrian_sensor_ff == 1'b1) begin
					if (count >= 3'b001 & count <= 3'b110 & orchard_sensor_ff == 1'b0) begin
						state_c = ORCHARD_YELLOW_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
					
					else if (count > 3'b110) begin
						state_c = ORCHARD_YELLOW_st;
						count_c = 28'b0;
						x_c = 28'b0;
					end
					
				end
				
			end
			
			ORCHARD_YELLOW_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b1;
				orchard_green = 1'b0;
				orchard_yellow = 1'b1;
				orchard_red = 1'b0;
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b1;
				
				if (count == 3'b011) begin
					
					state_c = LA_RUE_GREEN_st;
					
					if (la_rue_sensor_ff == 1'b0 & pedestrian_sensor_ff == 1'b1) begin
						state_c = PED_WALK_st;
					end
					
					count_c = 28'b0;
					x_c = 28'b0;
					
				end
			
			end
			
			PED_WALK_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b1;
				
				orchard_green = 1'b0;
				orchard_yellow = 1'b0;
				orchard_red = 1'b1;
				
				pedestrian_walk = 1'b1;
				pedestrian_stop = 1'b0;
			
				if (count > 3'b110) begin
					state_c = PED_DONT_WALK_st;
					flash_count_c = flash_count + 3'b001;
					count_c = 28'b0;
					x_c = 28'b0;
				end
			
			
			end
			
			PED_DONT_WALK_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b1;
				
				orchard_green = 1'b0;
				orchard_yellow = 1'b0;
				orchard_red = 1'b1;
				
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b1;
				
				
				
				if (count >= 3'b001) begin
					state_c = PED_OFF_st;
					flash_count_c = flash_count + 3'b001;
					count_c = 28'b0;
					x_c = 28'b0;
					
				end
				
			end
			
			PED_OFF_st: begin
			
				la_rue_green = 1'b0;
				la_rue_yellow = 1'b0;
				la_rue_red = 1'b1;
				
				orchard_green = 1'b0;
				orchard_yellow = 1'b0;
				orchard_red = 1'b1;
				
				pedestrian_walk = 1'b0;
				pedestrian_stop = 1'b0;
				
				


				if (count >= 3'b001 & flash_count < 3'b101) begin
					flash_count_c = flash_count + 3'b001;
					state_c = PED_DONT_WALK_st;
					count_c = 28'b0;
					x_c = 28'b0;
					
				end
				
				

				else if (count >= 3'b001 & flash_count >= 3'b101) begin
				
					if (orchard_sensor_ff == 1'b0) begin
						state_c = LA_RUE_GREEN_st;
						count_c = 28'b0;
						x_c = 28'b0;
						flash_count_c = 3'b000;
						pedestrian_sensor_ff_c = 1'b0;
					end
					else begin
						state_c = ORCHARD_GREEN_st;
						count_c = 28'b0;
						x_c = 28'b0;
						flash_count_c = 3'b000;
						pedestrian_sensor_ff_c = 1'b0;
					end
					
				end
				
			end
			
		endcase
		
		
		

		

		if (reset_n == 0) begin


			state_c = 3'b000;
			
			x_c = 28'd0;
			
			count_c = 28'd0;
			
			flash_count_c = 3'b000;
			
			orchard_sensor_ff_c = 1'b0;
			la_rue_sensor_ff_c = 1'b0;
			
			pedestrian_sensor_ff_c = 1'b0;
			
		end
		
	end
	

	always @( clk) begin

		state <= #1 state_c;
		count <= #1 count_c;
		x <= #1 x_c;
		flash_count <= #1 flash_count_c;
		
		orchard_sensor_ff <= #1 orchard_sensor_ff_c;
		la_rue_sensor_ff <= #1 la_rue_sensor_ff_c;
		pedestrian_sensor_ff <= #1 pedestrian_sensor_ff_c;
		
	end
	
	
endmodule