data/full_repos/permissive/197614074/conv_main.v
1: b'%Error: data/full_repos/permissive/197614074/conv_main.v:69: Cannot find file containing module: \'maxpool\'\n  maxpool Maxpooling (.in1(PIXEL1), .in2(PIXEL2), .in3(PIXEL3), .in4(PIXEL4), .clk(clk),  .enable(maxin), .op(out2));\n  ^~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/197614074,data/full_repos/permissive/197614074/maxpool\n             data/full_repos/permissive/197614074,data/full_repos/permissive/197614074/maxpool.v\n             data/full_repos/permissive/197614074,data/full_repos/permissive/197614074/maxpool.sv\n             maxpool\n             maxpool.v\n             maxpool.sv\n             obj_dir/maxpool\n             obj_dir/maxpool.v\n             obj_dir/maxpool.sv\n%Warning-WIDTH: data/full_repos/permissive/197614074/conv_main.v:73: Operator ADD expects 32 or 16 bits on the RHS, but RHS\'s VARREF \'X_adr\' generates 8 bits.\n                                                                   : ... In instance conv_main\n   address = C_adr * HEIGHT  * WIDTH + (Y_adr) * WIDTH + (X_adr);\n                                                       ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Error: data/full_repos/permissive/197614074/conv_main.v:104: Cannot find file containing module: \'conv\'\n  conv MIX_part (\n  ^~~~\n%Error: Exiting due to 2 error(s), 1 warning(s)\n'
module conv_main#(    
    parameter  WIDTH 	= 	28,
    parameter  HEIGHT 	= 	28,
    parameter  CHANNEL 	= 	1,
	 parameter	KERNELWIDTH =3,
	 parameter	KERNELHEIGHT =3
    )(
		input																										clk,
		input 			[8 * WIDTH 		* 	HEIGHT 	* 	CHANNEL 		    - 	1 	: 0]			indata,
		input 			[8 * 	CHANNEL 	* 	KERNELWIDTH *  KERNELHEIGHT - 	1 	: 0]			filterWeight,
		output 	reg   [7  	: 	0] 																		result,
		output	reg   [7		:	0]																			res_address,
		output	reg																							dataready);

		wire	[8*KERNELWIDTH * KERNELHEIGHT -1:0] Datain;
		genvar i, j;
		reg   [2:0]    counter;
		reg	[7:0]		temp3;
		reg 	[7:0]		X_adr;
		reg	[7:0]		Y_adr;
		reg	[7:0]		C_adr;
		reg	[7:0]		PIXEL1;
		reg	[7:0]		PIXEL2;
		reg	[7:0]		PIXEL3;
		reg	[7:0]		PIXEL4;
		reg 	[15:0]	address;
		reg   [7:0]    temp2;
		wire	[7:0]		out,out2;
		wire 	[7:0]		temp;

		initial begin
			X_adr = 	0;
			Y_adr	=	0;
			C_adr	=	0;
			result=	0;
			temp2  = 0;
			counter	=	0;

		end
		reg maxin;
		generate 
			for(i=0;i<3;i=i+1)begin
				for(j=0;j<3;j=j+1)begin
					assign temp = (X_adr > 0 && Y_adr> 0 && X_adr<WIDTH+1	&&	Y_adr<HEIGHT+1)?(indata[8*(address)+:8]):(8'b00000000);
					assign Datain[(i*3+j)*8 +:8]	= temp;
				end
			end
		endgenerate
		maxpool Maxpooling (.in1(PIXEL1), .in2(PIXEL2), .in3(PIXEL3), .in4(PIXEL4), .clk(clk),  .enable(maxin), .op(out2));
		always @ (posedge clk )begin
			
			temp2		=	temp2	+	out;
			address	=	C_adr *	HEIGHT 	*	WIDTH	+	(Y_adr)	*	WIDTH	+	(X_adr);
			res_address=Y_adr	*	WIDTH	+	X_adr;
			if	(C_adr	<	CHANNEL)begin
				maxin = 0;
				temp3		= 	temp2;
				dataready 	= 0;
			end
			C_adr	=	C_adr	+	1;
			if	(C_adr 	== CHANNEL)begin
					temp2	=	0;
					res_address=Y_adr	*	WIDTH	+	X_adr;
					X_adr	=	X_adr	+	1;
					C_adr	=	0;
					counter = counter + 1;
					if(counter == 1) begin  X_adr = X_adr +1;	PIXEL1 = temp3;maxin=0;	end
					if(counter == 2) begin	X_adr = X_adr -1; Y_adr = Y_adr + 1;	PIXEL2 = temp3; end
					if(counter == 3) begin	X_adr = X_adr +1; PIXEL3 = temp3;maxin=0;	end
					if(counter == 4) begin	X_adr = X_adr +1;counter = 0;	PIXEL4 = temp3; maxin = 1 ; dataready = 1; Y_adr = Y_adr - 1; result = out2;end 
					dataready	=	1;
			end
			if (X_adr	==	WIDTH+2)begin
				X_adr = 0;
				Y_adr = Y_adr +2;
			end
			if	(Y_adr		==	HEIGHT+2)begin
				Y_adr			=	0;


			end
		end 

		conv MIX_part (
			 .ifmap(Datain), 
			 .kernel(filterWeight), 
			 .clk(clk),
			 .ofmap(out)
			 );
endmodule
module conv_main#(    
    parameter  WIDTH 	= 	28,
    parameter  HEIGHT 	= 	28,
    parameter  CHANNEL 	= 	1,
	 parameter	KERNELWIDTH =3,
	 parameter	KERNELHEIGHT =3
    )(
		input																										clk,
		input 			[8 * WIDTH 		* 	HEIGHT 	* 	CHANNEL 		    - 	1 	: 0]			indata,
		input 			[8 * 	CHANNEL 	* 	KERNELWIDTH *  KERNELHEIGHT - 	1 	: 0]			filterWeight,
		output 	reg   [7  	: 	0] 																		result,
		output	reg   [7		:	0]																			res_address,
		output	reg																							dataready);


		wire	[8*KERNELWIDTH * KERNELHEIGHT -1:0] Datain;
		genvar i, j;
		reg   [2:0]    counter;
		reg	[7:0]		temp3;
		reg 	[7:0]		X_adr;
		reg	[7:0]		Y_adr;
		reg	[7:0]		C_adr;
		reg	[7:0]		PIXEL1;
		reg	[7:0]		PIXEL2;
		reg	[7:0]		PIXEL3;
		reg	[7:0]		PIXEL4;
		reg 	[15:0]	address;
		reg   [7:0]    temp2;
		wire	[7:0]		out,out2;
		wire 	[7:0]		temp;

		initial begin
			X_adr = 	0;
			Y_adr	=	0;
			C_adr	=	0;
			result=	0;
			temp2  = 0;
			counter	=	0;

		end
		reg maxin;
		generate 
			for(i=0;i<3;i=i+1)begin
				for(j=0;j<3;j=j+1)begin
					assign temp = (X_adr > 0 && Y_adr> 0 && X_adr<WIDTH+1	&&	Y_adr<HEIGHT+1)?(indata[8*(address)+:8]):(8'b00000000);
					assign Datain[(i*3+j)*8 +:8]	= temp;
				end
			end
		endgenerate
		maxpool Maxpooling (.in1(PIXEL1), .in2(PIXEL2), .in3(PIXEL3), .in4(PIXEL4), .clk(clk),  .enable(maxin), .op(out2));
		always @ (posedge clk )begin
			
			temp2		=	temp2	+	out;
			address	=	C_adr *	HEIGHT 	*	WIDTH	+	(Y_adr)	*	WIDTH	+	(X_adr);
			res_address=Y_adr	*	WIDTH	+	X_adr;
			if	(C_adr	<	CHANNEL)begin
				maxin = 0;
				temp3		= 	temp2;
				dataready 	= 0;
			end
			C_adr	=	C_adr	+	1;
			if	(C_adr 	== CHANNEL)begin
					temp2	=	0;
					res_address=Y_adr	*	WIDTH	+	X_adr;
					X_adr	=	X_adr	+	1;
					C_adr	=	0;
					counter = counter + 1;
					if(counter == 1) begin  X_adr = X_adr +1;	PIXEL1 = temp3;maxin=0;	end
					if(counter == 2) begin	X_adr = X_adr -1; Y_adr = Y_adr + 1;	PIXEL2 = temp3; end
					if(counter == 3) begin	X_adr = X_adr +1; PIXEL3 = temp3;maxin=0;	end
					if(counter == 4) begin	X_adr = X_adr +1;counter = 0;	PIXEL4 = temp3; maxin = 1 ; dataready = 1; Y_adr = Y_adr - 1; result = out2;end 
					dataready	=	1;
			end
			if (X_adr	==	WIDTH+2)begin
				X_adr = 0;
				Y_adr = Y_adr +2;
			end
			if	(Y_adr		==	HEIGHT+2)begin
				Y_adr			=	0;


			end
		end 

		conv MIX_part (
			 .ifmap(Datain), 
			 .kernel(filterWeight), 
			 .clk(clk),
			 .ofmap(out)
			 );
endmodule