data/full_repos/permissive/113002755/verilog/RNG/asteroid_placer.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b"%Error: data/full_repos/permissive/113002755/verilog/RNG/asteroid_placer.v:26: Cannot find file containing module: 'rng'\nrng R1(random1, iClk, iRst);\n^~~\n        ... Looked in:\n             data/full_repos/permissive/113002755/verilog/RNG,data/full_repos/permissive/113002755/rng\n             data/full_repos/permissive/113002755/verilog/RNG,data/full_repos/permissive/113002755/rng.v\n             data/full_repos/permissive/113002755/verilog/RNG,data/full_repos/permissive/113002755/rng.sv\n             rng\n             rng.v\n             rng.sv\n             obj_dir/rng\n             obj_dir/rng.v\n             obj_dir/rng.sv\n%Error: data/full_repos/permissive/113002755/verilog/RNG/asteroid_placer.v:27: Cannot find file containing module: 'rng'\nrng R2(random2, iClk, iRst);\n^~~\n%Error: data/full_repos/permissive/113002755/verilog/RNG/asteroid_placer.v:28: Cannot find file containing module: 'rng'\nrng R3(random3, iClk, iRst);\n^~~\n%Error: Exiting due to 3 error(s)\n"
module asteroid_placer(
		iClk,
		iRst,
		oDir,
		oPosX,
		oPosY,
		oSize
);


rng R1(random1, iClk, iRst);
rng R2(random2, iClk, iRst);
rng R3(random3, iClk, iRst);


input iClk;
input iRst;


output [2:0] 	oDir;
output [10:0] 	oPosX;
output [10:0] 	oPosY;
output [1:0]	oSize;


reg [10:0] oPosX;
reg [10:0] oPosY;


wire 	[2:0] random1;
wire 	[2:0] random2;
wire	[2:0]	random3;
wire	[1:0]	oSize;


wire [2:0] dir_sel;
assign dir_sel[2] = random1[2];
assign dir_sel[1] = random1[1];
assign dir_sel[0] = random2[0];


assign oSize = random3[1:0];


wire [2:0] position;
assign position[2] = random2[2];
assign position[1] = random2[1];
assign position[0] = random2[0];


wire [1:0] offset_sel;
assign offset_sel[1] = random2[2];
assign offset_sel[0] = random2[1];


reg [2:0] direction;
assign oDir = direction;


reg [10:0] pos_X;
reg [10:0] pos_Y;

reg [10:0] offset_X;
reg [10:0] offset_Y;

reg [10:0] total_X;
reg [10:0] total_Y;


always@(negedge iClk)
begin
	oPosX = total_X;
	oPosY = total_Y;
end


always @(negedge iClk or negedge iRst)
begin

	case (dir_sel)
					3'b000 :  direction = 3'h5;
					3'b001 :  direction = 3'h3;
					3'b010 :  direction = 3'h3;
					3'b011 :  direction = 3'h1;
					3'b100 :  direction = 3'h1;
					3'b101 :  direction = 3'h7;
					3'b110 :  direction = 3'h7;
					3'b111 :  direction = 3'h5;				
				endcase
				

	case (position)
					3'b000 :  pos_X = 175;
					3'b001 :  pos_X = 515;
					3'b010 :  pos_X = 640;
					3'b011 :  pos_X = 640;
					3'b100 :  pos_X = 475;
					3'b101 :  pos_X = 195;
					3'b110 :  pos_X = 0;
					3'b111 :  pos_X = 0;				
				endcase			
				

	case (position)
					3'b000 :  pos_Y = 0;
					3'b001 :  pos_Y = 0;
					3'b010 :  pos_Y = 115;
					3'b011 :  pos_Y = 375;
					3'b100 :  pos_Y = 480;
					3'b101 :  pos_Y = 480;
					3'b110 :  pos_Y = 355;
					3'b111 :  pos_Y = 125;				
				endcase	
	

	case (offset_sel[0])
					0 :	offset_X = 40;
					1 :	offset_X = 80;
				endcase
			

	case (offset_sel[0])
					0 :	offset_Y = 30;
					1 :	offset_Y = 60;
				endcase


	case (position)
					3'b000 : total_X <= (offset_sel[1] == 0)?pos_X - offset_X:pos_X + offset_X;
					3'b001 : total_X <= (offset_sel[1] == 0)?pos_X - offset_X:pos_X + offset_X;
					3'b010 : total_X <= pos_X;
					3'b011 : total_X <= pos_X;
					3'b100 : total_X <= (offset_sel[1] == 0)?pos_X - offset_X:pos_X + offset_X;
					3'b101 : total_X <= (offset_sel[1] == 0)?pos_X - offset_X:pos_X + offset_X;
					3'b110 : total_X <= pos_X;
					3'b111 : total_X <= pos_X;
				endcase
				

	case (position)
					3'b000 : total_Y <= pos_Y;
					3'b001 : total_Y <= pos_Y;
					3'b010 : total_Y <= (offset_sel[1] == 0)?pos_Y - offset_Y:pos_Y + offset_Y;
					3'b011 : total_Y <= (offset_sel[1] == 0)?pos_Y - offset_Y:pos_Y + offset_Y;
					3'b100 : total_Y <= pos_Y;
					3'b101 : total_Y <= pos_Y;
					3'b110 : total_Y <= (offset_sel[1] == 0)?pos_Y - offset_Y:pos_Y + offset_Y;
					3'b111 : total_Y <= (offset_sel[1] == 0)?pos_Y - offset_Y:pos_Y + offset_Y;
				endcase
