From 13519ab5c75f8c8b2f718e874aaa66f7a39abf8b Mon Sep 17 00:00:00 2001 From: Pawel Szostek Date: Wed, 23 Mar 2011 10:27:32 +0100 Subject: [PATCH] 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 --- vhdlpp/entity_elaborate.cc | 11 ++++++----- vhdlpp/parse_misc.cc | 7 ++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/vhdlpp/entity_elaborate.cc b/vhdlpp/entity_elaborate.cc index c22b8c57d..47e38fcac 100644 --- a/vhdlpp/entity_elaborate.cc +++ b/vhdlpp/entity_elaborate.cc @@ -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::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() diff --git a/vhdlpp/parse_misc.cc b/vhdlpp/parse_misc.cc index 2bd78e6e5..5fc268ca2 100644 --- a/vhdlpp/parse_misc.cc +++ b/vhdlpp/parse_misc.cc @@ -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; } }