Add $rtoi to system func. table and add check for NULL name.
System functions used in a continuous assignment must be defined in the system function table since the name of the system functions is kept in this definition. The default name is NULL which causes problems. This patch add $rtoi to the system table and adds a check for a NULL name.
This commit is contained in:
parent
52a346ab38
commit
592a303ce5
|
|
@ -1400,9 +1400,12 @@ NetNet* PECallFunction::elaborate_net_sfunc_(Design*des, NetScope*scope,
|
|||
|
||||
const struct sfunc_return_type*def = lookup_sys_func(name);
|
||||
|
||||
if (def == 0) {
|
||||
/* We cannot use the default value for system functions in a
|
||||
* continuous assignment since the function name is NULL. */
|
||||
if (def == 0 || def->name == 0) {
|
||||
cerr << get_fileline() << ": error: System function "
|
||||
<< peek_tail_name(path_) << " not defined." << endl;
|
||||
<< peek_tail_name(path_) << " not defined in system "
|
||||
"table or SFT file(s)." << endl;
|
||||
des->errors += 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
33
sys_funcs.cc
33
sys_funcs.cc
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Stephen Williams (steve@icarus.com)
|
||||
* Copyright (c) 2004-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
|
||||
|
|
@ -16,9 +16,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: sys_funcs.cc,v 1.7 2005/07/11 16:56:51 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
# include "compiler.h"
|
||||
|
|
@ -37,6 +34,7 @@ static const struct sfunc_return_type sfunc_table[] = {
|
|||
{ "$bitstoreal", IVL_VT_REAL, 1, 0 },
|
||||
{ "$itor", IVL_VT_REAL, 1, 0 },
|
||||
{ "$realtobits", IVL_VT_LOGIC, 64, 0 },
|
||||
{ "$rtoi", IVL_VT_LOGIC, 32, 0 },
|
||||
{ "$time", IVL_VT_LOGIC, 64, 0 },
|
||||
{ "$stime", IVL_VT_LOGIC, 32, 0 },
|
||||
{ "$simtime", IVL_VT_LOGIC, 64, 0 },
|
||||
|
|
@ -193,30 +191,3 @@ int load_sys_func_table(const char*path)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* $Log: sys_funcs.cc,v $
|
||||
* Revision 1.7 2005/07/11 16:56:51 steve
|
||||
* Remove NetVariable and ivl_variable_t structures.
|
||||
*
|
||||
* Revision 1.6 2004/10/04 01:10:55 steve
|
||||
* Clean up spurious trailing white space.
|
||||
*
|
||||
* Revision 1.5 2004/03/17 17:07:12 steve
|
||||
* Protect ident pragma.
|
||||
*
|
||||
* Revision 1.4 2004/03/13 05:12:36 steve
|
||||
* standard conpliant stdio.h.
|
||||
*
|
||||
* Revision 1.3 2004/03/11 06:02:58 steve
|
||||
* Verbose details for sft parsing.
|
||||
*
|
||||
* Revision 1.2 2004/03/10 04:51:24 steve
|
||||
* Add support for system function table files.
|
||||
*
|
||||
* Revision 1.1 2004/03/09 04:29:42 steve
|
||||
* Separate out the lookup_sys_func table, for eventual
|
||||
* support for function type tables.
|
||||
*
|
||||
* Remove ipal compile flags.
|
||||
*/
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue