Fix for GitHub issue #104 - assigning hierarchical signal from top level task.
When emitting a design, all scopes must be emitted before emitting any top level task/function/method definitions, otherwise hierarchical references can't always be resolved.
This commit is contained in:
parent
7d5f6c551a
commit
2bc42fc6e2
8
emit.cc
8
emit.cc
|
|
@ -513,7 +513,6 @@ int Design::emit(struct target_t*tgt) const
|
||||||
for (map<NetScope*,PTaskFunc*>::const_iterator scope = root_tasks_.begin()
|
for (map<NetScope*,PTaskFunc*>::const_iterator scope = root_tasks_.begin()
|
||||||
; scope != root_tasks_.end() ; ++ scope) {
|
; scope != root_tasks_.end() ; ++ scope) {
|
||||||
scope->first->emit_scope(tgt);
|
scope->first->emit_scope(tgt);
|
||||||
scope->first->emit_defs(tgt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// enumerate package scopes
|
// enumerate package scopes
|
||||||
|
|
@ -527,7 +526,6 @@ int Design::emit(struct target_t*tgt) const
|
||||||
const NetScope*use_scope = cur->second->class_scope();
|
const NetScope*use_scope = cur->second->class_scope();
|
||||||
cur->second->emit_scope(tgt);
|
cur->second->emit_scope(tgt);
|
||||||
tgt->class_type(use_scope, cur->second);
|
tgt->class_type(use_scope, cur->second);
|
||||||
cur->second->emit_defs(tgt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// enumerate root scopes
|
// enumerate root scopes
|
||||||
|
|
@ -554,6 +552,12 @@ int Design::emit(struct target_t*tgt) const
|
||||||
|
|
||||||
// emit task and function definitions
|
// emit task and function definitions
|
||||||
bool tasks_rc = true;
|
bool tasks_rc = true;
|
||||||
|
for (map<NetScope*,PTaskFunc*>::const_iterator scope = root_tasks_.begin()
|
||||||
|
; scope != root_tasks_.end() ; ++ scope)
|
||||||
|
tasks_rc &= scope->first->emit_defs(tgt);
|
||||||
|
for (map<perm_string,netclass_t*>::const_iterator cur = classes_.begin()
|
||||||
|
; cur != classes_.end() ; ++cur)
|
||||||
|
tasks_rc &= cur->second->emit_defs(tgt);
|
||||||
for (map<perm_string,NetScope*>::const_iterator scope = packages_.begin()
|
for (map<perm_string,NetScope*>::const_iterator scope = packages_.begin()
|
||||||
; scope != packages_.end() ; ++ scope )
|
; scope != packages_.end() ; ++ scope )
|
||||||
tasks_rc &= scope->second->emit_defs(tgt);
|
tasks_rc &= scope->second->emit_defs(tgt);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue