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 "verilatedos.h"
#include "V3Error.h" #include "V3Error.h"
#include "V3Number.h" #include "V3Number.h"
#include "V3Global.h"
#include <vector> #include <vector>
#include <cmath> #include <cmath>

View File

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

View File

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

View File

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

View File

@ -94,6 +94,13 @@ V3Global v3Global;
//###################################################################### //######################################################################
// V3 Class -- top level // 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() { void V3Global::readFiles() {
// NODE STATE // NODE STATE
// AstNode::user4p() // V3SymTable* Package and typedef symbol names // AstNode::user4p() // V3SymTable* Package and typedef symbol names