diff --git a/pform_dump.cc b/pform_dump.cc index 486df19ae..5b70b99d0 100644 --- a/pform_dump.cc +++ b/pform_dump.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2017 Stephen Williams (steve@icarus.com) + * Copyright (c) 1998-2019 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -204,7 +204,10 @@ void vector_type_t::pform_dump(ostream&fd, unsigned indent) const if (pdims.get()) { for (list::iterator cur = pdims->begin() ; cur != pdims->end() ; ++cur) { - fd << "[" << *(cur->first) << ":" << *(cur->second) << "]"; + fd << "["; + if (cur->first) fd << *(cur->first); + if (cur->second) fd << ":" << *(cur->second); + fd << "]"; } } fd << endl; @@ -548,8 +551,12 @@ void PWire::dump(ostream&out, unsigned ind) const } else { out << " port"; for (list::const_iterator cur = port_.begin() - ; cur != port_.end() ; ++cur) - out << "[" << *cur->first << ":" << *cur->second << "]"; + ; cur != port_.end() ; ++cur) { + out << "["; + if (cur->first) out << *cur->first; + if (cur->second) out << ":" << *cur->second; + out << "]"; + } } } if (net_set_) { @@ -558,8 +565,12 @@ void PWire::dump(ostream&out, unsigned ind) const } else { out << " net"; for (list::const_iterator cur = net_.begin() - ; cur != net_.end() ; ++cur) - out << "[" << *cur->first << ":" << *cur->second << "]"; + ; cur != net_.end() ; ++cur) { + out << "["; + if (cur->first) out << *cur->first; + if (cur->second) out << ":" << *cur->second; + out << "]"; + } } } @@ -710,10 +721,11 @@ void PGModule::dump(ostream&out, unsigned ind) const if (parms_) { assert(overrides_ == 0); out << "#("; - out << "." << parms_[0].name << "(" << *parms_[0].parm << ")"; - for (unsigned idx = 1 ; idx < nparms_ ; idx += 1) { - out << ", ." << parms_[idx].name << "(" << - *parms_[idx].parm << ")"; + for (unsigned idx = 0 ; idx < nparms_ ; idx += 1) { + if (idx > 0) out << ", "; + out << "." << parms_[idx].name << "("; + if (parms_[idx].parm) out << *parms_[idx].parm; + out << ")"; } out << ") "; } @@ -1738,6 +1750,7 @@ void PPackage::pform_dump(std::ostream&out) const out << "package " << pscope_name() << endl; dump_localparams_(out, 4); dump_parameters_(out, 4); + dump_typedefs_(out, 4); dump_enumerations_(out, 4); dump_wires_(out, 4); dump_tasks_(out, 4);