mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-29 01:03:29 +02:00
Add support for unary operators in constant user functions.
This patch implements the evaluate_function method for the NetEUnary and NetEUReduce classes.
This commit is contained in:
@@ -293,6 +293,14 @@ NetExpr* NetEConst::evaluate_function(const LineInfo&,
|
||||
return res;
|
||||
}
|
||||
|
||||
NetExpr* NetECReal::evaluate_function(const LineInfo&,
|
||||
map<perm_string,NetExpr*>&) const
|
||||
{
|
||||
NetECReal*res = new NetECReal(value_);
|
||||
res->set_line(*this);
|
||||
return res;
|
||||
}
|
||||
|
||||
NetExpr* NetESelect::evaluate_function(const LineInfo&loc,
|
||||
map<perm_string,NetExpr*>&context_map) const
|
||||
{
|
||||
@@ -372,6 +380,17 @@ NetExpr* NetETernary::evaluate_function(const LineInfo&loc,
|
||||
return res;
|
||||
}
|
||||
|
||||
NetExpr* NetEUnary::evaluate_function(const LineInfo&loc,
|
||||
map<perm_string,NetExpr*>&context_map) const
|
||||
{
|
||||
NetExpr*val = expr_->evaluate_function(loc, context_map);
|
||||
if (val == 0) return 0;
|
||||
|
||||
NetExpr*res = eval_arguments_(val);
|
||||
delete val;
|
||||
return res;
|
||||
}
|
||||
|
||||
NetExpr* NetEUFunc::evaluate_function(const LineInfo&loc,
|
||||
map<perm_string,NetExpr*>&context_map) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user