data/full_repos/permissive/161263445/Adventure_Game.v
1: b"%Error: data/full_repos/permissive/161263445/Adventure_Game.v:26: Cannot find file containing module: 'Sword_FSM'\nSword_FSM sfsm(.clk(clk), .in(current), .state(sword));\n^~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/161263445,data/full_repos/permissive/161263445/Sword_FSM\n             data/full_repos/permissive/161263445,data/full_repos/permissive/161263445/Sword_FSM.v\n             data/full_repos/permissive/161263445,data/full_repos/permissive/161263445/Sword_FSM.sv\n             Sword_FSM\n             Sword_FSM.v\n             Sword_FSM.sv\n             obj_dir/Sword_FSM\n             obj_dir/Sword_FSM.v\n             obj_dir/Sword_FSM.sv\n%Error: Exiting due to 1 error(s)\n"
module Adventure_Game(
	next,
	N, S, E, W, clk,
	WIN, DIE
);


input N, S, E, W, clk;
output WIN, DIE;
output reg [2:0] next;


reg [2:0] current;
wire sword;
reg win;
 
initial begin
	current <= 3'b000;
	next <= 3'b000;
end
	
Sword_FSM sfsm(.clk(clk), .in(current), .state(sword));
 
always @ (posedge clk) begin
 

	if (current == 3'b000)
		next <= 3'b001;
		if (S == 1)
			next <= 3'b001;
	

	if (current == 3'b001)
		if (S == 1)
			next <= 3'b010;
		else if (W == 1)
			next <= 3'b000;
	

	if (current == 3'b010)
		if (N == 1)
			next <= 3'b001;
		else if (W == 1)
			next <= 3'b011;
		else if (E == 1)
			next <= 3'b100;
	

	if (current == 3'b011)
		if (E == 1)
	

	if (current == 3'b100) 
		if (W == 1)
			next <= 3'b011;
		else if (E == 1 && sword == 1)
			next <= 3'b101;
		else if (E == 1 && sword == 0)
			next <= 3'b110;
		
	if (current == 3'b101) 
		win <= 1;
	if (current == 3'b110) 
		win <= 0;
 
	
	
end
 
always @ (negedge clk)
	current <= next;
	
	
endmodule
module Adventure_Game(
	next,
	N, S, E, W, clk,
	WIN, DIE
);



input N, S, E, W, clk;
output WIN, DIE;
output reg [2:0] next;


reg [2:0] current;
wire sword;
reg win;
 
initial begin
	current <= 3'b000;
	next <= 3'b000;
end
	
Sword_FSM sfsm(.clk(clk), .in(current), .state(sword));
 
always @ (posedge clk) begin
 

	if (current == 3'b000)
		next <= 3'b001;
		if (S == 1)
			next <= 3'b001;
	

	if (current == 3'b001)
		if (S == 1)
			next <= 3'b010;
		else if (W == 1)
			next <= 3'b000;
	

	if (current == 3'b010)
		if (N == 1)
			next <= 3'b001;
		else if (W == 1)
			next <= 3'b011;
		else if (E == 1)
			next <= 3'b100;
	

	if (current == 3'b011)
		if (E == 1)
	

	if (current == 3'b100) 
		if (W == 1)
			next <= 3'b011;
		else if (E == 1 && sword == 1)
			next <= 3'b101;
		else if (E == 1 && sword == 0)
			next <= 3'b110;
		
	if (current == 3'b101) 
		win <= 1;
	if (current == 3'b110) 
		win <= 0;
 
	
	
end
 
always @ (negedge clk)
	current <= next;
	
	
endmodule