The coding of your FSM seems to be fine. BTW, could you please tell that which Modelsim version are you using?
MSBR
- - - Updated - - -
I wrote a simple testbench for running your code:
`timescale 1ns/10ps
module tb_2;
bit reset , x, clk, q;
question_2 dut (reset,x,clk,q);
initial forever #5 clk = ~clk;
initial
begin
repeat(100)
begin
x = $random;
@ (posedge clk);
end
$stop;
end
endmodule
I used modelsim version 10.1 and found that the modelsim was showing code coverage.
May be it is the issue with your Modelsim version or something.
Thanks.
MSBR