component lutn "";

    // Input Pins
pin in bit in-##[pincount];
pin out bit out;

instanceparam int pincount = 2;

option MAXCOUNT 5;

instanceparam u32 functn = 0;
option extra_inst_setup;

license "GPL";

function _;
;;


FUNCTION(_)
{
hal_u32_t i;
ip = arg;
hal_u32_t shift = 0;

    for (i = 0; i < local_pincount; i++)
	if (in(i))
	    shift += (1 << i);

    out = (local_functn & (1 << shift)) != 0;

return 0;
}

EXTRA_INST_SETUP()
{
int x;

    hal_print_msg(RTAPI_MSG_ERR,"Function %s was passed argument \"functn\" with value = %x",__FUNCTION__, local_functn);
    for(x = 0; x < argc; x++)
        hal_print_msg(RTAPI_MSG_ERR,"argv[%d] = %s", x, argv[x]);

return 0;
}
