Value counter


WIDTH u32 Counter width
MAX_COUNT bit Max value of counter
MIN_COUNT bit Min value of counter
INITIAL_COUNT bit Initial value of counter
WRAP_AROUND bit Whether counter is wrap around


i_clk input clock Clock
i_rst input reset Reset
i_clear input logic Clear counter
i_set input logic Set counter to a value
i_set_value input COUNT Value used by i_set
i_up input logic Count up
i_down input logic Count down
o_count output COUNT Count value
o_count_next output COUNT Count value for the next clock cycle
o_wrap_around output logic Indicator for wrap around