From 61930c3b6ea5a84d70f1ca3f7de76e0c805f63f2 Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 1 Aug 2008 14:59:53 -0700 Subject: [PATCH] Add file and line information to processes. This patch adds file and line information to processes (initial and always). --- ivl.def | 2 ++ ivl_target.h | 3 +++ t-dll-api.cc | 12 ++++++++++++ t-dll-proc.cc | 7 ++----- t-dll.h | 10 +++++++++- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ivl.def b/ivl.def index 6a74bf7cb..dfcf064cf 100644 --- a/ivl.def +++ b/ivl.def @@ -191,6 +191,8 @@ ivl_path_source ivl_process_attr_cnt ivl_process_attr_val +ivl_process_file +ivl_process_lineno ivl_process_scope ivl_process_stmt ivl_process_type diff --git a/ivl_target.h b/ivl_target.h index 13d4b68db..7535bd0d4 100644 --- a/ivl_target.h +++ b/ivl_target.h @@ -1695,6 +1695,9 @@ extern ivl_statement_t ivl_process_stmt(ivl_process_t net); extern unsigned ivl_process_attr_cnt(ivl_process_t net); extern ivl_attribute_t ivl_process_attr_val(ivl_process_t net, unsigned idx); +extern const char* ivl_process_file(ivl_process_t net); +extern unsigned ivl_process_lineno(ivl_process_t net); + /* * These functions manage statements of various type. This includes * all the different kinds of statements (as enumerated in diff --git a/t-dll-api.cc b/t-dll-api.cc index cf3c9b83c..e9db3bf5e 100644 --- a/t-dll-api.cc +++ b/t-dll-api.cc @@ -1438,6 +1438,18 @@ extern int ivl_path_source_negedge(ivl_delaypath_t net) return net->negedge ? 1 : 0; } +extern "C" const char*ivl_process_file(ivl_process_t net) +{ + assert(net); + return net->file.str(); +} + +extern "C" unsigned ivl_process_lineno(ivl_process_t net) +{ + assert(net); + return net->lineno; +} + extern "C" ivl_process_type_t ivl_process_type(ivl_process_t net) { return net->type_; diff --git a/t-dll-proc.cc b/t-dll-proc.cc index 5d843e9d4..e3c693748 100644 --- a/t-dll-proc.cc +++ b/t-dll-proc.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2008 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -17,9 +17,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#ifdef HAVE_CVS_IDENT -#ident "$Id: $" -#endif # include "config.h" @@ -50,6 +47,7 @@ bool dll_target::process(const NetProcTop*net) default: assert(0); } + FILE_NAME(obj, net); /* Save the scope of the process. */ obj->scope_ = lookup_scope_(net->scope()); @@ -745,4 +743,3 @@ void dll_target::proc_while(const NetWhile*net) net->emit_proc_recurse(this); stmt_cur_ = save_cur_; } - diff --git a/t-dll.h b/t-dll.h index 5bc4c3fb4..3bb1b9279 100644 --- a/t-dll.h +++ b/t-dll.h @@ -539,7 +539,7 @@ struct ivl_parameter_s { unsigned lineno; }; /* - * All we know about a process it its type (initial or always) and the + * All we know about a process is its type (initial or always) and the * single statement that is it. A process also has a scope, although * that generally only matters for VPI calls. */ @@ -547,6 +547,8 @@ struct ivl_process_s { ivl_process_type_t type_; ivl_scope_t scope_; ivl_statement_t stmt_; + perm_string file; + unsigned lineno; struct ivl_attribute_s*attr; unsigned nattr; @@ -763,4 +765,10 @@ static inline void FILE_NAME(ivl_switch_t net, const LineInfo*info) net->lineno = info->get_lineno(); } +static inline void FILE_NAME(ivl_process_t net, const LineInfo*info) +{ + net->file = info->get_file(); + net->lineno = info->get_lineno(); +} + #endif