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:
Cary R
2009-01-16 18:21:50 -08:00
committed by Stephen Williams
parent d2e7ea0b68
commit 6f9ddea07f
6 changed files with 64 additions and 23 deletions
+16 -1
View File
@@ -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);