[SOLVED] help ! random func in systemverilog

Status
Not open for further replies.

xpratx

Junior Member level 3
Joined
Apr 8, 2010
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
india
Activity points
1,477
I wrote this small code to test the values stored in a 2-d array but it is not simulated by VCS. can anyone help??
i am new guy so please point in a specific direction.

module xyz();
reg [31:0] addrmem [31:0]
for ( i=0 ; i<33 ; i++)
begin
addrmem = $random();
end
endmodule
 

what do you mean by not simulated by VCS? is there any error?
 

I thought it should be like this:
Code:
module xyz();
 reg [31:0] addrmem [31:0]
 
 initial  begin
    for ( i=0 ; i<32 ; i++) 
    begin 
      addrmem[i] = $random();
    end
 end
 endmodule
 
Reactions: xpratx

    xpratx

    Points: 2
    Helpful Answer Positive Rating
cheers man it worked your way.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…