Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

Issue #1179

Verilog::SigParser problems with package ordering

Added by Shareef Jalloq over 2 years ago. Updated over 2 years ago.

Status:
NoFixNeeded
Priority:
Normal
Assignee:
-
% Done:

0%


Description

Hi there,

I'm seeing an error reported when trying to parse a file that uses wildcard imports. It seems strange as vppreproc and Verilog::Netlist both parse these fine. I'm using version 3.422.

The error is:
%Error: /path/to/file.sv:84: syntax error, unexpected IDENTIFIER, expecting PACKAGE-IDENTIFIER or STRING
The script looks like:
    my $vp = Verilog::Preproc->new( options => $opt  );
    my $parser = MySigParser->new( options => $opt );

    foreach (@files) {
        print "$_\n";
        $vp->open( filename => $_ );
        $parser->parse_preproc_file($vp);
    }

History

#1 Updated by Wilson Snyder over 2 years ago

  • Status changed from New to NoFixNeeded

The language standard requires packages be declared before they are referenced, so most likely that's resulting in this message. Include the packages before you use them.

#2 Updated by Shareef Jalloq over 2 years ago

So what's the best way to use SigParser? How do you build the file tree such that it parses in the correct order? I just assumed it would work like Verilog::Netlist if you passed in a VC file.

#3 Updated by Wilson Snyder over 2 years ago

It does work like Netlist. You just need the file list in the proper order, with files containing packages first, or have your modules `include the package definitions, just as most simulators require.

#4 Updated by Shareef Jalloq over 2 years ago

Our VC file has all the packages declared at the head of the file.

So what you're saying is that if you want to use SigParser, you have to manually build the file tree or update the source to `include?

Edit: I tried to `include the package but then I get an 'unexpect package' error from SigParse.

#5 Updated by Shareef Jalloq over 2 years ago

Fixed it.

I remembered that when parsing the options file using Verilog::Getopt->parameter, it returns a list of files. This is how we get the packages in our other scripts.

Thanks.

#6 Updated by Wilson Snyder over 2 years ago

  • Subject changed from Verilog::SigParser doesn't support wildcard imports to Verilog::SigParser problems with package ordering

Great!

Also available in: Atom