Merge branch 'primitive_redefinition' of https://github.com/thasti/iverilog

- make primitive redefinition a warning, not an error
- make edge-sensitive ifnone a warning, not an error

This allows Icarus to be used to simulate designs using third-party
cell libraries that contain such things.
This commit is contained in:
Martin Whitaker 2019-07-23 21:46:30 +01:00
commit acdd78db7d
4 changed files with 8 additions and 2 deletions

View File

@ -5782,7 +5782,7 @@ specify_item
pform_module_specify_path(tmp);
}
| K_ifnone specify_edge_path_decl ';'
{ yyerror(@1, "Sorry: ifnone with an edge-sensitive path is "
{ yywarn(@1, "Sorry: ifnone with an edge-sensitive path is "
"not supported.");
yyerrok;
}

View File

@ -39,6 +39,11 @@ std::ostream& operator << (std::ostream&o, const YYLTYPE&loc)
return o;
}
void VLwarn(const char*msg)
{
warn_count += 1;
cerr << yylloc.text << ":" << yylloc.first_line << ": " << msg << endl;
}
void VLerror(const char*msg)
{

View File

@ -59,6 +59,7 @@ extern int VLlex();
extern void VLerror(const char*msg);
extern void VLerror(const YYLTYPE&loc, const char*msg, ...) __attribute__((format(printf,2,3)));
#define yywarn VLwarn
extern void VLwarn(const char*msg);
extern void VLwarn(const YYLTYPE&loc, const char*msg);
extern void destroy_lexor();

View File

@ -1847,7 +1847,7 @@ void pform_make_udp(perm_string name, list<perm_string>*parms,
// Put the primitive into the primitives table
if (pform_primitives[name]) {
VLerror("UDP primitive already exists.");
VLwarn("UDP primitive already exists.");
} else {
PUdp*udp = new PUdp(name, parms->size());