Skip to main content
edited body
Source Link
dave_59
  • 8.9k
  • 1
  • 15
  • 27

You can use the conditional operator condition ? true_expression : false_expression as long as everything within the expression is a parameter or literal constant.

localparam transitionConst = (transitionConst <=  maxLength) ? x + y + z + offset : transistionConst - maxLength;

You can also use functions to define parameters, as long as all the inputs to the function inputs are parameters or constants as well.

You can use the conditional operator condition ? true_expression : false_expression as long as everything the expression is a parameter or literal constant.

localparam transitionConst = (transitionConst <=  maxLength) ? x + y + z + offset : transistionConst - maxLength;

You can also use functions to define parameters, as long as all the inputs to the function are parameters or constants as well.

You can use the conditional operator condition ? true_expression : false_expression as long as everything within the expression is a parameter or literal constant.

localparam transitionConst = (transitionConst <=  maxLength) ? x + y + z + offset : transistionConst - maxLength;

You can also use functions to define parameters, as long as all the function inputs are parameters or constants as well.

Source Link
dave_59
  • 8.9k
  • 1
  • 15
  • 27

You can use the conditional operator condition ? true_expression : false_expression as long as everything the expression is a parameter or literal constant.

localparam transitionConst = (transitionConst <=  maxLength) ? x + y + z + offset : transistionConst - maxLength;

You can also use functions to define parameters, as long as all the inputs to the function are parameters or constants as well.