Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[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
 
  • Like
Reactions: xpratx

    xpratx

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

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top