data/full_repos/permissive/119107706/Xilinx Project/SourceCode/Multication/floating_point/multiplier_float_tb.v
 line:46: before: "real"
1: b'%Error: Cannot find file containing module: Project/SourceCode/Multication/floating_point,data/full_repos/permissive/119107706\n        ... Looked in:\n             data/full_repos/permissive/119107706/Xilinx/Project/SourceCode/Multication/floating_point,data/full_repos/permissive/119107706\n             data/full_repos/permissive/119107706/Xilinx/Project/SourceCode/Multication/floating_point,data/full_repos/permissive/119107706.v\n             data/full_repos/permissive/119107706/Xilinx/Project/SourceCode/Multication/floating_point,data/full_repos/permissive/119107706.sv\n             Project/SourceCode/Multication/floating_point,data/full_repos/permissive/119107706\n             Project/SourceCode/Multication/floating_point,data/full_repos/permissive/119107706.v\n             Project/SourceCode/Multication/floating_point,data/full_repos/permissive/119107706.sv\n             obj_dir/Project/SourceCode/Multication/floating_point,data/full_repos/permissive/119107706\n             obj_dir/Project/SourceCode/Multication/floating_point,data/full_repos/permissive/119107706.v\n             obj_dir/Project/SourceCode/Multication/floating_point,data/full_repos/permissive/119107706.sv\n%Error: Cannot find file containing module: data/full_repos/permissive/119107706/Xilinx\n%Error: Cannot find file containing module: Project/SourceCode/Multication/floating_point/multiplier_float_tb.v\n%Error: Exiting due to 3 error(s)\n'
module multiplier_float_tb;

	parameter WIDTH = 32;
	parameter WIDTH_exp = 8;
	parameter WIDTH_mat = 23;



	reg CLK;
	reg RST;
	reg [WIDTH-1:0] OP1;
	reg [WIDTH-1:0] OP2;
	reg exce_in;


	wire exce_out, exce_out_pipe;
	wire [WIDTH-1:0] result, result_pipe;




