diff options
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/ast.cc | 15 | ||||
-rw-r--r-- | frontends/ast/ast.h | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 3e9ea50ac..e7aa472ef 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -896,6 +896,21 @@ void AstModule::update_auto_wires(std::map<RTLIL::IdString, int> auto_sizes) delete newmod; } +RTLIL::Module *AstModule::clone() const +{ + AstModule *new_mod = new AstModule; + cloneInto(new_mod); + + new_mod->ast = ast->clone(); + new_mod->nolatches = nolatches; + new_mod->nomem2reg = nomem2reg; + new_mod->mem2reg = mem2reg; + new_mod->lib = lib; + new_mod->noopt = noopt; + + return new_mod; +} + // internal dummy line number callbacks namespace { int internal_line_num; diff --git a/frontends/ast/ast.h b/frontends/ast/ast.h index 99760e09c..f6bb7a40f 100644 --- a/frontends/ast/ast.h +++ b/frontends/ast/ast.h @@ -205,6 +205,7 @@ namespace AST virtual ~AstModule(); virtual RTLIL::IdString derive(RTLIL::Design *design, std::map<RTLIL::IdString, RTLIL::Const> parameters); virtual void update_auto_wires(std::map<RTLIL::IdString, int> auto_sizes); + virtual RTLIL::Module *clone() const; }; // this must be set by the language frontend before parsing the sources |