From 0f38008ed34e36e798f521b4b6d4fea89ae31a3b Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 27 Jul 2013 14:27:51 +0200 Subject: Added "design" command (-reset, -save, -load) --- frontends/ast/ast.cc | 15 +++++++++++++++ frontends/ast/ast.h | 1 + 2 files changed, 16 insertions(+) (limited to 'frontends/ast') diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 3e9ea50a..e7aa472e 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -896,6 +896,21 @@ void AstModule::update_auto_wires(std::map 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 99760e09..f6bb7a40 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 parameters); virtual void update_auto_wires(std::map auto_sizes); + virtual RTLIL::Module *clone() const; }; // this must be set by the language frontend before parsing the sources -- cgit v1.2.3