Unable to diagnose StX fault in Modelsim
You have never initialized the counter. 

In contrast to normal programing languages all Verilog variables have an initial value of 'X'.
(In VHDL the value 'U').

You then perform an add but X + 1 still produces X.