[sv-ec] srandom, set_randstate restrictions

From: Daniel Mlynek <daniel.mlynek_at_.....>
Date: Tue Dec 22 2009 - 00:58:01 PST
LRM says:
An object's seed can be set from any thread. However, a thread's seed can
only be set from within the thread itself.
 
From the syntax point of view setting seed of the thread from another thread
is possible - I assume that this is semantic restriction and below code
should fail on runtime.
My question is should LRM restriction be valid for both srandom and
set_randstate ?
 
 

module top;
 process p,p1;
 string str;
 initial begin
  p = process::self();
  #10;
  $display($urandom());
 end
 
 initial begin
  p1 = process::self();
  #10;
  $display($urandom());
 end
 
 initial #1 p.srandom(1); //illegal because seeding of another thread?????
 initial begin
  #2;
    str=  p.get_randstate();
      $display(str);
  str=  p1.get_randstate();
  $display(str);
   p1.set_randstate(str); //illegal because seeding of another thread?????

  end 
endmodule


 
DANiel


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue, 22 Dec 2009 09:58:01 +0100

This archive was generated by hypermail 2.1.8 : Tue Dec 22 2009 - 01:05:31 PST