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 for declaring an array in system verilog in Modelsim 10.1b

Status
Not open for further replies.

manik045

Newbie level 6
Joined
Feb 16, 2010
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Dinajpur
Activity points
1,404
I have written the following code in system verilog in Modelsim.

Code:
module mul_array ();
  
 byte md[2:1][3:1]='{'{0,1,2},'{3,4,5}};
 
  initial begin
    $display ("Initial value:");
foreach (md [i,j])  
  $display ("md[%0d] [%0d]=%0d", i,j, md[i][j]);

  end 
endmodule

I have declared the multiple array here but there show two error while compiling.

** Error: E:\New simulation folder\mul_array(3): near "=": Syntax error.
** Error: E:\New simulation folder\mul_array(8): near "$display": syntax error, unexpected SYSTEM_IDENTIFIER, expecting ';'

I have attached the image here. May be it will be very easy to understand.
Error.jpg

What is wrong here. I have done my works into .sv file. I do not understand what's wrong i have done here. Does the problem occur due to the absence of the system verilog library file? can anybody help me in this regard.

Thanks in advance.
 

Because it's an old version of modelsim, have you tried using the -sv switch on vlog?
 
Note that the error messages show no *.sv file extension, so the file will only allow Verilog syntax. Make sure they a *.sv file extension.
 
TrickyDicky would you please give me a briefings about -sv switch on vlog. I have no idea regarding this.
 

vlog -sv verilogfilename.v
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top