Function call isn't executed in verilog
The function is called but it returns 'x' because your depth argument is only one bit wide and the LSB of 8 is zero, so result is never assigned a value.

Change the line

input depth;


to

input integer depth;


and adder_width will be set to 3 as expected.