diff --git a/ivl.def b/ivl.def index 428403114..eae17a736 100644 --- a/ivl.def +++ b/ivl.def @@ -16,6 +16,8 @@ ivl_design_time_precision ivl_const_bits ivl_const_delay +ivl_const_file +ivl_const_lineno ivl_const_real ivl_const_signed ivl_const_type diff --git a/ivl_target.h b/ivl_target.h index c766f4fcd..9986a6693 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -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 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 unsigned ivl_const_pins(ivl_net_const_t net); */ diff --git a/t-dll-api.cc b/t-dll-api.cc index db4ad1be4..65a23ef62 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -186,6 +186,18 @@ extern "C" ivl_expr_t ivl_const_delay(ivl_net_const_t net, unsigned 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) { assert(net); diff --git a/t-dll.cc b/t-dll.cc index 2fd0048a0..a864650ec 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -2192,6 +2192,9 @@ bool dll_target::net_const(const NetConst*net) des_.consts.resize( des_.consts.size() + 1 ); des_.consts[des_.consts.size()-1] = obj; + obj->file = net->get_file(); + obj->lineno = net->get_lineno(); + make_const_delays_(obj, net); return true; diff --git a/t-dll.h b/t-dll.h index e153414f1..a42b9e89d 100644 --- a/t-dll.h +++ b/t-dll.h @@ -442,6 +442,8 @@ struct ivl_net_const_s { ivl_variable_type_t type : 3; unsigned width_ : 24; unsigned signed_ : 1; + perm_string file; + unsigned lineno; union { double real_value;