$clog2()

N$clog2(N)
00
10
21
32
42
53
63
73
83
94
parameter max_value = xxx;
parameter bus_width = $clog2(max_malue + 1);
logic [(bus_width-1):0] yyy;