diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-11-21 13:49:00 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-11-21 13:49:00 +0100 |
commit | 09471846c553855c43224ce32d855c46f4df5140 (patch) | |
tree | 659fff2b882e2d7c54a5eaf72adeed2328d4ba64 /frontends/ast/ast.h | |
parent | 84ced2bb8ee2e6498b53ae6cdb77930aa98affbb (diff) | |
download | yosys-09471846c553855c43224ce32d855c46f4df5140.tar.gz yosys-09471846c553855c43224ce32d855c46f4df5140.tar.bz2 yosys-09471846c553855c43224ce32d855c46f4df5140.zip |
Major improvements in mem2reg and added "init" sync rules
Diffstat (limited to 'frontends/ast/ast.h')
-rw-r--r-- | frontends/ast/ast.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/frontends/ast/ast.h b/frontends/ast/ast.h index 37f75454c..de32a2bb9 100644 --- a/frontends/ast/ast.h +++ b/frontends/ast/ast.h @@ -162,12 +162,31 @@ namespace AST void delete_children(); ~AstNode(); + enum mem2reg_flags + { + /* status flags */ + MEM2REG_FL_ALL = 0x00000001, + MEM2REG_FL_ASYNC = 0x00000002, + MEM2REG_FL_INIT = 0x00000004, + + /* candidate flags */ + MEM2REG_FL_FORCED = 0x00000100, + MEM2REG_FL_SET_INIT = 0x00000200, + MEM2REG_FL_SET_ELSE = 0x00000400, + MEM2REG_FL_SET_ASYNC = 0x00000800, + MEM2REG_FL_EQ2 = 0x00001000, + + /* proc flags */ + MEM2REG_FL_EQ1 = 0x01000000, + }; + // simplify() creates a simpler AST by unrolling for-loops, expanding generate blocks, etc. // it also sets the id2ast pointers so that identifier lookups are fast in genRTLIL() bool simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, int width_hint, bool sign_hint); void expand_genblock(std::string index_var, std::string prefix, std::map<std::string, std::string> &name_map); void replace_ids(std::map<std::string, std::string> &rules); - void mem2reg_as_needed_pass1(std::set<AstNode*> &mem2reg_set, std::set<AstNode*> &mem2reg_candidates, bool sync_proc, bool async_proc, bool force_mem2reg); + void mem2reg_as_needed_pass1(std::map<AstNode*, std::set<std::string>> &mem2reg_places, + std::map<AstNode*, uint32_t> &mem2reg_flags, std::map<AstNode*, uint32_t> &proc_flags, uint32_t &status_flags); void mem2reg_as_needed_pass2(std::set<AstNode*> &mem2reg_set, AstNode *mod, AstNode *block); void meminfo(int &mem_width, int &mem_size, int &addr_bits); |