properly handle vhdl open ports in component instantiations.
This commit is contained in:
parent
cab974c0c2
commit
41601696cc
|
|
@ -52,7 +52,10 @@ void ComponentInstantiation::dump(ostream&out, int indent) const
|
||||||
for (map<perm_string,Expression*>::const_iterator cur = port_map_.begin()
|
for (map<perm_string,Expression*>::const_iterator cur = port_map_.begin()
|
||||||
; cur != port_map_.end() ; ++cur) {
|
; cur != port_map_.end() ; ++cur) {
|
||||||
out << setw(indent+2) <<""<< cur->first << " => ..." << endl;
|
out << setw(indent+2) <<""<< cur->first << " => ..." << endl;
|
||||||
cur->second->dump(out, indent+6);
|
if (cur->second)
|
||||||
|
cur->second->dump(out, indent+6);
|
||||||
|
else
|
||||||
|
out << setw(indent+6) <<""<< "OPEN" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ int Architecture::Statement::elaborate(Entity*, Architecture*)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ComponentInstantiation::elaborate(Entity*, Architecture*arc)
|
int ComponentInstantiation::elaborate(Entity*ent, Architecture*arc)
|
||||||
{
|
{
|
||||||
int errors = 0;
|
int errors = 0;
|
||||||
|
|
||||||
|
|
@ -65,6 +65,11 @@ int ComponentInstantiation::elaborate(Entity*, Architecture*arc)
|
||||||
errors += 1;
|
errors += 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* It is possible for the port to be explicitly
|
||||||
|
unconnected. In that case, the Expression will be nil */
|
||||||
|
if (cur->second)
|
||||||
|
cur->second->elaborate_expr(ent, arc, iport->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,9 @@ int ComponentInstantiation::emit(ostream&out, Entity*ent, Architecture*arc)
|
||||||
const char*comma = "";
|
const char*comma = "";
|
||||||
for (map<perm_string,Expression*>::iterator cur = port_map_.begin()
|
for (map<perm_string,Expression*>::iterator cur = port_map_.begin()
|
||||||
; cur != port_map_.end() ; ++cur) {
|
; cur != port_map_.end() ; ++cur) {
|
||||||
|
// Skip unconnected ports
|
||||||
|
if (cur->second == 0)
|
||||||
|
continue;
|
||||||
out << comma << "." << cur->first << "(";
|
out << comma << "." << cur->first << "(";
|
||||||
errors += cur->second->emit(out, ent, arc);
|
errors += cur->second->emit(out, ent, arc);
|
||||||
out << ")";
|
out << ")";
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ not, GN_KEYWORD_2008, K_not
|
||||||
null, GN_KEYWORD_2008, K_null
|
null, GN_KEYWORD_2008, K_null
|
||||||
of, GN_KEYWORD_2008, K_of
|
of, GN_KEYWORD_2008, K_of
|
||||||
on, GN_KEYWORD_2008, K_on
|
on, GN_KEYWORD_2008, K_on
|
||||||
|
open, GN_KEYWORD_2008, K_open
|
||||||
or, GN_KEYWORD_2008, K_or
|
or, GN_KEYWORD_2008, K_or
|
||||||
others, GN_KEYWORD_2008, K_others
|
others, GN_KEYWORD_2008, K_others
|
||||||
out, GN_KEYWORD_2008, K_out
|
out, GN_KEYWORD_2008, K_out
|
||||||
|
|
|
||||||
|
|
@ -287,8 +287,9 @@ association_element
|
||||||
$$ = tmp;
|
$$ = tmp;
|
||||||
}
|
}
|
||||||
| IDENTIFIER ARROW K_open
|
| IDENTIFIER ARROW K_open
|
||||||
{ sorrymsg(@3, "Port map \"open\" not supported.\n");
|
{ named_expr_t*tmp = new named_expr_t(lex_strings.make($1), 0);
|
||||||
$$ = 0;
|
delete[]$1;
|
||||||
|
$$ = tmp;
|
||||||
}
|
}
|
||||||
| IDENTIFIER ARROW error
|
| IDENTIFIER ARROW error
|
||||||
{ errormsg(@3, "Invalid target for port map association.\n");
|
{ errormsg(@3, "Invalid target for port map association.\n");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue