mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-28 16:53:45 +02:00
Keep parameters as a parameters reference for vpi calls.
For most cases just using the value of a parameter is fine, but a vpi call can access more than the value so we want to use a parameter reference instead of the value for vpi calls. Strings were working correctly, integer values need some minor code generator changes and real values needed to be pushed from elaboration to the code generators. I also changed the default real value comment from %g to %#g so that it is more obvious that the value is a real value.
This commit is contained in:
+16
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2008 Stephen Williams ([email protected])
|
||||
* Copyright (c) 2000-2009 Stephen Williams ([email protected])
|
||||
*
|
||||
* This source code is free software; you can redistribute it
|
||||
* and/or modify it in source code form under the terms of the GNU
|
||||
@@ -273,6 +273,21 @@ void dll_target::expr_param(const NetEConstParam*net)
|
||||
expr_ = par->value;
|
||||
}
|
||||
|
||||
void dll_target::expr_rparam(const NetECRealParam*net)
|
||||
{
|
||||
ivl_scope_t scop = find_scope(des_, net->scope());
|
||||
ivl_parameter_t par = scope_find_param(scop, net->name());
|
||||
|
||||
if (par == 0) {
|
||||
cerr << net->get_fileline() << ": internal error: "
|
||||
<< "Parameter " << net->name() << " missing from "
|
||||
<< ivl_scope_name(scop) << endl;
|
||||
}
|
||||
assert(par);
|
||||
assert(par->value);
|
||||
expr_ = par->value;
|
||||
}
|
||||
|
||||
void dll_target::expr_creal(const NetECReal*net)
|
||||
{
|
||||
assert(expr_ == 0);
|
||||
|
||||
Reference in New Issue
Block a user