summaryrefslogtreecommitdiff
path: root/frontends/ast/ast.h
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-02-14 19:56:44 +0100
committerClifford Wolf <clifford@clifford.at>2014-02-14 19:56:44 +0100
commit534c1a5dd009b41629d2d05acfde747ce6fbc19c (patch)
tree17adbb2d8ccfdfc402261641cdde2390417d2e3f /frontends/ast/ast.h
parent3121d19d95ae916b96baa000197f3ec2aa5c5ad7 (diff)
Created basic support for function calls in parameter values
Diffstat (limited to 'frontends/ast/ast.h')
-rw-r--r--frontends/ast/ast.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/frontends/ast/ast.h b/frontends/ast/ast.h
index 8335db09..ec4f4f62 100644
--- a/frontends/ast/ast.h
+++ b/frontends/ast/ast.h
@@ -190,7 +190,7 @@ namespace AST
// 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);
+ bool simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, int width_hint, bool sign_hint, bool in_param);
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::map<AstNode*, std::set<std::string>> &mem2reg_places,
@@ -198,6 +198,11 @@ namespace AST
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);
+ // additional functionality for evaluating constant functions
+ struct varinfo_t { RTLIL::Const val; int offset; bool is_signed; };
+ void replace_variables(std::map<std::string, varinfo_t> &variables, AstNode *fcall);
+ AstNode *eval_const_function(AstNode *fcall);
+
// create a human-readable text representation of the AST (for debugging)
void dumpAst(FILE *f, std::string indent);
void dumpVlog(FILE *f, std::string indent);