Soft treating of multiple architectures in VHDL
In VHDL it is allowed to have multiple architectures per one entity. The proper architecture should be then chosen in a configuration block. Now, if many architectures will be found, then there will be a warning message printed. FIXME notes are added in order not to forget about changes to be done
This commit is contained in:
parent
48dc977630
commit
13519ab5c7
|
|
@ -56,20 +56,21 @@ int Entity::elaborate()
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* FIXME: the architecture for the entity should be chosen in configuration
|
||||
block (not yet implemented). Multiple architectures are allowed in general */
|
||||
if (arch_.size() > 1) {
|
||||
cerr << get_fileline() << ": sorry: "
|
||||
<< "Too many architectures for entity " << get_name()
|
||||
<< ". Architectures are:" << endl;
|
||||
<< "Multiple architectures for an entity are not yet supported"
|
||||
<< ". Architectures for entity " << get_name() << " are:" << endl;
|
||||
for (map<perm_string,Architecture*>::const_iterator cur = arch_.begin()
|
||||
; cur != arch_.end() ; ++cur) {
|
||||
cerr << get_fileline() << ": : " << cur->first
|
||||
<< " at " << cur->second->get_fileline() << endl;
|
||||
}
|
||||
|
||||
errors += 1;
|
||||
//errors += 1;
|
||||
}
|
||||
|
||||
/* FIXME: here we should look at configuration block */
|
||||
bind_arch_ = arch_.begin()->second;
|
||||
if (verbose_flag)
|
||||
cerr << "For entity " << get_name()
|
||||
|
|
|
|||
|
|
@ -42,14 +42,15 @@ void bind_architecture_to_entity(const char*ename, Architecture*arch)
|
|||
return;
|
||||
}
|
||||
|
||||
/* FIXME: entities can have multiple architectures attached to them
|
||||
This is to be configured by VHDL's configurations (not yet implemented) */
|
||||
Architecture*old_arch = idx->second->add_architecture(arch);
|
||||
if (old_arch != arch) {
|
||||
cerr << arch->get_fileline() << ": error: "
|
||||
cerr << arch->get_fileline() << ": warning: "
|
||||
<< "Architecture " << arch->get_name()
|
||||
<< " for entity " << idx->second->get_name()
|
||||
<< " for entity " << idx->first
|
||||
<< " is already defined here: " << old_arch->get_fileline() << endl;
|
||||
parse_errors += 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue