~ubuntu-branches/ubuntu/precise/verilator/precise

« back to all changes in this revision

Viewing changes to src/V3Link.cpp

  • Committer: Bazaar Package Importer
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2011-01-22 10:08:37 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110122100837-l1x2q9vm6m7gdrc8
Tags: 3.810-1
* New upstream release.
* Refreshed shebang.diff patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
//
8
8
//*************************************************************************
9
9
//
10
 
// Copyright 2003-2010 by Wilson Snyder.  This program is free software; you can
 
10
// Copyright 2003-2011 by Wilson Snyder.  This program is free software; you can
11
11
// redistribute it and/or modify it under the terms of either the GNU
12
12
// Lesser General Public License Version 3 or the Perl Artistic License
13
13
// Version 2.0.
33
33
#include <cctype>
34
34
#include <unistd.h>
35
35
#include <map>
 
36
#include <set>
36
37
#include <algorithm>
37
38
#include <vector>
38
39
 
79
80
    bool        m_inGenerate;   // Inside a generate
80
81
    AstNodeModule*      m_valueModp;    // If set, move AstVar->valuep() initial values to this module
81
82
    vector<V3SymTable*> m_delSymps;     // Symbol tables to delete
 
83
    set<string> m_declfnWarned; // Files we issued DECLFILENAME on
82
84
 
83
85
    static int debug() {
84
86
        static int level = -1;
227
229
    virtual void visit(AstNodeModule* nodep, AstNUser*) {
228
230
        // Module: Create sim table for entire module and iterate
229
231
        UINFO(2,"Link Module: "<<nodep<<endl);
 
232
        if (m_idState == ID_FIND) {
 
233
            if (nodep->fileline()->filebasenameNoExt() != nodep->prettyName()
 
234
                && !v3Global.opt.isLibraryFile(nodep->fileline()->filename())) {
 
235
                // We only complain once per file, otherwise library-like files have a huge mess of warnings
 
236
                if (m_declfnWarned.find(nodep->fileline()->filename()) == m_declfnWarned.end()) {
 
237
                    m_declfnWarned.insert(nodep->fileline()->filename());
 
238
                    nodep->v3warn(DECLFILENAME, "Filename '"<<nodep->fileline()->filebasenameNoExt()
 
239
                                  <<"' does not match "<<nodep->typeName()<<" name: "<<nodep->prettyName());
 
240
                }
 
241
            }
 
242
        }
230
243
        AstCell* upperCellp = m_cellp;
231
244
        V3SymTable* upperVarsp = m_curVarsp;
232
245
        {
659
672
    virtual void visit(AstDefParam* nodep, AstNUser*) {
660
673
        nodep->iterateChildren(*this);
661
674
        if (m_idState==ID_PARAM) {
 
675
            nodep->v3warn(DEFPARAM,"Suggest replace defparam with Verilog 2001 #(."<<nodep->name()<<"(...etc...))");
662
676
            AstNode* foundp = m_curVarsp->findIdUpward(nodep->path());
663
677
            AstCell* cellp = foundp->castCell();
664
678
            if (!cellp) {