Better handle nesting of scopes inside generate blocks.

Within generate schemes it is possible to have nested scopes, even
more liberally then outside generate blocks. So see to it that the
scopes properly stack with the generate blocks, and that wires and
behaviors are put in the right scopes.
This commit is contained in:
Stephen Williams
2008-06-19 21:31:53 -07:00
parent 2f3627cd6d
commit c87e629150
5 changed files with 98 additions and 63 deletions
+16 -5
View File
@@ -38,7 +38,22 @@ class NetScope;
* NOTE: This is note the same concept as the "scope" of an elaborated
* hierarchy. That is represented by NetScope objects after elaboration.
*/
class PScope {
class LexicalScope {
public:
explicit LexicalScope() { }
// A virtual destructor is so that dynamic_cast can work.
virtual ~LexicalScope() { }
// Nets an variables (wires) in the scope
map<perm_string,PWire*>wires;
PWire* wires_find(perm_string name);
private:
};
class PScope : public LexicalScope {
public:
// When created, a scope has a name and a parent. The name is
@@ -56,10 +71,6 @@ class PScope {
perm_string pscope_name() const { return name_; }
PScope* pscope_parent() { return parent_; }
// Nets an variables (wires) in the scope
map<perm_string,PWire*>wires;
PWire* wires_find(perm_string name);
// Named events in the scope.
map<perm_string,PEvent*>events;