Add support for named events in packages.
This commit is contained in:
parent
1e26a808ad
commit
b0142a6406
|
|
@ -725,6 +725,7 @@ bool PPackage::elaborate_scope(Design*des, NetScope*scope)
|
|||
elaborate_scope_classes(des, scope, classes_lexical);
|
||||
elaborate_scope_funcs(des, scope, funcs);
|
||||
elaborate_scope_tasks(des, scope, tasks);
|
||||
elaborate_scope_events_(des, scope, events);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
8
parse.y
8
parse.y
|
|
@ -1056,6 +1056,9 @@ data_declaration /* IEEE1800-2005: A.2.1.3 */
|
|||
}
|
||||
pform_makewire(@2, 0, str_strength, $3, NetNet::IMPLICIT_REG, data_type);
|
||||
}
|
||||
| attribute_list_opt K_event event_variable_list ';'
|
||||
{ if ($3) pform_make_events($3, @2.text, @2.first_line);
|
||||
}
|
||||
;
|
||||
|
||||
data_type /* IEEE1800-2005: A.2.2.1 */
|
||||
|
|
@ -3174,7 +3177,8 @@ clocking_event_opt /* */
|
|||
|
||||
event_control /* A.K.A. clocking_event */
|
||||
: '@' hierarchy_identifier
|
||||
{ PEIdent*tmpi = new PEIdent(*$2);
|
||||
{ PEIdent*tmpi = pform_new_ident(@2, *$2);
|
||||
FILE_NAME(tmpi, @2);
|
||||
PEEvent*tmpe = new PEEvent(PEEvent::ANYEDGE, tmpi);
|
||||
PEventStatement*tmps = new PEventStatement(tmpe);
|
||||
FILE_NAME(tmps, @1);
|
||||
|
|
@ -6403,7 +6407,7 @@ statement_item /* This is roughly statement_item in the LRM */
|
|||
$$ = tmp;
|
||||
}
|
||||
| K_TRIGGER hierarchy_identifier ';'
|
||||
{ PTrigger*tmp = new PTrigger(*$2);
|
||||
{ PTrigger*tmp = pform_new_trigger(@2, *$2);
|
||||
FILE_NAME(tmp, @1);
|
||||
delete $2;
|
||||
$$ = tmp;
|
||||
|
|
|
|||
8
pform.cc
8
pform.cc
|
|
@ -730,6 +730,14 @@ PEIdent* pform_new_ident(const struct vlltype&loc, const pform_name_t&name)
|
|||
return new PEIdent(name);
|
||||
}
|
||||
|
||||
PTrigger* pform_new_trigger(const struct vlltype&loc, const pform_name_t&name)
|
||||
{
|
||||
if (gn_system_verilog() && name.size() == 1)
|
||||
check_potential_imports(loc, name.back().name);
|
||||
|
||||
return new PTrigger(name);
|
||||
}
|
||||
|
||||
PGenerate* pform_parent_generate(void)
|
||||
{
|
||||
return pform_cur_generate;
|
||||
|
|
|
|||
2
pform.h
2
pform.h
|
|
@ -248,6 +248,8 @@ extern void pform_add_modport_port(const struct vlltype&loc,
|
|||
*/
|
||||
extern PEIdent* pform_new_ident(const struct vlltype&loc, const pform_name_t&name);
|
||||
|
||||
extern PTrigger* pform_new_trigger(const struct vlltype&loc, const pform_name_t&name);
|
||||
|
||||
/*
|
||||
* Enter/exit name scopes. The push_scope function pushes the scope
|
||||
* name string onto the scope hierarchy. The pop pulls it off and
|
||||
|
|
|
|||
Loading…
Reference in New Issue