[sv-ec] Clarification for Section 15.8


Subject: [sv-ec] Clarification for Section 15.8
From: Stefen Boyd (stefen@boyd.com)
Date: Mon Mar 17 2003 - 04:26:00 PST


Arturo,

Since I don't think I'm going to be able to write
unambiguous sentences and those that exist in this
section don't seem to completely clarify what happens
when calling blocking tasks, I'll write up an example
for this section. Everyone can make sure I haven't
made any silly syntax errors, and you can make sure
the comments correctly reflect the region of the
event queue when these statements are evaluated.

This should clarify the meaning of
  "requires explicit synchronization upon return from the task"
which doesn't make it clear to me if it's the tool
that ensures the synchronization happens, or the user.

Thanks,
   Stefen

===================================================
This examples demonstrates which statements
will be evaluated in the active region vs
the reactive region when calling module tasks
from the program:

module top;
   reg clk = 0;
   always #10 clk = ~clk;
   prog p1(clk);
   mod m1(clk);

endmodule

module mod(input clk);
   reg a,b,c,d;
   task t1;
    begin
     a = 1'b1; // REactive
     @(posedge clk);
     b <= 1'b1; // active
    end
   endtask
   task t2;
    begin
     c = 1'b1; // active
     @(posedge clk);
     d <= 1'b1; // active
    end
   endtask
   task t3;
    begin
     c = 1'b1; // active
     @(posedge clk);
     d = 1'b1; // active
    end
   endtask
endmodule

program prog(input clk);
   reg w,x,y;
   initial begin
     @(posedge clk);
     w = 1'b1; // REactive
     m1.t1;
     m1.t2;
     x = 1'b1; // active
     m1.t3;
     @(posedge clk);
     y = 1'b1; // REactive
   end
endprogram



This archive was generated by hypermail 2b28 : Mon Mar 17 2003 - 11:36:55 PST