[sv-ec] Creating semaphores with negative number of keys

From: Kakoli Bhattacharya <kakoli_at_.....>
Date: Fri Aug 25 2006 - 03:23:24 PDT
Hello,

Given below is a testcase related to the use of semaphores.Here 'my_sm1' is
a semaphore which has been initialized with a negative number of keys.
I want to know if negative initialization can be done? If yes then what does
such an initialization mean? I am a bit confused about creating a semaphore with
negative number of keys.

module semaphore5 (input [7:0] in1,in2, output reg [7:0] out1,out2);
parameter param1 = 2;
semaphore my_sm1 = new(-2);
semaphore my_sm2 = new(param1);
always @(in1,in2)
begin
  if (my_sm1 == null)
    out1 = my_sm1 ? in1 ~^ in2 : in1 ^ in2;
  if (my_sm2 != null)
    out2 = in1 + in2;
end
endmodule

Regards,
Kakoli
Received on Fri Aug 25 03:25:15 2006

This archive was generated by hypermail 2.1.8 : Fri Aug 25 2006 - 03:25:43 PDT