Jump to content
Sign in to follow this  
kieunguyen

syntax error in VCS

Recommended Posts

Please help me show what is syntax error in here. The text file can't be used in VCS ?

 

The input data is from text file which contains the binary values. In Modelsim, it work without error but it got problem in VCS. 

'readmemb' command is used to read binary values in text file. Some value in text file are:

1000000000011010
0000000000011010
1000000000011010
1000000000011010
1000000000011010
0000000000011010

 

I do the function simulation in VCS, and try to perform these values in some ways then run simulation but result shows following:

 

1.  Parsing design file './01cfo_im.txt'

 
Warning-[DCTL] Decimal constant too large
./01cfo_im.txt, 1
  Decimal constant is too large to be handled in compilation.
  Absolute value 1000000000011010 should be smaller than 2147483648.
 
 
Error-[sE] Syntax error
  Following verilog source has syntax error :
  "./01cfo_im.txt", 2: token is ''
  0000000000011010
 
1 warning
1 error

 

2.Parsing design file './01cfo_im.txt'

 
Error-[sE] Syntax error
  Following verilog source has syntax error :
  "./01cfo_im.txt", 1: token is '1000000000011010'
  16 'b1000000000011010
                       ^
 
3. Parsing design file './01cfo_im.txt'
 
Error-[sE] Syntax error
  Following verilog source has syntax error :
  "./01cfo_im.txt", 1: token is '1000000000011010'
  16'b1000000000011010
                      ^
 

Share this post


Link to post
Share on other sites

Alan is right. You are trying to compile the text file. This example works great for VCS with your given input: 

module tb;
  logic [15:0] mem [0:5];
  initial begin
    $readmemb("mem.dat", mem);
    foreach(mem[i])
      $display("mem[%0d]= b%b = d%d", i, mem[i], mem[i]);
  end
endmodule
vlogan +v2k -sverilog tb.sv
vcs -R tb
mem[0]= b1000000000011010 = d32794
mem[1]= b0000000000011010 = d   26
mem[2]= b1000000000011010 = d32794
mem[3]= b1000000000011010 = d32794
mem[4]= b1000000000011010 = d32794
mem[5]= b0000000000011010 = d   26

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...