Blocking assignment for clock divider

In reply to dave_59:
The above example shows very poor design practices because it utilizes derived clocks as clocks along with the master clock. This is an invitation to poor designs and problems. TOO MANY CLOCKS!!! Tricking the simulator does not help, sorry; GBGO !!!
Why not do something like what is done in good designs? below is my recommendations.


module top;
   bit clk, clkdiv;
   int A,B;
   always #5 clk = !clk;
   always @(posedge clk) clkdiv <= !clkdiv;  
 
   always @(posedge clk) A <= A + 1;
   always @(posedge clk && clkdiv) B <= A; // gets the current, non-updated value of A
   // BTW, this is how hardware works. 
   initial begin
      $monitor($time,,A,,B);
      #100 $finish;
   end
endmodule 

Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us