Add support for ivl_const_{file,lineno}

This patch adds support for ivl_const_file() and ivl_const_lineno()
to the target interface.
This commit is contained in:
Cary R 2011-01-30 23:27:39 -08:00 committed by Stephen Williams
parent 6ddf754082
commit f01b25b60c
5 changed files with 22 additions and 0 deletions

View File

@ -16,6 +16,8 @@ ivl_design_time_precision
ivl_const_bits ivl_const_bits
ivl_const_delay ivl_const_delay
ivl_const_file
ivl_const_lineno
ivl_const_real ivl_const_real
ivl_const_signed ivl_const_signed
ivl_const_type ivl_const_type

View File

@ -591,6 +591,9 @@ extern int ivl_const_signed(ivl_net_const_t net);
extern unsigned ivl_const_width(ivl_net_const_t net); extern unsigned ivl_const_width(ivl_net_const_t net);
extern double ivl_const_real(ivl_net_const_t net); extern double ivl_const_real(ivl_net_const_t net);
extern const char* ivl_const_file(ivl_net_const_t net);
extern unsigned ivl_const_lineno(ivl_net_const_t net);
/* extern ivl_nexus_t ivl_const_pin(ivl_net_const_t net, unsigned idx); */ /* extern ivl_nexus_t ivl_const_pin(ivl_net_const_t net, unsigned idx); */
/* extern unsigned ivl_const_pins(ivl_net_const_t net); */ /* extern unsigned ivl_const_pins(ivl_net_const_t net); */

View File

@ -186,6 +186,18 @@ extern "C" ivl_expr_t ivl_const_delay(ivl_net_const_t net, unsigned transition)
return net->delay[transition]; return net->delay[transition];
} }
extern "C" const char*ivl_const_file(ivl_net_const_t net)
{
assert(net);
return net->file.str();
}
extern "C" unsigned ivl_const_lineno(ivl_net_const_t net)
{
assert(net);
return net->lineno;
}
extern "C" ivl_nexus_t ivl_const_nex(ivl_net_const_t net) extern "C" ivl_nexus_t ivl_const_nex(ivl_net_const_t net)
{ {
assert(net); assert(net);

View File

@ -2192,6 +2192,9 @@ bool dll_target::net_const(const NetConst*net)
des_.consts.resize( des_.consts.size() + 1 ); des_.consts.resize( des_.consts.size() + 1 );
des_.consts[des_.consts.size()-1] = obj; des_.consts[des_.consts.size()-1] = obj;
obj->file = net->get_file();
obj->lineno = net->get_lineno();
make_const_delays_(obj, net); make_const_delays_(obj, net);
return true; return true;

View File

@ -442,6 +442,8 @@ struct ivl_net_const_s {
ivl_variable_type_t type : 3; ivl_variable_type_t type : 3;
unsigned width_ : 24; unsigned width_ : 24;
unsigned signed_ : 1; unsigned signed_ : 1;
perm_string file;
unsigned lineno;
union { union {
double real_value; double real_value;