function real floatToReal;
	input [2047:0] in;
	input integer WE;
	input integer WM;
	integer	idx;
	integer idx2;
	real retVal;
	real exVal;
	begin
		retVal = 0;
		exVal  = 0;

		for(idx = 0; idx < WM; idx = idx + 1) begin
			if(in[idx]==1'b1) begin
				retVal = retVal + (2.0**(idx-WM));
			end
		end
		retVal = retVal + 1;

		for(idx2 = 0; idx2 < WE; idx2 = idx2 + 1) begin
			if(in[idx2+WM]==1'b1) begin
				exVal = exVal + (2.0**idx2);
			end
		end

		if (in == 0)
			floatToReal = 0;
		else if (in[WE+WM]==1'b1) 
			floatToReal = -retVal*(2.0**(exVal-((2.0**(WE-1))-1)));
		else 
			floatToReal = retVal*(2.0**(exVal-((2.0**(WE-1))-1)));
	end
endfunction




	multiplier_float 
	#(
		.WIDTH(WIDTH),	
		.WIDTH_exp(WIDTH_exp),
		.WIDTH_mat(WIDTH_mat)
		)
	Fang_floMul (
		.CLK(CLK), 
		.RST(RST), 
		.OP1(OP1), 
		.OP2(OP2), 
		.exce_in(exce_in), 
		.exce_out(exce_out), 
		.result(result)
	);


	flot_mul_pipe 
	#(
		.WIDTH(WIDTH),	
		.WIDTH_exp(WIDTH_exp),
		.WIDTH_mat(WIDTH_mat)
		)
	Fang_floMul_PIP (
		.CLK(CLK), 
		.nRST(RST), 
		.OP1(OP1), 
		.OP2(OP2), 
		.exce_in(exce_in), 
		.exce_out(exce_out_pipe), 
		.result(result_pipe)
	);




	parameter ClockPeriod = 10;
	initial 	 CLK = 1;
	always # (ClockPeriod/2) CLK = ~CLK;



	initial begin

		RST = 0; OP1 = 0; OP2 = 0; exce_in = 0; @(posedge CLK);

		RST = 1; OP1 = 32'b0_01111100_00000000000000001111000; OP2 = 32'b0_01111110_11100000000000000000000; exce_in = 0; @(posedge CLK);

		
		RST = 1; OP1 = 32'b0_01111110_11000000000000000000000; OP2 = 32'b0_01111110_11100000000000000000000; exce_in = 0; @(posedge CLK);

		
		RST = 1; OP1 = 32'b0_10000011_11000000000000000000000; OP2 = 32'b0_10000011_11000000000000000000000; exce_in = 0; @(posedge CLK);
		

		RST = 1; OP1 = 32'b0_10000111_11000000000000000000000;  OP2 = 32'b0_10000011_11000000000000000000000; exce_in = 1; @(posedge CLK);
		

		RST = 1; OP1 = 32'b1_10000111_11000000000000000000000;  OP2 = 32'b0_10000011_11000000000000000000000; exce_in = 0; @(posedge CLK);
		

		RST = 1; OP1 = 32'b0_10001111_11000000000000000000000;  OP2 = 32'b0_10001111_11000000000000000000000; exce_in = 0; @(posedge CLK);
		

		RST = 1; OP1 = 32'b1_10001111_11000000000000000000000;  OP2 = 32'b0_10011111_11000000000000000000000; exce_in = 0; @(posedge CLK);
		@(posedge CLK);

		@(posedge CLK);		@(posedge CLK);
		@(posedge CLK);		@(posedge CLK);


		$finish;

	end

      



	real real_OP1, real_OP2;
	real real_result, real_result_pipe; 




	always @ OP1 real_OP1 = floatToReal(OP1, WIDTH_exp, WIDTH_mat);  
	always @ OP2 real_OP2 = floatToReal(OP2, WIDTH_exp, WIDTH_mat);
	always @ result real_result = floatToReal(result, WIDTH_exp, WIDTH_mat);
	always @ result_pipe real_result_pipe = floatToReal(result_pipe, WIDTH_exp, WIDTH_mat);



		
endmodule
module multiplier_float_tb;


	parameter WIDTH = 32;
	parameter WIDTH_exp = 8;
	parameter WIDTH_mat = 23;



	reg CLK;
	reg RST;
	reg [WIDTH-1:0] OP1;
	reg [WIDTH-1:0] OP2;
	reg exce_in;


	wire exce_out, exce_out_pipe;
	wire [WIDTH-1:0] result, result_pipe;




function real floatToReal;
	input [2047:0] in;
	input integer WE;
	input integer WM;
	integer	idx;
	integer idx2;
	real retVal;
	real exVal;
	begin
		retVal = 0;
		exVal  = 0;

		for(idx = 0; idx < WM; idx = idx + 1) begin
			if(in[idx]==1'b1) begin
				retVal = retVal + (2.0**(idx-WM));
			end
		end
		retVal = retVal + 1;

		for(idx2 = 0; idx2 < WE; idx2 = idx2 + 1) begin
			if(in[idx2+WM]==1'b1) begin
				exVal = exVal + (2.0**idx2);
			end
		end

		if (in == 0)
			floatToReal = 0;
		else if (in[WE+WM]==1'b1) 
			floatToReal = -retVal*(2.0**(exVal-((2.0**(WE-1))-1)));
		else 
			floatToReal = retVal*(2.0**(exVal-((2.0**(WE-1))-1)));
	end
endfunction




	multiplier_float 
	#(
		.WIDTH(WIDTH),	
		.WIDTH_exp(WIDTH_exp),
		.WIDTH_mat(WIDTH_mat)
		)
	Fang_floMul (
		.CLK(CLK), 
		.RST(RST), 
		.OP1(OP1), 
		.OP2(OP2), 
		.exce_in(exce_in), 
		.exce_out(exce_out), 
		.result(result)
	);


	flot_mul_pipe 
	#(
		.WIDTH(WIDTH),	
		.WIDTH_exp(WIDTH_exp),
		.WIDTH_mat(WIDTH_mat)
		)
	Fang_floMul_PIP (
		.CLK(CLK), 
		.nRST(RST), 
		.OP1(OP1), 
		.OP2(OP2), 
		.exce_in(exce_in), 
		.exce_out(exce_out_pipe), 
		.result(result_pipe)
	);




	parameter ClockPeriod = 10;
	initial 	 CLK = 1;
	always # (ClockPeriod/2) CLK = ~CLK;



	initial begin

		RST = 0; OP1 = 0; OP2 = 0; exce_in = 0; @(posedge CLK);

		RST = 1; OP1 = 32'b0_01111100_00000000000000001111000; OP2 = 32'b0_01111110_11100000000000000000000; exce_in = 0; @(posedge CLK);

		
		RST = 1; OP1 = 32'b0_01111110_11000000000000000000000; OP2 = 32'b0_01111110_11100000000000000000000; exce_in = 0; @(posedge CLK);

		
		RST = 1; OP1 = 32'b0_10000011_11000000000000000000000; OP2 = 32'b0_10000011_11000000000000000000000; exce_in = 0; @(posedge CLK);
		

		RST = 1; OP1 = 32'b0_10000111_11000000000000000000000;  OP2 = 32'b0_10000011_11000000000000000000000; exce_in = 1; @(posedge CLK);
		

		RST = 1; OP1 = 32'b1_10000111_11000000000000000000000;  OP2 = 32'b0_10000011_11000000000000000000000; exce_in = 0; @(posedge CLK);
		

		RST = 1; OP1 = 32'b0_10001111_11000000000000000000000;  OP2 = 32'b0_10001111_11000000000000000000000; exce_in = 0; @(posedge CLK);
		

		RST = 1; OP1 = 32'b1_10001111_11000000000000000000000;  OP2 = 32'b0_10011111_11000000000000000000000; exce_in = 0; @(posedge CLK);
		@(posedge CLK);

		@(posedge CLK);		@(posedge CLK);
		@(posedge CLK);		@(posedge CLK);


		$finish;

	end

      



	real real_OP1, real_OP2;
	real real_result, real_result_pipe; 




	always @ OP1 real_OP1 = floatToReal(OP1, WIDTH_exp, WIDTH_mat);  
	always @ OP2 real_OP2 = floatToReal(OP2, WIDTH_exp, WIDTH_mat);
	always @ result real_result = floatToReal(result, WIDTH_exp, WIDTH_mat);
	always @ result_pipe real_result_pipe = floatToReal(result_pipe, WIDTH_exp, WIDTH_mat);



		
endmodule