data/full_repos/permissive/530013823/LuanVan-20210617T090538Z-001/LuanVan/rtl/rsinv_test/lib/atvn/lib_v/ram/xil_bram_sel_nprm.vh
1: b'%Error: data/full_repos/permissive/530013823/LuanVan-20210617T090538Z-001/LuanVan/rtl/rsinv_test/lib/atvn/lib_v/ram/xil_bram_sel_nprm.vh:67: Can\'t find definition of variable: \'ADR\'\nlocalparam  DEPADR  = 1<<ADR;\n                         ^~~\n%Error: data/full_repos/permissive/530013823/LuanVan-20210617T090538Z-001/LuanVan/rtl/rsinv_test/lib/atvn/lib_v/ram/xil_bram_sel_nprm.vh:69: Can\'t find definition of variable: \'DEP\'\n                                                                                                                                           : ... Suggested alternative: \'IDEP\'\nlocalparam  IDEP = (DEP < DEPADR)   ? DEP : DEPADR;\n                    ^~~\n%Error: data/full_repos/permissive/530013823/LuanVan-20210617T090538Z-001/LuanVan/rtl/rsinv_test/lib/atvn/lib_v/ram/xil_bram_sel_nprm.vh:70: Can\'t find definition of variable: \'DAT\'\n                                                                                                                                           : ... Suggested alternative: \'IDAT\'\nlocalparam IMAXDEP = get_maxdepth(DAT,IDEP);\n                                  ^~~\n%Error: data/full_repos/permissive/530013823/LuanVan-20210617T090538Z-001/LuanVan/rtl/rsinv_test/lib/atvn/lib_v/ram/xil_bram_sel_nprm.vh:93: Can\'t find definition of variable: \'DIS_SMALL_RAM2MLAB\'\nlocalparam SELTYP = DIS_SMALL_RAM2MLAB ? ((TYP=="MLAB") ? 0 : 1) : \n                    ^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/530013823/LuanVan-20210617T090538Z-001/LuanVan/rtl/rsinv_test/lib/atvn/lib_v/ram/xil_bram_sel_nprm.vh:93: Can\'t find definition of variable: \'TYP\'\nlocalparam SELTYP = DIS_SMALL_RAM2MLAB ? ((TYP=="MLAB") ? 0 : 1) : \n                                           ^~~\n%Error: data/full_repos/permissive/530013823/LuanVan-20210617T090538Z-001/LuanVan/rtl/rsinv_test/lib/atvn/lib_v/ram/xil_bram_sel_nprm.vh:94: Can\'t find definition of variable: \'THDEP\'\n                                                                                                                                           : ... Suggested alternative: \'DEP\'\n      (IDEP < THDEP)  ? 0 : \n              ^~~~~\n%Error: Exiting due to 6 error(s)\n'
function [15:0]	get_maxdepth;
input [31:0]	W;
input [31:0]	D;
reg [15:0]	n [5:0];
reg [15:0]	m [5:0];
reg [15:0]	d0,w0;

integer    	i,pos;
reg [31:0]	temp0,temp1;
begin
for(i=0;i<6;i=i+1)
	begin
	d0 = i==0 ? 512 :
		 i==1 ? 1024:
		 i==2 ? 2048:
		 i==3 ? 4096:
		 i==4 ? 8192: 16384;
	w0 = i==0 ? 36  :
		 i==1 ? 18  :
		 i==2 ?  9  :
		 i==3 ?  4  :
		 i==4 ?  2  : 1;
	
	n[i]=(D/d0)+((D%d0) ? 1 : 0);
	m[i]=(W/w0)+((W%w0) ? 1 : 0);
	
	end
pos=0;
for(i=0;i<6;i=i+1)
	begin
	if(n[i]<8)
		begin
		pos= i;
		i  = 6;
		end
	end

temp0=n[pos]*m[pos];
for(i=pos+1;i<6;i=i+1)
	begin
	temp1 = n[i]*m[i];
	pos = (temp1 < temp0) ? i : pos;
	end
get_maxdepth = pos==0 ? 512 :
		       pos==1 ? 1024:
		       pos==2 ? 2048:
		       pos==3 ? 4096:
		       pos==4 ? 8192: 16384;
end
endfunction
function [15:0]	get_maxdepth;

input [31:0]	W;
input [31:0]	D;
reg [15:0]	n [5:0];
reg [15:0]	m [5:0];
reg [15:0]	d0,w0;

integer    	i,pos;
reg [31:0]	temp0,temp1;
begin
for(i=0;i<6;i=i+1)
	begin
	d0 = i==0 ? 512 :
		 i==1 ? 1024:
		 i==2 ? 2048:
		 i==3 ? 4096:
		 i==4 ? 8192: 16384;
	w0 = i==0 ? 36  :
		 i==1 ? 18  :
		 i==2 ?  9  :
		 i==3 ?  4  :
		 i==4 ?  2  : 1;
	
	n[i]=(D/d0)+((D%d0) ? 1 : 0);
	m[i]=(W/w0)+((W%w0) ? 1 : 0);
	
	end
pos=0;
for(i=0;i<6;i=i+1)
	begin
	if(n[i]<8)
		begin
		pos= i;
		i  = 6;
		end
	end

temp0=n[pos]*m[pos];
for(i=pos+1;i<6;i=i+1)
	begin
	temp1 = n[i]*m[i];
	pos = (temp1 < temp0) ? i : pos;
	end
get_maxdepth = pos==0 ? 512 :
		       pos==1 ? 1024:
		       pos==2 ? 2048:
		       pos==3 ? 4096:
		       pos==4 ? 8192: 16384;
end
endfunction