data/full_repos/permissive/207890020/Compare.v
 line:248: before: "("
1: b'%Error: data/full_repos/permissive/207890020/Compare.v:14: Cannot find include file: Compare10.vh\n`include "Compare10.vh" \n         ^~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/207890020,data/full_repos/permissive/207890020/Compare10.vh\n             data/full_repos/permissive/207890020,data/full_repos/permissive/207890020/Compare10.vh.v\n             data/full_repos/permissive/207890020,data/full_repos/permissive/207890020/Compare10.vh.sv\n             Compare10.vh\n             Compare10.vh.v\n             Compare10.vh.sv\n             obj_dir/Compare10.vh\n             obj_dir/Compare10.vh.v\n             obj_dir/Compare10.vh.sv\n%Error: data/full_repos/permissive/207890020/Compare.v:258: Define or directive not defined: \'`CMP10_ULT\'\n   `CMP10_ULT,`CMP10_SLT: a_o =  lt;\n   ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:258: syntax error, unexpected \',\', expecting endcase\n   `CMP10_ULT,`CMP10_SLT: a_o =  lt;\n             ^\n%Error: data/full_repos/permissive/207890020/Compare.v:258: Define or directive not defined: \'`CMP10_SLT\'\n   `CMP10_ULT,`CMP10_SLT: a_o =  lt;\n              ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:259: Define or directive not defined: \'`CMP10_ULE\'\n   `CMP10_ULE,`CMP10_SLE: a_o = ~gt;\n   ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:259: Define or directive not defined: \'`CMP10_SLE\'\n   `CMP10_ULE,`CMP10_SLE: a_o = ~gt;\n              ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:260: Define or directive not defined: \'`CMP10_EQU\'\n   `CMP10_EQU:     a_o =  eq;\n   ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:293: Define or directive not defined: \'`CMP10_ULT\'\n   `CMP10_ULT, `CMP10_ULE, `CMP10_SLT, `CMP10_SLE: begin\n   ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:293: syntax error, unexpected \',\', expecting endcase\n   `CMP10_ULT, `CMP10_ULE, `CMP10_SLT, `CMP10_SLE: begin\n             ^\n%Error: data/full_repos/permissive/207890020/Compare.v:293: Define or directive not defined: \'`CMP10_ULE\'\n   `CMP10_ULT, `CMP10_ULE, `CMP10_SLT, `CMP10_SLE: begin\n               ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:293: Define or directive not defined: \'`CMP10_SLT\'\n   `CMP10_ULT, `CMP10_ULE, `CMP10_SLT, `CMP10_SLE: begin\n                           ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:293: Define or directive not defined: \'`CMP10_SLE\'\n   `CMP10_ULT, `CMP10_ULE, `CMP10_SLT, `CMP10_SLE: begin\n                                       ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:298: Define or directive not defined: \'`CMP10_EQU\'\n   `CMP10_EQU: begin\n   ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:298: syntax error, unexpected begin, expecting IDENTIFIER or PACKAGE-IDENTIFIER or TYPE-IDENTIFIER or new\n   `CMP10_EQU: begin\n               ^~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:303: syntax error, unexpected default\n   default: begin\n   ^~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:307: syntax error, unexpected end\n   end\n   ^~~\n%Error: data/full_repos/permissive/207890020/Compare.v:324: Define or directive not defined: \'`CMP10_ULT\'\n   `CMP10_ULT, `CMP10_ULE: begin\n   ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:324: syntax error, unexpected \',\', expecting endcase\n   `CMP10_ULT, `CMP10_ULE: begin\n             ^\n%Error: data/full_repos/permissive/207890020/Compare.v:324: Define or directive not defined: \'`CMP10_ULE\'\n   `CMP10_ULT, `CMP10_ULE: begin\n               ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:329: Define or directive not defined: \'`CMP10_SLT\'\n   `CMP10_SLT, `CMP10_SLE: begin\n   ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:329: syntax error, unexpected \',\'\n   `CMP10_SLT, `CMP10_SLE: begin\n             ^\n%Error: data/full_repos/permissive/207890020/Compare.v:329: Define or directive not defined: \'`CMP10_SLE\'\n   `CMP10_SLT, `CMP10_SLE: begin\n               ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:333: syntax error, unexpected end\n   end\n   ^~~\n%Error: data/full_repos/permissive/207890020/Compare.v:334: Define or directive not defined: \'`CMP10_EQU\'\n   `CMP10_EQU: begin\n   ^~~~~~~~~~\n%Error: data/full_repos/permissive/207890020/Compare.v:338: syntax error, unexpected end\n   end\n   ^~~\n%Error: data/full_repos/permissive/207890020/Compare.v:345: syntax error, unexpected end\n   end\n   ^~~\n%Error: Cannot continue\n'
module Compare10(
	input	[3:0]	fcn,
	input	[N:0]	a,
	input	[N:0]	b,
	output		o
);
	parameter		W = 32;
	localparam		N = W-1;




	localparam	X = W/2+1;
	wire	[X:0]	sum;


	reg	[X:0]	cmp_a, cmp_b;
	genvar		i;


	always @(*) begin
		CMP_Lower(fcn[2:0], a[0], b[0], cmp_a[0], cmp_b[0]);
	end


	generate
		for (i = 2; i <= N; i = i+2) begin : cmp_gen
			always @(*) begin
				CMP_Middle(fcn[2:0], a[i:i-1], b[i:i-1], cmp_a[i/2], cmp_b[i/2]);
			end
		end : cmp_gen
	endgenerate


	always @(*) begin
		CMP_Upper(fcn[2:0], a[N], b[N], cmp_a[W/2], cmp_b[W/2]);
	end


	always @(*) begin
		cmp_a[X] = fcn[3];
		cmp_b[X] = 1'b0;
	end


	assign sum = cmp_a + cmp_b;


	assign o = sum[X];



	task CMP_Lower;
		input	[2:0]	fcn;
		input	[0:0]	a_i;
		input	[0:0]	b_i;
		output[0:0]	a_o;
		output[0:0]	b_o;
	begin : cmp_lower

		reg lt, gt, eq;

		lt = (~a_i & b_i);
		gt = (a_i & ~b_i);
		eq = (~lt & ~gt);




		case (fcn)
			`CMP10_ULT,`CMP10_SLT:	a_o =  lt;
			`CMP10_ULE,`CMP10_SLE:	a_o = ~gt;
			`CMP10_EQU:					a_o =  eq;

			default:						a_o = 1'bX;
		endcase


		b_o = a_o;

	end : cmp_lower

	endtask



	task CMP_Middle;
		input	[2:0]	fcn;
		input	[1:0]	a_i;
		input	[1:0]	b_i;
		output[0:0]	a_o;
		output[0:0]	b_o;
	begin : cmp_middle

		reg lt0, gt0, lt1, gt1;

		lt0 = (~a_i[0] &  b_i[0]);
		gt0 = ( a_i[0] & ~b_i[0]);
		lt1 = (~a_i[1] &  b_i[1]);
		gt1 = ( a_i[1] & ~b_i[1]);




		case (fcn)
			`CMP10_ULT, `CMP10_ULE, `CMP10_SLT, `CMP10_SLE: begin

				a_o = lt1 ? 1'b1 : gt1 ? 1'b0 : lt0 ? 1'b1 : gt0 ? 1'b0 : 1'b1;
				b_o = lt1 ? 1'b1 : gt1 ? 1'b0 : lt0 ? 1'b1 : gt0 ? 1'b0 : 1'b0;
			end
			`CMP10_EQU: begin

				a_o = ~lt1 & ~gt1 & ~lt0 & ~gt0;
				b_o = 1'b0;
			end
			default: begin

				a_o = 1'bX;
				b_o = 1'bX;
			end
		endcase
	end : cmp_middle

	endtask



	task CMP_Upper;
		input	[2:0]	fcn;
		input	[0:0]	a_i;
		input	[0:0]	b_i;
		output[0:0]	a_o;
		output[0:0]	b_o;
	begin

		case (fcn)
			`CMP10_ULT, `CMP10_ULE: begin

				a_o = (~a_i & b_i) ? 1'b1 : (a_i & ~b_i) ? 1'b0 : 1'b1;
				b_o = (~a_i & b_i) ? 1'b1 : (a_i & ~b_i) ? 1'b0 : 1'b0;
			end
			`CMP10_SLT, `CMP10_SLE: begin

				a_o = (~a_i & b_i) ? 1'b0 : (a_i & ~b_i) ? 1'b1 : 1'b0;
				b_o = (~a_i & b_i) ? 1'b0 : (a_i & ~b_i) ? 1'b1 : 1'b1;
			end
			`CMP10_EQU: begin

				a_o = (~a_i & b_i) ? 1'b0 : (a_i & ~b_i) ? 1'b0 : 1'b1;
				b_o = 1'b0;
			end
			default:	begin

				$stop;

				a_o = 1'bX;
				b_o = 1'bX;
			end
		endcase
	end

	endtask

endmodule
module Compare10(
	input	[3:0]	fcn,
	input	[N:0]	a,
	input	[N:0]	b,
	output		o
);

	parameter		W = 32;
	localparam		N = W-1;




	localparam	X = W/2+1;
	wire	[X:0]	sum;


	reg	[X:0]	cmp_a, cmp_b;
	genvar		i;


	always @(*) begin
		CMP_Lower(fcn[2:0], a[0], b[0], cmp_a[0], cmp_b[0]);
	end


	generate
		for (i = 2; i <= N; i = i+2) begin : cmp_gen
			always @(*) begin
				CMP_Middle(fcn[2:0], a[i:i-1], b[i:i-1], cmp_a[i/2], cmp_b[i/2]);
			end
		end : cmp_gen
	endgenerate


	always @(*) begin
		CMP_Upper(fcn[2:0], a[N], b[N], cmp_a[W/2], cmp_b[W/2]);
	end


	always @(*) begin
		cmp_a[X] = fcn[3];
		cmp_b[X] = 1'b0;
	end


	assign sum = cmp_a + cmp_b;


	assign o = sum[X];



	task CMP_Lower;
		input	[2:0]	fcn;
		input	[0:0]	a_i;
		input	[0:0]	b_i;
		output[0:0]	a_o;
		output[0:0]	b_o;
	begin : cmp_lower

		reg lt, gt, eq;

		lt = (~a_i & b_i);
		gt = (a_i & ~b_i);
		eq = (~lt & ~gt);




		case (fcn)
			`CMP10_ULT,`CMP10_SLT:	a_o =  lt;
			`CMP10_ULE,`CMP10_SLE:	a_o = ~gt;
			`CMP10_EQU:					a_o =  eq;

			default:						a_o = 1'bX;
		endcase


		b_o = a_o;

	end : cmp_lower

	endtask



	task CMP_Middle;
		input	[2:0]	fcn;
		input	[1:0]	a_i;
		input	[1:0]	b_i;
		output[0:0]	a_o;
		output[0:0]	b_o;
	begin : cmp_middle

		reg lt0, gt0, lt1, gt1;

		lt0 = (~a_i[0] &  b_i[0]);
		gt0 = ( a_i[0] & ~b_i[0]);
		lt1 = (~a_i[1] &  b_i[1]);
		gt1 = ( a_i[1] & ~b_i[1]);




		case (fcn)
			`CMP10_ULT, `CMP10_ULE, `CMP10_SLT, `CMP10_SLE: begin

				a_o = lt1 ? 1'b1 : gt1 ? 1'b0 : lt0 ? 1'b1 : gt0 ? 1'b0 : 1'b1;
				b_o = lt1 ? 1'b1 : gt1 ? 1'b0 : lt0 ? 1'b1 : gt0 ? 1'b0 : 1'b0;
			end
			`CMP10_EQU: begin

				a_o = ~lt1 & ~gt1 & ~lt0 & ~gt0;
				b_o = 1'b0;
			end
			default: begin

				a_o = 1'bX;
				b_o = 1'bX;
			end
		endcase
	end : cmp_middle

	endtask



	task CMP_Upper;
		input	[2:0]	fcn;
		input	[0:0]	a_i;
		input	[0:0]	b_i;
		output[0:0]	a_o;
		output[0:0]	b_o;
	begin

		case (fcn)
			`CMP10_ULT, `CMP10_ULE: begin

				a_o = (~a_i & b_i) ? 1'b1 : (a_i & ~b_i) ? 1'b0 : 1'b1;
				b_o = (~a_i & b_i) ? 1'b1 : (a_i & ~b_i) ? 1'b0 : 1'b0;
			end
			`CMP10_SLT, `CMP10_SLE: begin

				a_o = (~a_i & b_i) ? 1'b0 : (a_i & ~b_i) ? 1'b1 : 1'b0;
				b_o = (~a_i & b_i) ? 1'b0 : (a_i & ~b_i) ? 1'b1 : 1'b1;
			end
			`CMP10_EQU: begin

				a_o = (~a_i & b_i) ? 1'b0 : (a_i & ~b_i) ? 1'b0 : 1'b1;
				b_o = 1'b0;
			end
			default:	begin

				$stop;

				a_o = 1'bX;
				b_o = 1'bX;
			end
		endcase
	end

	endtask

endmodule