end

endmodule
module asteroid_placer(
		iClk,
		iRst,
		oDir,
		oPosX,
		oPosY,
		oSize
);



rng R1(random1, iClk, iRst);
rng R2(random2, iClk, iRst);
rng R3(random3, iClk, iRst);


input iClk;
input iRst;


output [2:0] 	oDir;
output [10:0] 	oPosX;
output [10:0] 	oPosY;
output [1:0]	oSize;


reg [10:0] oPosX;
reg [10:0] oPosY;


wire 	[2:0] random1;
wire 	[2:0] random2;
wire	[2:0]	random3;
wire	[1:0]	oSize;


wire [2:0] dir_sel;
assign dir_sel[2] = random1[2];
assign dir_sel[1] = random1[1];
assign dir_sel[0] = random2[0];


assign oSize = random3[1:0];


wire [2:0] position;
assign position[2] = random2[2];
assign position[1] = random2[1];
assign position[0] = random2[0];


wire [1:0] offset_sel;
assign offset_sel[1] = random2[2];
assign offset_sel[0] = random2[1];


reg [2:0] direction;
assign oDir = direction;


reg [10:0] pos_X;
reg [10:0] pos_Y;

reg [10:0] offset_X;
reg [10:0] offset_Y;

reg [10:0] total_X;
reg [10:0] total_Y;


always@(negedge iClk)
begin
	oPosX = total_X;
	oPosY = total_Y;
end


always @(negedge iClk or negedge iRst)
begin

	case (dir_sel)
					3'b000 :  direction = 3'h5;
					3'b001 :  direction = 3'h3;
					3'b010 :  direction = 3'h3;
					3'b011 :  direction = 3'h1;
					3'b100 :  direction = 3'h1;
					3'b101 :  direction = 3'h7;
					3'b110 :  direction = 3'h7;
					3'b111 :  direction = 3'h5;				
				endcase
				

	case (position)
					3'b000 :  pos_X = 175;
					3'b001 :  pos_X = 515;
					3'b010 :  pos_X = 640;
					3'b011 :  pos_X = 640;
					3'b100 :  pos_X = 475;
					3'b101 :  pos_X = 195;
					3'b110 :  pos_X = 0;
					3'b111 :  pos_X = 0;				
				endcase			
				

	case (position)
					3'b000 :  pos_Y = 0;
					3'b001 :  pos_Y = 0;
					3'b010 :  pos_Y = 115;
					3'b011 :  pos_Y = 375;
					3'b100 :  pos_Y = 480;
					3'b101 :  pos_Y = 480;
					3'b110 :  pos_Y = 355;
					3'b111 :  pos_Y = 125;				
				endcase	
	

	case (offset_sel[0])
					0 :	offset_X = 40;
					1 :	offset_X = 80;
				endcase
			

	case (offset_sel[0])
					0 :	offset_Y = 30;
					1 :	offset_Y = 60;
				endcase


	case (position)
					3'b000 : total_X <= (offset_sel[1] == 0)?pos_X - offset_X:pos_X + offset_X;
					3'b001 : total_X <= (offset_sel[1] == 0)?pos_X - offset_X:pos_X + offset_X;
					3'b010 : total_X <= pos_X;
					3'b011 : total_X <= pos_X;
					3'b100 : total_X <= (offset_sel[1] == 0)?pos_X - offset_X:pos_X + offset_X;
					3'b101 : total_X <= (offset_sel[1] == 0)?pos_X - offset_X:pos_X + offset_X;
					3'b110 : total_X <= pos_X;
					3'b111 : total_X <= pos_X;
				endcase
				

	case (position)
					3'b000 : total_Y <= pos_Y;
					3'b001 : total_Y <= pos_Y;
					3'b010 : total_Y <= (offset_sel[1] == 0)?pos_Y - offset_Y:pos_Y + offset_Y;
					3'b011 : total_Y <= (offset_sel[1] == 0)?pos_Y - offset_Y:pos_Y + offset_Y;
					3'b100 : total_Y <= pos_Y;
					3'b101 : total_Y <= pos_Y;
					3'b110 : total_Y <= (offset_sel[1] == 0)?pos_Y - offset_Y:pos_Y + offset_Y;
					3'b111 : total_Y <= (offset_sel[1] == 0)?pos_Y - offset_Y:pos_Y + offset_Y;
				endcase
end

endmodule