Help on writing test bench for up counter in verilog
From the comments on my question, the problem was about not initializing the count to a known state.

So, adding a count = 8'b0 in an initial block in the main module(up_counter) solves the problem.