elaborate_sig for generated case items
Handle elaborate_sig for scopes that are within a case-generated scheme.
This commit is contained in:
parent
b5ef6d7a37
commit
52ac96ca15
|
|
@ -839,7 +839,7 @@ void NetForever::dump(ostream&o, unsigned ind) const
|
||||||
|
|
||||||
void NetFuncDef::dump(ostream&o, unsigned ind) const
|
void NetFuncDef::dump(ostream&o, unsigned ind) const
|
||||||
{
|
{
|
||||||
o << setw(ind) << "" << "function " << scope_path(scope_) << endl;
|
o << setw(ind) << "" << "function definition for " << scope_path(scope_) << endl;
|
||||||
if (result_sig_)
|
if (result_sig_)
|
||||||
o << setw(ind+2) << "" << "Return signal: "
|
o << setw(ind+2) << "" << "Return signal: "
|
||||||
<< result_sig_->name() << endl;
|
<< result_sig_->name() << endl;
|
||||||
|
|
|
||||||
26
elab_sig.cc
26
elab_sig.cc
|
|
@ -238,6 +238,27 @@ bool PGenerate::elaborate_sig(Design*des, NetScope*container) const
|
||||||
{
|
{
|
||||||
bool flag = true;
|
bool flag = true;
|
||||||
|
|
||||||
|
// Handle the special case that this is a CASE scheme. In this
|
||||||
|
// case the PGenerate itself does not have the generated
|
||||||
|
// item. Look instead for the case ITEM that has a scope
|
||||||
|
// generated for it.
|
||||||
|
if (scheme_type == PGenerate::GS_CASE) {
|
||||||
|
if (debug_elaborate)
|
||||||
|
cerr << get_fileline() << ": debug: generate case"
|
||||||
|
<< " elaborate_sig in scope "
|
||||||
|
<< scope_path(container) << "." << endl;
|
||||||
|
|
||||||
|
typedef list<PGenerate*>::const_iterator generate_it_t;
|
||||||
|
for (generate_it_t cur = generates.begin()
|
||||||
|
; cur != generates.end() ; cur ++) {
|
||||||
|
PGenerate*item = *cur;
|
||||||
|
if (! item->scope_list_.empty()) {
|
||||||
|
flag &= item->elaborate_sig(des, container);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
typedef list<NetScope*>::const_iterator scope_list_it_t;
|
typedef list<NetScope*>::const_iterator scope_list_it_t;
|
||||||
for (scope_list_it_t cur = scope_list_.begin()
|
for (scope_list_it_t cur = scope_list_.begin()
|
||||||
; cur != scope_list_.end() ; cur ++ ) {
|
; cur != scope_list_.end() ; cur ++ ) {
|
||||||
|
|
@ -423,6 +444,11 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
|
||||||
if (ret_sig) def = new NetFuncDef(scope, ret_sig, ports);
|
if (ret_sig) def = new NetFuncDef(scope, ret_sig, ports);
|
||||||
|
|
||||||
assert(def);
|
assert(def);
|
||||||
|
if (debug_elaborate)
|
||||||
|
cerr << get_fileline() << ": debug: "
|
||||||
|
<< "Attach function definition to scope "
|
||||||
|
<< scope_path(scope) << "." << endl;
|
||||||
|
|
||||||
scope->set_func_def(def);
|
scope->set_func_def(def);
|
||||||
|
|
||||||
// Look for further signals in the sub-statement
|
// Look for further signals in the sub-statement
|
||||||
|
|
|
||||||
|
|
@ -3050,6 +3050,7 @@ void PFunction::elaborate(Design*des, NetScope*scope) const
|
||||||
cerr << get_fileline() << ": internal error: "
|
cerr << get_fileline() << ": internal error: "
|
||||||
<< "No function definition for function "
|
<< "No function definition for function "
|
||||||
<< scope_path(scope) << endl;
|
<< scope_path(scope) << endl;
|
||||||
|
des->errors += 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue