summaryrefslogtreecommitdiff
path: root/frontends/ast
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-21 17:22:04 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-21 17:22:04 +0200
commit6c5cafcd8bf4d6b12b4d510480a0ccc1adee7212 (patch)
treee6e3c956e5cdc73bc80c50b7137897ef04c182d2 /frontends/ast
parent085c8e873d4d90129a952eba85836891635a7f8c (diff)
Added support for DPI function with different names in C and Verilog
Diffstat (limited to 'frontends/ast')
-rw-r--r--frontends/ast/simplify.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 5cf64310..859058cb 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -1451,15 +1451,15 @@ skip_dynamic_range_lvalue_expansion:;
std::vector<AstNode*> args;
rtype = RTLIL::unescape_id(dpi_decl->children.at(0)->str);
- fname = RTLIL::unescape_id(dpi_decl->str);
+ fname = RTLIL::unescape_id(dpi_decl->children.at(1)->str);
- for (int i = 1; i < SIZE(dpi_decl->children); i++)
+ for (int i = 2; i < SIZE(dpi_decl->children); i++)
{
- if (i-1 >= SIZE(children))
+ if (i-2 >= SIZE(children))
log_error("Insufficient number of arguments in DPI function call at %s:%d.\n", filename.c_str(), linenum);
argtypes.push_back(RTLIL::unescape_id(dpi_decl->children.at(i)->str));
- args.push_back(children.at(i-1)->clone());
+ args.push_back(children.at(i-2)->clone());
while (args.back()->simplify(true, false, false, stage, -1, false, true)) { }
if (args.back()->type != AST_CONSTANT && args.back()->type != AST_REALVALUE)