Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_DeviceBlock.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2014 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-----------------------------------------------------------------------------
26 // Filename : $RCSfile: N_DEV_DeviceBlock.C,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Eric R. Keiter, SNL, Parallel Computational Sciences
33 //
34 // Creation Date : 02/28/00
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.38 $
40 //
41 // Revision Date : $Date: 2014/05/19 20:00:59 $
42 //
43 // Current Owner : $Author: dgbaur $
44 //-----------------------------------------------------------------------------
45 
46 #include <Xyce_config.h>
47 
48 
49 #include <iostream>
50 
51 #include <N_DEV_DeviceBlock.h>
52 #include <N_ERH_ErrorMgr.h>
53 
54 #include <N_PDS_Comm.h>
55 
56 namespace Xyce {
57 namespace Device {
58 
59 //-----------------------------------------------------------------------------
60 // Function : ModelBlock::ModelBlock
61 // Purpose : constructor
62 // Special Notes :
63 // Scope : public
64 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
65 // Creation Date : 5/18/00
66 //-----------------------------------------------------------------------------
67 ModelBlock::ModelBlock(const std::string & name, const std::string &type, int level)
68  : name_(name),
69  level_(level),
70  type_(type),
71  netlistLocation_()
72 {}
73 
74 //-----------------------------------------------------------------------------
75 // Function : ModelBlock::ModelBlock
76 // Purpose : copy constructor
77 // Special Notes :
78 // Scope : public
79 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
80 // Creation Date : 3/16/00
81 //-----------------------------------------------------------------------------
83  : name_(right.name_),
84  type_(right.type_),
85  level_(right.level_),
86  netlistLocation_(right.netlistLocation_),
87  params(right.params)
88 {}
89 
90 //-----------------------------------------------------------------------------
91 // Function : ModelBlock::~ModelBlock
92 // Purpose : destructor
93 // Special Notes :
94 // Scope : public
95 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
96 // Creation Date : 3/16/00
97 //-----------------------------------------------------------------------------
99 {
100 }
101 
102 //-----------------------------------------------------------------------------
103 // Function : ModelBlock::operator=
104 // Purpose : "=" operator
105 // Special Notes :
106 // Scope : public
107 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
108 // Creation Date : 3/16/00
109 //-----------------------------------------------------------------------------
111 {
112  name_ = right.name_;
113  type_ = right.type_;
114  level_ = right.level_;
115 
117 
118  params = right.params;
119 
120  return *this;
121 }
122 
123 //-----------------------------------------------------------------------------
124 // Function : ModelBlock::operator<<
125 // Purpose : "<<" operator
126 // Special Notes :
127 // Scope : public
128 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
129 // Creation Date : 4/06/00
130 //-----------------------------------------------------------------------------
131 std::ostream& operator<<(std::ostream & os, const ModelBlock & mb)
132 {
133  std::vector<Param>::const_iterator it_pL, end_pL;
134 
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;
139  os << " netlistLocation_: " << mb.netlistLocation_ << std::endl;
140  os << " Tagged Params" << std::endl;
141  os << " -------------" << std::endl;
142 
143  it_pL=mb.params.begin();
144  end_pL=mb.params.end();
145  for ( ; it_pL != end_pL; ++it_pL)
146  {
147  os << it_pL->tag() << "\t" << it_pL->stringValue() << std::endl;
148  }
149 
150  os << " -------------" << std::endl;
151  os << std::endl;
152 
153  return os;
154 }
155 
156 //-----------------------------------------------------------------------------
157 // Function : ModelBlock::clear
158 // Purpose : empties out the block.
159 // Special Notes :
160 // Scope : public
161 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
162 // Creation Date : 5/01/00
163 //-----------------------------------------------------------------------------
165 {
166  name_ = "";
167  type_ = "";
168  level_ = 0;
169  params.clear();
170 
171  netlistLocation_ = NetlistLocation();
172 }
173 
174 //-----------------------------------------------------------------------------
175 // Function : ModelBlock::instance
176 // Purpose :
177 // Special Notes :
178 // Scope : public
179 // Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
180 // Creation Date : 6/28/01
181 //-----------------------------------------------------------------------------
182 Packable * ModelBlock::instance() const
183 {
184  return new ModelBlock();
185 }
186 
187 //-----------------------------------------------------------------------------
188 // Function : ModelBlock::packedByteCount
189 // Purpose : Counts bytes needed to pack block
190 // Special Notes :
191 // Scope : public
192 // Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
193 // Creation Date : 6/13/00
194 //-----------------------------------------------------------------------------
196 {
197 
198  int byteCount = 0;
199 
200  int size, length, i;
201 
202  std::vector<Param>::const_iterator it_tpL;
203 
204  //----- count name
205  length = name_.length();
206  byteCount += sizeof(int);
207  byteCount += length;
208 
209  //----- count type
210  length = type_.length();
211  byteCount += sizeof(int);
212  byteCount += length;
213 
214  //----- count level
215  byteCount += sizeof(int);
216 
217  //----- count params
218  size = params.size();
219  byteCount += sizeof(int);
220  it_tpL = params.begin();
221  for (i = 0; i < size; ++i, ++it_tpL)
222  {
223  byteCount += it_tpL->packedByteCount();
224  }
225 
226  //----- count netlistFileName_
227  length = netlistLocation_.getPath().length();
228  byteCount += sizeof(int);
229  byteCount += length;
230 
231  //----- count lineNumber_
232  byteCount += sizeof(int);
233 
234  return byteCount;
235 
236 }
237 
238 //-----------------------------------------------------------------------------
239 // Function : ModelBlock::pack
240 // Purpose : Packs ModelBlock into char buffer using MPI_PACK
241 // Special Notes :
242 // Scope : public
243 // Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
244 // Creation Date : 5/24/00
245 //-----------------------------------------------------------------------------
246 void ModelBlock::pack(char * buf, int bsize, int & pos, N_PDS_Comm * comm) const
247 {
248 
249  int size, length;
250  int i;
251  std::vector<Param>::const_iterator it_tpL;
252 #ifdef Xyce_COUNT_PACKED_BYTES
253  int predictedPos = pos+packedByteCount();
254 #endif
255 
256  //----- pack name
257  length = name_.length();
258  comm->pack(&length, 1, buf, bsize, pos );
259  comm->pack( name_.c_str(), length, buf, bsize, pos );
260 
261  //----- pack type
262  length = type_.length();
263  comm->pack(&length, 1, buf, bsize, pos );
264  comm->pack( type_.c_str(), length, buf, bsize, pos );
265 
266  //----- pack level
267  comm->pack(&level_, 1, buf, bsize, pos );
268 
269  //----- pack params
270  size = params.size();
271  comm->pack(&size, 1, buf, bsize, pos );
272  it_tpL = params.begin();
273  for (i = 0; i < size; ++i, ++it_tpL)
274  {
275  it_tpL->pack( buf, bsize, pos, comm );
276  }
277 
278  //----- pack netlistFileName_
279  length = netlistLocation_.getPath().length();
280  comm->pack(&length, 1, buf, bsize, pos );
281  comm->pack( netlistLocation_.getPath().c_str(), length, buf, bsize, pos );
282 
283  //----- packlineNumber_
284  int line_number = netlistLocation_.getLineNumber();
285  comm->pack(&line_number, 1, buf, bsize, pos );
286 
287 #ifdef Xyce_DEBUG_TOPOLOGY
288  Xyce::dout() << "Packed " << pos << " bytes for ModelBlock: " <<
289  name_ << std::endl;
290 #endif
291 
292 #ifdef Xyce_COUNT_PACKED_BYTES
293  if (pos != predictedPos)
294  {
295  DevelFatal(*this, "ModelBlock::pack") << "Predicted pos does not match actual pos";
296  }
297 #endif
298 
299 }
300 
301 //-----------------------------------------------------------------------------
302 // Function : ModelBlock::unpack
303 // Purpose : Unpacks ModelBlock from char buffer using MPI_UNPACK
304 // Special Notes :
305 // Scope : public
306 // Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
307 // Creation Date : 5/24/00
308 //-----------------------------------------------------------------------------
309 void ModelBlock::unpack(char * pB, int bsize,int & pos, N_PDS_Comm * comm)
310 {
311 
312  int size, length;
313  int i;
314 
315  //----- unpack name
316  comm->unpack( pB, bsize, pos, &length, 1 );
317  name_ = std::string( (pB+pos), length);
318  pos += length;
319 
320  //----- unpack type
321  comm->unpack( pB, bsize, pos, &length, 1 );
322  type_ = std::string( (pB+pos), length);
323  pos += length;
324 
325  //----- unpack level
326  comm->unpack( pB, bsize, pos, &level_, 1 );
327 
328  //----- unpack params
329  comm->unpack( pB, bsize, pos, &size, 1 );
330  params.clear();
331  Param dp;
332  for( i = 0; i < size; ++i )
333  {
334  dp.unpack( pB, bsize, pos, comm );
335  params.push_back( dp );
336  }
337 
338  //----- unpack netlistFileName_
339  comm->unpack( pB, bsize, pos, &length, 1 );
340  netlistLocation_.setPath(std::string( (pB+pos), length));
341  pos += length;
342 
343  //----- unpack lineNumber_
344  int line_number = 0;
345  comm->unpack( pB, bsize, pos, &line_number, 1 );
346  netlistLocation_.setLineNumber(line_number);
347 
348 #ifdef Xyce_DEBUG_TOPOLOGY
349  Xyce::dout() << "Unpacked " << pos << " bytes for ModelBlock: " <<
350  name_ << std::endl;
351 #endif
352 
353 }
354 
355 //-----------------------------------------------------------------------------
356 // Function : InstanceBlock::InstanceBlock
357 // Purpose : constructor
358 // Special Notes :
359 // Scope : public
360 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
361 // Creation Date : 5/18/00
362 //-----------------------------------------------------------------------------
363 InstanceBlock::InstanceBlock (const std::string &name)
364  : name_(name),
365  modelName_(),
366  iNumNodes(0),
367  numIntVars(0),
368  numExtVars(0),
369  numStateVars(0),
370  modelFlag(0),
371  sourceFlag(0),
372  bsourceFlag(0),
373  offFlag(0),
374  off(0),
375  netlistLocation_()
376 {
377 }
378 
379 //-----------------------------------------------------------------------------
380 // Function : InstanceBlock::InstanceBlock
381 // Purpose : copy constructor
382 // Special Notes :
383 // Scope : public
384 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
385 // Creation Date : 3/16/00
386 //-----------------------------------------------------------------------------
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),
398  off (right.off),
399  netlistLocation_(right.netlistLocation_),
400  params (right.params)
401 {
402 }
403 
404 //-----------------------------------------------------------------------------
405 // Function : InstanceBlock::~InstanceBlock
406 // Purpose : destructor
407 // Special Notes :
408 // Scope : public
409 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
410 // Creation Date : 3/16/00
411 //-----------------------------------------------------------------------------
413 {
414 }
415 
416 //-----------------------------------------------------------------------------
417 // Function : InstanceBlock::operator=
418 // Purpose : "=" operator
419 // Special Notes :
420 // Scope : public
421 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
422 // Creation Date : 3/16/00
423 //-----------------------------------------------------------------------------
425 {
426  name_ = right.name_;
427  modelName_ = right.modelName_;
428  iNumNodes = right.iNumNodes;
429  numIntVars= right.numIntVars;
430  numExtVars= right.numExtVars;
431  numStateVars= right.numStateVars;
432  modelFlag = right.modelFlag;
433  sourceFlag= right.sourceFlag;
434  bsourceFlag= right.bsourceFlag;
435  offFlag = right.offFlag;
436  off = right.off;
438  params = right.params;
439 
440  return *this;
441 }
442 
443 //-----------------------------------------------------------------------------
444 // Function : InstanceBlock::clear
445 // Purpose : empties out the block.
446 // Special Notes :
447 // Scope : public
448 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
449 // Creation Date : 5/01/00
450 //-----------------------------------------------------------------------------
452 {
453  name_ = InstanceName();
454  modelName_ = "";
455  iNumNodes = 0;
456  numIntVars = 0;
457  numExtVars = 0;
458  numStateVars = 0;
459  modelFlag = 0;
460  sourceFlag = 0;
461  bsourceFlag = 0;
462  offFlag = 0;
463  off = 0;
464  netlistLocation_ = NetlistLocation();
465 
466  params.clear();
467 }
468 
469 //-----------------------------------------------------------------------------
470 // Function : InstanceBlock::operator<<
471 // Purpose : "<<" operator
472 // Special Notes :
473 // Scope : public
474 // Creator : Robert Hoekstra, SNL, Parallel Computational Sciences
475 // Creation Date : 4/06/00
476 //-----------------------------------------------------------------------------
477 std::ostream& operator<<(std::ostream & os, const InstanceBlock & ib)
478 {
479  std::vector<Param>::const_iterator it_tpL, end_tpL;
480 
481  os << "Instance Block" << std::endl;
482  os << "Name: " << ib.name_ << std::endl;
483  os << " Model: " << ib.getModelName() << 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;
493  os << " netlistLocation_: " << ib.netlistLocation_ << std::endl;
494  os << " Tagged Params" << std::endl;
495  os << " -------------" << std::endl;
496 
497  it_tpL=ib.params.begin();
498  end_tpL=ib.params.end();
499  for ( ; it_tpL != end_tpL; ++it_tpL)
500  {
501  os << it_tpL->tag() << "\t" << it_tpL->stringValue() << std::endl;
502  }
503 
504  os << " -------------" << std::endl;
505  os << std::endl;
506 
507  return os;
508 }
509 
510 //-----------------------------------------------------------------------------
511 // Function : InstanceBlock::instance
512 // Purpose :
513 // Special Notes :
514 // Scope : public
515 // Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
516 // Creation Date : 6/28/01
517 //-----------------------------------------------------------------------------
518 Packable * InstanceBlock::instance() const
519 {
520  return new InstanceBlock();
521 }
522 
523 //-----------------------------------------------------------------------------
524 // Function : InstanceBlock::packedByteCount
525 // Purpose : count bytes needed to pack block
526 // Special Notes :
527 // Scope : public
528 // Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
529 // Creation Date : 6/13/00
530 //-----------------------------------------------------------------------------
532 {
533 
534  int byteCount = 0;
535 
536  int size, length, i;
537  std::vector<Param>::const_iterator it_tpL;
538 
539  //----- count name
540  const std::string &name = getInstanceName().getEncodedName();
541  length = name.length();
542  byteCount += sizeof(int);
543  byteCount += length * sizeof(char);
544 
545  //----- count getModelName()
546  length = getModelName().length();
547  byteCount += sizeof(int);
548  byteCount += length * sizeof(char);
549 
550  //----- count params
551  size = params.size();
552  byteCount += sizeof(int);
553  it_tpL = params.begin();
554  for (i = 0; i < size; ++i, ++it_tpL)
555  {
556  byteCount += it_tpL->packedByteCount();
557  }
558 
559  //----- count iNumNodes
560  byteCount += sizeof(int);
561 
562  //----- count numIntVars
563  byteCount += sizeof(int);
564 
565  //----- countnumExtVars
566  byteCount += sizeof(int);
567 
568  //----- count numStateVars
569  byteCount += sizeof(int);
570 
571  //----- count modelFlag
572  byteCount += sizeof(int);
573 
574  //----- count sourceFlag
575  byteCount += sizeof(int);
576 
577  //----- count bsourceFlag
578  byteCount += sizeof(int);
579 
580  //----- count offFlag
581  byteCount += sizeof(int);
582 
583  //----- pack off
584  byteCount += sizeof(int);
585 
586  //----- count netlistFileName_
587  length = netlistLocation_.getPath().length();
588  byteCount += sizeof(int);
589  byteCount += length * sizeof(char);
590 
591  //----- count lineNumber_
592  byteCount += sizeof(int);
593 
594  return byteCount;
595 
596 }
597 
598 //-----------------------------------------------------------------------------
599 // Function : InstanceBlock::pack
600 // Purpose : Packs InstanceBlock into char buffer using MPI_PACK
601 // Special Notes :
602 // Scope : public
603 // Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
604 // Creation Date : 5/24/00
605 //-----------------------------------------------------------------------------
606 void InstanceBlock::pack(char * buf, int bsize, int & pos, N_PDS_Comm * comm) const
607 {
608 
609  int size, length;
610  int i;
611  std::vector<Param>::const_iterator it_tpL;
612 #ifdef Xyce_COUNT_PACKED_BYTES
613  int predictedPos = pos+packedByteCount();
614 #endif
615 
616  //----- pack name
617  const std::string &name = getInstanceName().getEncodedName();
618  length = name.length();
619  comm->pack(&length, 1, buf, bsize, pos);
620  comm->pack(name.c_str(), length, buf, bsize, pos);
621 
622  //----- pack getModelName()
623  length = getModelName().length();
624  comm->pack(&length, 1, buf, bsize, pos );
625  comm->pack( getModelName().c_str(), length, buf, bsize, pos );
626 
627  //----- pack params
628  size = params.size();
629  comm->pack(&size, 1, buf, bsize, pos );
630  it_tpL = params.begin();
631  for (i = 0; i < size; ++i, ++it_tpL)
632  {
633  it_tpL->pack( buf, bsize, pos, comm );
634  }
635 
636  //----- pack iNumNodes
637  comm->pack(&iNumNodes, 1, buf, bsize, pos );
638 
639  //----- pack numIntVars
640  comm->pack(&numIntVars, 1, buf, bsize, pos );
641 
642  //----- pack numExtVars
643  comm->pack(&numExtVars, 1, buf, bsize, pos );
644 
645  //----- pack numStateVars
646  comm->pack(&numStateVars, 1, buf, bsize, pos );
647 
648  //----- pack modelFlag
649  i = modelFlag;
650  comm->pack(&i, 1, buf, bsize, pos );
651 
652  //----- pack sourceFlag
653  i = sourceFlag;
654  comm->pack(&i, 1, buf, bsize, pos );
655 
656  //----- pack bsourceFlag
657  i = bsourceFlag;
658  comm->pack(&i, 1, buf, bsize, pos );
659 
660  //----- pack offFlag
661  i = offFlag;
662  comm->pack(&i, 1, buf, bsize, pos );
663 
664  //----- pack off
665  i = off;
666  comm->pack(&i, 1, buf, bsize, pos );
667 
668  //----- pack name
669  length = netlistLocation_.getPath().length();
670  comm->pack(&length, 1, buf, bsize, pos );
671  comm->pack( netlistLocation_.getPath().c_str(), length, buf, bsize, pos );
672 
673  //----- pack lineNumber_
674  int line_number = netlistLocation_.getLineNumber();
675  comm->pack(&line_number, 1, buf, bsize, pos );
676 
677 #ifdef Xyce_DEBUG_TOPOLOGY
678  Xyce::dout() << "Packed " << pos << " bytes for InstanceBlock: " <<
679  getInstanceName() << std::endl;
680 #endif
681 #ifdef Xyce_COUNT_PACKED_BYTES
682  if (pos != predictedPos)
683  {
684  DevelFatal(*this, "InstanceBlock::pack") << "Predicted pos does not match actual pos";
685  }
686 #endif
687 }
688 
689 //-----------------------------------------------------------------------------
690 // Function : InstanceBlock::unpack
691 // Purpose : Unpacks InstanceBlock from char buffer using MPI_UNPACK
692 // Special Notes :
693 // Scope : public
694 // Creator : Rob Hoekstra, SNL, Parallel Computational Sciences
695 // Creation Date : 5/24/00
696 //-----------------------------------------------------------------------------
697 void InstanceBlock::unpack(char * pB, int bsize, int & pos, N_PDS_Comm * comm)
698 {
699 
700  int size, length;
701  int i;
702 
703  //----- unpack name
704  comm->unpack( pB, bsize, pos, &length, 1 );
705  name_ = InstanceName(std::string( (pB+pos), length));
706  pos += length;
707 
708  //----- unpack getModelName()
709  comm->unpack( pB, bsize, pos, &length, 1 );
710  modelName_ = std::string( (pB+pos), length);
711  pos += length;
712 
713  //----- unpack params
714  comm->unpack( pB, bsize, pos, &size, 1 );
715  params.clear();
716  Param dp;
717  for( i = 0; i < size; ++i )
718  {
719  dp.unpack( pB, bsize, pos, comm );
720  params.push_back( dp );
721  }
722 
723  //----- unpack iNumNodes
724  comm->unpack( pB, bsize, pos, &iNumNodes, 1 );
725 
726  //----- unpack numIntVars
727  comm->unpack( pB, bsize, pos, &numIntVars, 1 );
728 
729  //----- unpack numExtVars
730  comm->unpack( pB, bsize, pos, &numExtVars, 1 );
731 
732  //----- unpack numStateVars
733  comm->unpack( pB, bsize, pos, &numStateVars, 1 );
734 
735  //----- unpack modelFlag
736  comm->unpack( pB, bsize, pos, &i, 1 );
737  modelFlag = ( i != 0 );
738 
739  //----- unpack sourceFlag
740  comm->unpack( pB, bsize, pos, &i, 1 );
741  sourceFlag = ( i != 0 );
742 
743  //----- unpack bsourceFlag
744  comm->unpack( pB, bsize, pos, &i, 1 );
745  bsourceFlag = ( i != 0 );
746 
747  //----- unpack offFlag
748  comm->unpack( pB, bsize, pos, &i, 1 );
749  offFlag = ( i != 0 );
750 
751  //----- unpack off
752  comm->unpack( pB, bsize, pos, &i, 1 );
753  off = ( i != 0 );
754 
755  //----- unpack netlistFileName_
756  comm->unpack( pB, bsize, pos, &length, 1 );
757  netlistLocation_.setPath(std::string( (pB+pos), length));
758  pos += length;
759 
760  //----- unpack lineNumber_
761  int line_number = 0;
762  comm->unpack( pB, bsize, pos, &line_number, 1 );
763  netlistLocation_.setLineNumber(line_number);
764 
765 #ifdef Xyce_DEBUG_TOPOLOGY
766  Xyce::dout() << "Unpacked " << pos << " bytes for InstanceBlock: " <<
767  getInstanceName() << std::endl;
768 #endif
769 
770 }
771 
772 } // namespace Device
773 } // namespace Xyce