Fix some errors in pform dumps.

This commit is contained in:
Martin Whitaker 2019-12-22 11:26:13 +00:00
parent 732a763188
commit e8e2c35df0
1 changed files with 23 additions and 10 deletions

View File

@ -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<pform_range_t>::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<pform_range_t>::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<pform_range_t>::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);