From c278b4e41ff71db8e8d3f64a955d9ce83673f73f Mon Sep 17 00:00:00 2001 From: Cary R Date: Fri, 14 Nov 2008 15:20:01 -0800 Subject: [PATCH] Add support for arrayed instances with inout ports. A NetTran (TRAN_VP) can be used to connect arrayed instance inout ports. This allows bi-directionality and conflict resolution. --- elaborate.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/elaborate.cc b/elaborate.cc index bbf1e78c4..6875ed8e9 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -1440,11 +1440,23 @@ v NOTE that this also handles the case that the spin += sp->vector_width(); } break; + case NetNet::PINOUT: - cerr << get_fileline() << ": XXXX: " - << "Forgot how to bind inout ports!" << endl; - des->errors += 1; + for (unsigned ldx = 0 ; ldx < prts.size() ; ldx += 1) { + NetNet*sp = prts[prts.size()-ldx-1]; + NetTran*ttmp = new NetTran(scope, + scope->local_symbol(), + sig->vector_width(), + sp->vector_width(), + spin); + des->add_node(ttmp); + ttmp->set_line(*this); + connect(ttmp->pin(0), sig->pin(0)); + connect(ttmp->pin(1), sp->pin(0)); + spin += sp->vector_width(); + } break; + case NetNet::PIMPLICIT: cerr << get_fileline() << ": internal error: " << "Unexpected IMPLICIT port" << endl;