data/full_repos/permissive/502544928/router_3d.v
1: b"%Error: data/full_repos/permissive/502544928/router_3d.v:83: Expecting expression to be constant, but can't determine constant for FUNCREF 'log2'\n                                                           : ... In instance router\n        data/full_repos/permissive/502544928/router_3d.v:56: ... Location of non-constant VARREF 'result': Language violation: reference to non-function-local variable\n        data/full_repos/permissive/502544928/router_3d.v:83: ... Called from log2() with parameters:\n           num = ?32?h1\n  localparam ROW_3D_BITS=log2(ROW_3D); \n                         ^~~~\n%Error: Exiting due to 1 error(s)\n"
function [ID_BITS-1:0] grid_id;
	input integer id; 
	integer i, j,k, count; 
	reg [ROW_3D_BITS - 1:0] row; reg [COLUMN_BITS - 1:0] col;  reg [HEIGHT_BITS - 1:0] hei ; 
	begin
        count = 0; row = 0; col = 0; hei=0;
	for(k= 0; k< HEIGHT; k = k+1) begin
		for(i= 0; i < ROW_3D; i = i+1) begin
			for(j= 0; j < COLUMN; j = j+1) begin
				
				
				    if (count == id) begin
					   row = i; 
					   col = j; 
					   hei = k; 
				    end
				    count = count +1; 
				end
			end
		end  
		grid_id = {hei,row, col}; 
	end
  endfunction
function [ID_BITS-1:0] grid_id;

	input integer id; 
	integer i, j,k, count; 
	reg [ROW_3D_BITS - 1:0] row; reg [COLUMN_BITS - 1:0] col;  reg [HEIGHT_BITS - 1:0] hei ; 
	begin
        count = 0; row = 0; col = 0; hei=0;
	for(k= 0; k< HEIGHT; k = k+1) begin
		for(i= 0; i < ROW_3D; i = i+1) begin
			for(j= 0; j < COLUMN; j = j+1) begin
				
				
				    if (count == id) begin
					   row = i; 
					   col = j; 
					   hei = k; 
				    end
				    count = count +1; 
				end
			end
		end  
		grid_id = {hei,row, col}; 
	end
  endfunction