Add vpiFile and vpiLineNo to .sfunc (system function in cont. assign)
This patch add the vpiFile and vpiLineNo properties to system functions that are called from continuous assignments.
This commit is contained in:
parent
77061faa5c
commit
c866be421e
2
ivl.def
2
ivl.def
|
|
@ -78,6 +78,8 @@ ivl_lpm_data
|
|||
ivl_lpm_datab
|
||||
ivl_lpm_define
|
||||
ivl_lpm_enable
|
||||
ivl_lpm_file
|
||||
ivl_lpm_lineno
|
||||
ivl_lpm_name
|
||||
ivl_lpm_q
|
||||
ivl_lpm_scope
|
||||
|
|
|
|||
11
t-dll-api.cc
11
t-dll-api.cc
|
|
@ -823,6 +823,17 @@ extern "C" ivl_nexus_t ivl_lpm_enable(ivl_lpm_t net)
|
|||
}
|
||||
}
|
||||
|
||||
/* The file name and line number are only set for system functions! */
|
||||
extern "C" const char* ivl_lpm_file(ivl_lpm_t net)
|
||||
{
|
||||
return net->file.str();
|
||||
}
|
||||
|
||||
extern "C" unsigned ivl_lpm_lineno(ivl_lpm_t net)
|
||||
{
|
||||
return net->lineno;
|
||||
}
|
||||
|
||||
extern "C" ivl_nexus_t ivl_lpm_data(ivl_lpm_t net, unsigned idx)
|
||||
{
|
||||
assert(net);
|
||||
|
|
|
|||
1
t-dll.cc
1
t-dll.cc
|
|
@ -1047,6 +1047,7 @@ bool dll_target::net_sysfunction(const NetSysFunc*net)
|
|||
|
||||
struct ivl_lpm_s*obj = new struct ivl_lpm_s;
|
||||
obj->type = IVL_LPM_SFUNC;
|
||||
FILE_NAME(obj, net);
|
||||
obj->name = net->name();
|
||||
obj->scope = find_scope(des_, net->scope());
|
||||
assert(obj->scope);
|
||||
|
|
|
|||
13
t-dll.h
13
t-dll.h
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef __t_dll_H
|
||||
#define __t_dll_H
|
||||
/*
|
||||
* Copyright (c) 2000-2004 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2000-2007 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
|
||||
|
|
@ -18,9 +18,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: t-dll.h,v 1.143 2007/06/02 03:42:13 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "target.h"
|
||||
# include "ivl_target.h"
|
||||
|
|
@ -292,6 +289,8 @@ struct ivl_lpm_s {
|
|||
ivl_lpm_type_t type;
|
||||
ivl_scope_t scope;
|
||||
perm_string name;
|
||||
perm_string file;
|
||||
unsigned lineno;
|
||||
// Value returned by ivl_lpm_width;
|
||||
unsigned width;
|
||||
|
||||
|
|
@ -701,4 +700,10 @@ static inline void FILE_NAME(ivl_expr_t expr, const LineInfo*info)
|
|||
expr->lineno = info->get_lineno();
|
||||
}
|
||||
|
||||
static inline void FILE_NAME(ivl_lpm_t lpm, const LineInfo*info)
|
||||
{
|
||||
lpm->file = info->get_file();
|
||||
lpm->lineno = info->get_lineno();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1958,7 +1958,9 @@ static void draw_type_string_of_nex(ivl_nexus_t nex)
|
|||
static void draw_lpm_sfunc(ivl_lpm_t net)
|
||||
{
|
||||
unsigned idx;
|
||||
fprintf(vvp_out, "L_%p .sfunc \"%s\"", net, ivl_lpm_string(net));
|
||||
fprintf(vvp_out, "L_%p .sfunc %u %u \"%s\"", net,
|
||||
ivl_file_table_get(ivl_lpm_file(net)), ivl_lpm_lineno(net),
|
||||
ivl_lpm_string(net));
|
||||
|
||||
/* Print the function type descriptor string. */
|
||||
fprintf(vvp_out, ", \"");
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ extern void compile_reduce_xnor(char*label, struct symb_s arg);
|
|||
extern void compile_extend_signed(char*label, long width, struct symb_s arg);
|
||||
|
||||
extern void compile_sfunc(char*label, char*name, char*format_string,
|
||||
long file_idx, long line_no,
|
||||
unsigned argc, struct symb_s*argv);
|
||||
extern void compile_repeat(char*label, long width, long repeat,
|
||||
struct symb_s arg);
|
||||
|
|
|
|||
|
|
@ -379,12 +379,13 @@ statement
|
|||
{ compile_extend_signed($1, $3, $5); }
|
||||
|
||||
/* System function call */
|
||||
| T_LABEL K_SFUNC T_STRING ',' T_STRING ',' symbols ';'
|
||||
{ compile_sfunc($1, $3, $5, $7.cnt, $7.vect); }
|
||||
| T_LABEL K_SFUNC T_NUMBER T_NUMBER T_STRING ',' T_STRING ','
|
||||
symbols ';'
|
||||
{ compile_sfunc($1, $5, $7, $3, $4, $9.cnt, $9.vect); }
|
||||
|
||||
/* System function call - no arguments */
|
||||
| T_LABEL K_SFUNC T_STRING ',' T_STRING ';'
|
||||
{ compile_sfunc($1, $3, $5, 0, NULL); }
|
||||
| T_LABEL K_SFUNC T_NUMBER T_NUMBER T_STRING ',' T_STRING ';'
|
||||
{ compile_sfunc($1, $5, $7, $3, $4, 0, NULL); }
|
||||
|
||||
/* Shift nodes. */
|
||||
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ static int make_vpi_argv(unsigned argc, vpiHandle*vpi_argv,
|
|||
|
||||
|
||||
void compile_sfunc(char*label, char*name, char*format_string,
|
||||
long file_idx, long line_no,
|
||||
unsigned argc, struct symb_s*argv)
|
||||
{
|
||||
vpiHandle*vpi_argv = new vpiHandle[argc];
|
||||
|
|
@ -136,7 +137,7 @@ void compile_sfunc(char*label, char*name, char*format_string,
|
|||
vvp_net_t*ptr = new vvp_net_t;
|
||||
|
||||
vpiHandle sys = vpip_build_vpi_call(name, 0, width_code, ptr,
|
||||
argc, vpi_argv, 0, 0);
|
||||
argc, vpi_argv, file_idx, line_no);
|
||||
assert(sys);
|
||||
|
||||
/* Create and connect the functor to the label. */
|
||||
|
|
|
|||
Loading…
Reference in New Issue