46 #include <Xyce_config.h>
52 #include <N_ERH_ErrorMgr.h>
54 #include <N_PDS_Comm.h>
86 netlistLocation_(right.netlistLocation_),
133 std::vector<Param>::const_iterator it_pL, end_pL;
135 os <<
"Model Block" << std::endl;
136 os <<
"Model: " << mb.
name_ << std::endl;
137 os <<
" type: " << mb.
type_ << std::endl;
138 os <<
" Level: " << mb.
level_ << std::endl;
140 os <<
" Tagged Params" << std::endl;
141 os <<
" -------------" << std::endl;
145 for ( ; it_pL != end_pL; ++it_pL)
147 os << it_pL->tag() <<
"\t" << it_pL->stringValue() << std::endl;
150 os <<
" -------------" << std::endl;
202 std::vector<Param>::const_iterator it_tpL;
205 length =
name_.length();
206 byteCount +=
sizeof(int);
210 length =
type_.length();
211 byteCount +=
sizeof(int);
215 byteCount +=
sizeof(int);
219 byteCount +=
sizeof(int);
221 for (i = 0; i < size; ++i, ++it_tpL)
223 byteCount += it_tpL->packedByteCount();
228 byteCount +=
sizeof(int);
232 byteCount +=
sizeof(int);
251 std::vector<Param>::const_iterator it_tpL;
252 #ifdef Xyce_COUNT_PACKED_BYTES
257 length =
name_.length();
258 comm->pack(&length, 1, buf, bsize, pos );
259 comm->pack(
name_.c_str(), length, buf, bsize, pos );
262 length =
type_.length();
263 comm->pack(&length, 1, buf, bsize, pos );
264 comm->pack(
type_.c_str(), length, buf, bsize, pos );
267 comm->pack(&
level_, 1, buf, bsize, pos );
271 comm->pack(&size, 1, buf, bsize, pos );
273 for (i = 0; i < size; ++i, ++it_tpL)
275 it_tpL->pack( buf, bsize, pos, comm );
280 comm->pack(&length, 1, buf, bsize, pos );
285 comm->pack(&line_number, 1, buf, bsize, pos );
287 #ifdef Xyce_DEBUG_TOPOLOGY
288 Xyce::dout() <<
"Packed " << pos <<
" bytes for ModelBlock: " <<
292 #ifdef Xyce_COUNT_PACKED_BYTES
293 if (pos != predictedPos)
295 DevelFatal(*
this,
"ModelBlock::pack") <<
"Predicted pos does not match actual pos";
316 comm->unpack( pB, bsize, pos, &length, 1 );
317 name_ = std::string( (pB+pos), length);
321 comm->unpack( pB, bsize, pos, &length, 1 );
322 type_ = std::string( (pB+pos), length);
326 comm->unpack( pB, bsize, pos, &
level_, 1 );
329 comm->unpack( pB, bsize, pos, &size, 1 );
332 for( i = 0; i < size; ++i )
334 dp.
unpack( pB, bsize, pos, comm );
339 comm->unpack( pB, bsize, pos, &length, 1 );
345 comm->unpack( pB, bsize, pos, &line_number, 1 );
348 #ifdef Xyce_DEBUG_TOPOLOGY
349 Xyce::dout() <<
"Unpacked " << pos <<
" bytes for ModelBlock: " <<
388 : name_ (right.name_),
389 modelName_(right.modelName_),
390 iNumNodes (right.iNumNodes),
391 numIntVars(right.numIntVars),
392 numExtVars(right.numExtVars),
393 numStateVars(right.numStateVars),
394 modelFlag (right.modelFlag),
395 sourceFlag(right.sourceFlag),
396 bsourceFlag(right.bsourceFlag),
397 offFlag (right.offFlag),
399 netlistLocation_(right.netlistLocation_),
400 params (right.params)
479 std::vector<Param>::const_iterator it_tpL, end_tpL;
481 os <<
"Instance Block" << std::endl;
482 os <<
"Name: " << ib.
name_ << std::endl;
484 os <<
" # Nodes: " << ib.
iNumNodes << std::endl;
485 os <<
" # Int Vars: " << ib.
numIntVars << std::endl;
486 os <<
" # Ext Vars: " << ib.
numExtVars << std::endl;
487 os <<
" # State Vars: " << ib.
numStateVars << std::endl;
488 os <<
" modelFlag: " << ib.
modelFlag << std::endl;
489 os <<
" sourceFlag: " << ib.
sourceFlag << std::endl;
490 os <<
" bsourceFlag: " << ib.
bsourceFlag << std::endl;
491 os <<
" offFlag: " << ib.
offFlag << std::endl;
492 os <<
" off: " << ib.
off << std::endl;
494 os <<
" Tagged Params" << std::endl;
495 os <<
" -------------" << std::endl;
499 for ( ; it_tpL != end_tpL; ++it_tpL)
501 os << it_tpL->tag() <<
"\t" << it_tpL->stringValue() << std::endl;
504 os <<
" -------------" << std::endl;
537 std::vector<Param>::const_iterator it_tpL;
541 length = name.length();
542 byteCount +=
sizeof(int);
543 byteCount += length *
sizeof(char);
547 byteCount +=
sizeof(int);
548 byteCount += length *
sizeof(char);
552 byteCount +=
sizeof(int);
554 for (i = 0; i < size; ++i, ++it_tpL)
556 byteCount += it_tpL->packedByteCount();
560 byteCount +=
sizeof(int);
563 byteCount +=
sizeof(int);
566 byteCount +=
sizeof(int);
569 byteCount +=
sizeof(int);
572 byteCount +=
sizeof(int);
575 byteCount +=
sizeof(int);
578 byteCount +=
sizeof(int);
581 byteCount +=
sizeof(int);
584 byteCount +=
sizeof(int);
588 byteCount +=
sizeof(int);
589 byteCount += length *
sizeof(char);
592 byteCount +=
sizeof(int);
611 std::vector<Param>::const_iterator it_tpL;
612 #ifdef Xyce_COUNT_PACKED_BYTES
618 length = name.length();
619 comm->pack(&length, 1, buf, bsize, pos);
620 comm->pack(name.c_str(), length, buf, bsize, pos);
624 comm->pack(&length, 1, buf, bsize, pos );
625 comm->pack(
getModelName().c_str(), length, buf, bsize, pos );
629 comm->pack(&size, 1, buf, bsize, pos );
631 for (i = 0; i < size; ++i, ++it_tpL)
633 it_tpL->pack( buf, bsize, pos, comm );
637 comm->pack(&
iNumNodes, 1, buf, bsize, pos );
650 comm->pack(&i, 1, buf, bsize, pos );
654 comm->pack(&i, 1, buf, bsize, pos );
658 comm->pack(&i, 1, buf, bsize, pos );
662 comm->pack(&i, 1, buf, bsize, pos );
666 comm->pack(&i, 1, buf, bsize, pos );
670 comm->pack(&length, 1, buf, bsize, pos );
675 comm->pack(&line_number, 1, buf, bsize, pos );
677 #ifdef Xyce_DEBUG_TOPOLOGY
678 Xyce::dout() <<
"Packed " << pos <<
" bytes for InstanceBlock: " <<
681 #ifdef Xyce_COUNT_PACKED_BYTES
682 if (pos != predictedPos)
684 DevelFatal(*
this,
"InstanceBlock::pack") <<
"Predicted pos does not match actual pos";
704 comm->unpack( pB, bsize, pos, &length, 1 );
709 comm->unpack( pB, bsize, pos, &length, 1 );
714 comm->unpack( pB, bsize, pos, &size, 1 );
717 for( i = 0; i < size; ++i )
719 dp.
unpack( pB, bsize, pos, comm );
724 comm->unpack( pB, bsize, pos, &
iNumNodes, 1 );
727 comm->unpack( pB, bsize, pos, &
numIntVars, 1 );
730 comm->unpack( pB, bsize, pos, &
numExtVars, 1 );
736 comm->unpack( pB, bsize, pos, &i, 1 );
740 comm->unpack( pB, bsize, pos, &i, 1 );
744 comm->unpack( pB, bsize, pos, &i, 1 );
748 comm->unpack( pB, bsize, pos, &i, 1 );
752 comm->unpack( pB, bsize, pos, &i, 1 );
756 comm->unpack( pB, bsize, pos, &length, 1 );
762 comm->unpack( pB, bsize, pos, &line_number, 1 );
765 #ifdef Xyce_DEBUG_TOPOLOGY
766 Xyce::dout() <<
"Unpacked " << pos <<
" bytes for InstanceBlock: " <<