Internals: Allow v3Global in V3Ast.h. No functional change.

This commit is contained in:
Wilson Snyder 2011-11-29 22:09:50 -05:00
parent 362d642c87
commit 0d1698f81d
5 changed files with 16 additions and 6 deletions

View File

@ -26,6 +26,7 @@
#include "verilatedos.h"
#include "V3Error.h"
#include "V3Number.h"
#include "V3Global.h"
#include <vector>
#include <cmath>

View File

@ -29,7 +29,8 @@
#include "V3Error.h"
#include "V3Options.h"
#include "V3Ast.h"
class AstNetlist;
//======================================================================
// Statics
@ -54,23 +55,22 @@ public:
public:
// CREATORS
V3Global() {
m_rootp = new AstNetlist;
m_debugFileNumber = 0;
m_assertWidthsSame = false;
m_needHInlines = false;
m_needHeavy = false;
m_dpi = false;
m_rootp = makeNetlist();
}
void clear() {
if (m_rootp) m_rootp->deleteTree(); m_rootp=NULL;
}
AstNetlist* makeNetlist();
void clear();
// ACCESSORS (general)
AstNetlist* rootp() const { return m_rootp; }
bool assertWidthsSame() const { return m_assertWidthsSame; }
// METHODS
void readFiles();
void checkTree() { rootp()->checkTree(); }
void checkTree();
void assertWidthsSame(bool flag) { m_assertWidthsSame = flag; }
string debugFilename(const string& nameComment, int newNumber=0) {
++m_debugFileNumber;

View File

@ -26,6 +26,7 @@
#include "verilatedos.h"
#include "V3Error.h"
#include "V3List.h"
#include "V3Ast.h"
#include <vector>
#include <algorithm>

View File

@ -32,6 +32,7 @@
#include <iomanip>
#include "V3Global.h"
#include "V3Ast.h"
//######################################################################
// Symbol table

View File

@ -94,6 +94,13 @@ V3Global v3Global;
//######################################################################
// V3 Class -- top level
AstNetlist* V3Global::makeNetlist() { return new AstNetlist(); }
void V3Global::checkTree() { rootp()->checkTree(); }
void V3Global::clear() {
if (m_rootp) m_rootp->deleteTree(); m_rootp=NULL;
}
void V3Global::readFiles() {
// NODE STATE
// AstNode::user4p() // V3SymTable* Package and typedef symbol names