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 [VC_BITS:0] get_free_vc;
	input [(OUT_PORT_BITS - 1): 0]    port;	
	integer j; reg val; reg [VC_BITS - 1:0] vc ; 
	begin
        val = 0; vc  = 0; 
		for(j= 0; j < NUM_VCS; j = j+1) begin
			if ((free_vcs[port][j] == 1) & (val == 0) & (~full_in[port][j])) begin
				free_vcs[port][j] = 0; val = 1; vc  = j; 
			end
		end  
		get_free_vc = {vc, val}; 
	end
  endfunction
function [VC_BITS:0] get_free_vc;

	input [(OUT_PORT_BITS - 1): 0]    port;	
	integer j; reg val; reg [VC_BITS - 1:0] vc ; 
	begin
        val = 0; vc  = 0; 
		for(j= 0; j < NUM_VCS; j = j+1) begin
			if ((free_vcs[port][j] == 1) & (val == 0) & (~full_in[port][j])) begin
				free_vcs[port][j] = 0; val = 1; vc  = j; 
			end
		end  
		get_free_vc = {vc, val}; 
	end
  endfunction