3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-05 02:40:25 +00:00

Added support for DPI function with different names in C and Verilog

This commit is contained in:
Clifford Wolf 2014-08-21 17:22:04 +02:00
parent 085c8e873d
commit 6c5cafcd8b
3 changed files with 20 additions and 9 deletions

View file

@ -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)