I have a design that takes a few essential parameters. It needs to do some arithmetic (comparisons, additions etc.) on the given essential parameters, then initialize other parameters (or constants) based on the results. For instance, look at the code below,
module foo(a,b);
parameter wl_in = 8;
parameter sc_in = 3;
parameter wl_out = 9;
parameter sc_out = 2;
parameter big_wl = //to be determined...
parameter big_sc = //to be determined...
//some logic
endmodule
I want to determine which of the two wls is greater, then assign it to big_wl. Likewise for sc. I will then use these parameters to define arrays, define array boundaries etc.
I tried using if/else statements, but I've gotten errors with that approach.
How can I do this in Verilog-2001?