OpenASIP  2.0
ViewBEM.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file ViewBEM.cc
26  *
27  * Implements the viewbem application which prints out human readable
28  * information of given binary encoding map.
29  *
30  * @author Lasse Laasonen 2006 (lasse.laasonen-no.spam-tut.fi)
31  * @note rating: red
32  */
33 
34 #include <iostream>
35 #include <string>
36 
38 
39 #include "BEMSerializer.hh"
40 #include "BinaryEncoding.hh"
41 #include "ImmediateControlField.hh"
42 #include "MoveSlot.hh"
43 #include "ImmediateSlotField.hh"
44 #include "LImmDstRegisterField.hh"
45 #include "GuardField.hh"
46 #include "DestinationField.hh"
47 #include "SourceField.hh"
48 #include "GPRGuardEncoding.hh"
49 #include "FUGuardEncoding.hh"
51 #include "ImmediateEncoding.hh"
52 #include "BridgeEncoding.hh"
53 #include "NOPEncoding.hh"
54 #include "SocketEncoding.hh"
55 #include "SocketCodeTable.hh"
56 #include "FUPortCode.hh"
57 #include "RFPortCode.hh"
58 #include "IUPortCode.hh"
59 #include "Conversion.hh"
60 #include "FileSystem.hh"
61 
62 using std::cerr;
63 using std::cout;
64 using std::endl;
65 using std::string;
66 
67 static void
68 printBEMInfo(const BinaryEncoding& bem, const std::string& bemFile);
69 static void
71 static void
73 static void
75 static void
76 printMoveSlot(const MoveSlot& moveSlot);
77 static void
78 printMoveSlotLayout(const MoveSlot& moveSlot);
79 static void
80 printGuardFieldEncodings(const MoveSlot& moveSlot);
81 static void
82 printSlotFieldEncodings(const SlotField& slotField);
83 static string
84 portCodeBits(const PortCode& code);
85 static string
86 portCodeDescription(const RFPortCode& code);
87 static string
88 portCodeDescription(const IUPortCode& code);
89 static string
90 portCodeDescription(const FUPortCode& code);
91 static void
92 printSourceFieldEncodings(const MoveSlot& moveSlot);
93 static void
95 static void
97 static void
98 printPattern(const std::string& pattern, int times);
99 
100 
101 /**
102  * The main function.
103  */
104 int main(int argc, char* argv[]) {
105 
107  try {
108  options.parse(argv, argc);
109  } catch (ParserStopRequest) {
110  return EXIT_SUCCESS;
111  } catch (const IllegalCommandLine& e) {
112  cerr << e.errorMessage() << endl;
113  return EXIT_FAILURE;
114  }
115 
116  string bemFile = options.bemFile();
117  if (bemFile == "") {
118  options.printHelp();
119  return EXIT_FAILURE;
120  }
121 
122  BEMSerializer serializer;
123  serializer.setSourceFile(bemFile);
124  BinaryEncoding* bem;
125  try {
126  bem = serializer.readBinaryEncoding();
127  } catch (const Exception& e) {
128  cerr << e.errorMessage() << endl;
129  return EXIT_FAILURE;
130  }
131 
132  printBEMInfo(*bem, bemFile);
133  delete bem;
134  return EXIT_SUCCESS;
135 }
136 
137 
138 /**
139  * Prints information of BEM to standard output.
140  *
141  * @param bem The BEM.
142  * @param bemFile Name of the BEM file.
143  */
144 static void
145 printBEMInfo(const BinaryEncoding& bem, const std::string& bemFile) {
146 
147  cout << "Binary Encoding Map: " << FileSystem::fileOfPath(bemFile)
148  << endl << endl;
149  cout << "X = unused bit" << endl;
150  cout << "I = immediate bit" << endl;
151  cout << "S = socket code bit" << endl;
152  cout << "R = register index bit" << endl << endl;
153 
154  cout << "Total instruction width: " << bem.width() << endl << endl;
155 
157  cout << endl;
159  cout << endl;
160  for (int i = 0; i < bem.longImmDstRegisterFieldCount(); i++) {
163  cout << endl;
164  }
165  for (int i = 0; i < bem.moveSlotCount(); i++) {
166  MoveSlot& slot = bem.moveSlot(i);
167  printMoveSlot(slot);
168  cout << endl;
169  }
170 }
171 
172 
173 /**
174  * Prints the instruction layout of the given BEM.
175  *
176  * @param bem The BEM.
177  */
178 static void
180 
181  if (bem.childFieldCount() == 0) {
182  return;
183  }
184 
185  cout << "|";
186  for (int i = bem.childFieldCount() - 1; i >= 0; i--) {
187  InstructionField& field = bem.childField(i);
188  ImmediateControlField* icField =
189  dynamic_cast<ImmediateControlField*>(&field);
190  MoveSlot* moveSlot = dynamic_cast<MoveSlot*>(&field);
191  ImmediateSlotField* immSlot =
192  dynamic_cast<ImmediateSlotField*>(&field);
193  LImmDstRegisterField* dstRegField =
194  dynamic_cast<LImmDstRegisterField*>(&field);
195 
196  if (icField != NULL) {
197  cout << " limm cntrl: " << field.width();
198  } else if (moveSlot != NULL) {
199  cout << " move slot " << moveSlot->name() << ": "
200  << moveSlot->width();
201  } else if (immSlot != NULL) {
202  cout << " limm slot " << immSlot->name() << ": "
203  << immSlot->width();
204  } else {
205  assert(dstRegField != NULL);
206  cout << " dst reg field: " << dstRegField->width();
207  }
208  cout << " |";
209  }
210  cout << endl;
211 }
212 
213 
214 /**
215  * Prints information of immediate control field of the given BEM.
216  *
217  * @param bem The BEM.
218  */
219 static void
221 
222  if (!bem.hasImmediateControlField()) {
223  return;
224  }
225 
227  printSeparator();
228  cout << "Immediate Control Field" << endl << endl;
229  cout << "Position: " << icField.bitPosition() << endl;
230  cout << "Width: " << icField.width() << endl;
231  cout << "Encodings:" << endl;
232 
233  int encodingWidth = icField.width() - icField.extraBits();
234  string extraBits;
235  for (int i = 0; i < icField.extraBits(); i++) {
236  extraBits.append("X");
237  }
238 
239  for (int i = 0; i < icField.templateCount(); i++) {
240  string iTemp = icField.instructionTemplate(i);
241  unsigned int encoding = icField.templateEncoding(iTemp);
242  cout << extraBits << Conversion::toBinary(encoding, encodingWidth)
243  << " : " << iTemp << endl;
244  }
245 }
246 
247 
248 /**
249  * Prints information of the given long immediate destination register field.
250  *
251  * @param field The field.
252  */
253 static void
255 
256  printSeparator();
257  cout << "Long Immediate Destination Register Field" << endl << endl;
258  cout << "Position: " << field.bitPosition() << endl;
259  cout << "Width: " << field.width() << endl << endl;
260 
261  cout << "Usage" << endl;
262  for (int i = 0; i < field.instructionTemplateCount(); i++) {
263  string iTemp = field.instructionTemplate(i);
264  string iu = field.immediateUnit(iTemp);
265  cout << iTemp << ": " << iu << endl;
266  }
267 }
268 
269 
270 /**
271  * Prints information of the given move slot.
272  *
273  * @param moveSlot The move slot.
274  */
275 static void
276 printMoveSlot(const MoveSlot& moveSlot) {
277 
278  printSeparator();
279  cout << "Move Slot: " << moveSlot.name() << endl << endl;
280  cout << "Position: " << moveSlot.bitPosition() << endl;
281  cout << "Width: " << moveSlot.width() << endl << endl;
282 
283  printMoveSlotLayout(moveSlot);
284  cout << endl;
285  printGuardFieldEncodings(moveSlot);
286  cout << endl;
287  printSourceFieldEncodings(moveSlot);
288  cout << endl;
290 }
291 
292 
293 /**
294  * Prints the layout of the given move slot.
295  *
296  * @param moveSlot The move slot.
297  */
298 static void
299 printMoveSlotLayout(const MoveSlot& moveSlot) {
300  cout << "|";
301  for (int i = moveSlot.childFieldCount() - 1; i >= 0; i--) {
302  InstructionField& childField = moveSlot.childField(i);
303  GuardField* grdField = dynamic_cast<GuardField*>(&childField);
304  SourceField* srcField = dynamic_cast<SourceField*>(&childField);
305  DestinationField* dstField =
306  dynamic_cast<DestinationField*>(&childField);
307  if (grdField != NULL) {
308  cout << " grd field: " << grdField->width();
309  } else if (srcField != NULL) {
310  cout << " src field: " << srcField->width();
311  } else {
312  assert(dstField != NULL);
313  cout << " dst field: " << dstField->width();
314  }
315  cout << " |";
316  }
317  cout << endl;
318 }
319 
320 
321 /**
322  * Prints the encodings of the guard field of the given move slot.
323  *
324  * @param moveSlot The move slot.
325  */
326 static void
328 
329  if (!moveSlot.hasGuardField()) {
330  return;
331  }
332 
333  GuardField& grdField = moveSlot.guardField();
334  int encodingWidth = grdField.width() - grdField.extraBits();
335  string extraBits;
336  for (int i = 0; i < grdField.extraBits(); i++) {
337  extraBits.append("X");
338  }
339 
340  cout << "Guard field encodings:" << endl;
341  if (grdField.hasUnconditionalGuardEncoding(false)) {
343  grdField.unconditionalGuardEncoding(false);
344  cout << extraBits
345  << Conversion::toBinary(enc.encoding(), encodingWidth)
346  << " : always-true" << endl;
347  }
348  if (grdField.hasUnconditionalGuardEncoding(true)) {
350  grdField.unconditionalGuardEncoding(true);
351  cout << extraBits
352  << Conversion::toBinary(enc.encoding(), encodingWidth)
353  << " : always-false" << endl;
354  }
355  for (int i = 0; i < grdField.gprGuardEncodingCount(); i++) {
356  GPRGuardEncoding& enc = grdField.gprGuardEncoding(i);
357  cout << extraBits
358  << Conversion::toBinary(enc.encoding(), encodingWidth)
359  << " : ";
360  if (enc.isGuardInverted()) {
361  cout << "inverted ";
362  } else {
363  cout << "non-inverted ";
364  }
365  cout << "GPR " << enc.registerIndex() << " of RF "
366  << enc.registerFile() << endl;
367  }
368  for (int i = 0; i < grdField.fuGuardEncodingCount(); i++) {
369  FUGuardEncoding& enc = grdField.fuGuardEncoding(i);
370  cout << extraBits
371  << Conversion::toBinary(enc.encoding(), encodingWidth) << " : ";
372  if (enc.isGuardInverted()) {
373  cout << "inverted ";
374  } else {
375  cout << "non-inverted ";
376  }
377  cout << "port " << enc.port() << " of FU " << enc.functionUnit()
378  << endl;
379  }
380 }
381 
382 
383 /**
384  * Prints the socket and NOP encodings of the given slot field.
385  *
386  * @param slotField The source or destination field.
387  */
388 static void
390 
391  if (slotField.hasNoOperationEncoding()) {
392  NOPEncoding& enc = slotField.noOperationEncoding();
393  if (slotField.componentIDPosition() == BinaryEncoding::RIGHT) {
394  printPattern("X", slotField.width() - enc.width());
395  if (enc.width()) {
396  cout << Conversion::toBinary(enc.encoding(), enc.width());
397  }
398  } else {
399  printPattern("X", slotField.extraBits());
400  if (enc.width()) {
401  cout << Conversion::toBinary(enc.encoding(), enc.width());
402  }
403  printPattern(
404  "X",
405  slotField.width() - slotField.extraBits() - enc.width());
406  }
407  cout << " : NOP" << endl;
408  }
409 
410  for (int i = 0; i < slotField.socketEncodingCount(); i++) {
411  SocketEncoding& enc = slotField.socketEncoding(i);
412  printPattern("X", slotField.extraBits());
413  if (slotField.componentIDPosition() == BinaryEncoding::RIGHT) {
414  if (enc.hasSocketCodes()) {
415  SocketCodeTable& scTable = enc.socketCodes();
416  printPattern("S", scTable.width());
417  printPattern(
418  "X",
419  slotField.width() - slotField.extraBits() -
420  scTable.width() - enc.socketIDWidth());
421  } else {
422  printPattern(
423  "X",
424  slotField.width() - slotField.extraBits() -
425  enc.socketIDWidth());
426  }
427  if (enc.socketIDWidth()) {
428  cout <<
430  }
431  } else {
432  if (enc.socketIDWidth()) {
433  cout <<
435  }
436  if (enc.hasSocketCodes()) {
437  SocketCodeTable& scTable = enc.socketCodes();
438  printPattern(
439  "X",
440  slotField.width() - slotField.extraBits() -
441  scTable.width() - enc.socketIDWidth());
442  printPattern("S", scTable.width());
443  } else {
444  printPattern(
445  "X",
446  slotField.width() - slotField.extraBits() - enc.width());
447  }
448  }
449  cout << " : socket " << enc.socketName() << endl;
450 
451  if (enc.hasSocketCodes()) {
452  SocketCodeTable& scTable = enc.socketCodes();
453  if (slotField.componentIDPosition() == BinaryEncoding::RIGHT) {
454  for (int i = 0; i < scTable.rfPortCodeCount(); i++) {
455  printPattern(" ", slotField.extraBits());
456  RFPortCode& code = scTable.rfPortCode(i);
457  cout << portCodeBits(code);
458  printPattern(" ", enc.width() - scTable.width());
459  cout << " : " << portCodeDescription(code) << endl;
460  }
461  for (int i = 0; i < scTable.iuPortCodeCount(); i++) {
462  printPattern(" ", slotField.extraBits());
463  IUPortCode& code = scTable.iuPortCode(i);
464  cout << portCodeBits(code);
465  printPattern(" ", enc.width() - scTable.width());
466  cout << " : " << portCodeDescription(code) << endl;
467  }
468  for (int i = 0; i < scTable.fuPortCodeCount(); i++) {
469  printPattern(" ", slotField.extraBits());
470  FUPortCode& code = scTable.fuPortCode(i);
471  cout << portCodeBits(code);
472  printPattern(" ", enc.width() - scTable.width());
473  cout << " : " << portCodeDescription(code) << endl;
474  }
475  } else {
476  for (int i = 0; i < scTable.rfPortCodeCount(); i++) {
477  printPattern(" ", slotField.width() - scTable.width());
478  RFPortCode& code = scTable.rfPortCode(i);
479  cout << portCodeBits(code);
480  cout << " : " << portCodeDescription(code) << endl;
481  }
482  for (int i = 0; i < scTable.iuPortCodeCount(); i++) {
483  printPattern(" ", slotField.width() - scTable.width());
484  IUPortCode& code = scTable.iuPortCode(i);
485  cout << portCodeBits(code);
486  cout << " : " << portCodeDescription(code) << endl;
487  }
488  for (int i = 0; i < scTable.fuPortCodeCount(); i++) {
489  printPattern(" ", slotField.width() - scTable.width());
490  FUPortCode& code = scTable.fuPortCode(i);
491  cout << portCodeBits(code);
492  cout << " : " << portCodeDescription(code) << endl;
493  }
494  }
495  }
496  }
497 }
498 
499 
500 /**
501  * Returns the bit string of the given port code.
502  *
503  * @param code The port code.
504  */
505 static string
506 portCodeBits(const PortCode& code) {
507  string bits;
508  if (code.hasEncoding() && code.encodingWidth()) {
509  bits += Conversion::toBinary(
510  code.encoding(), code.encodingWidth());
511  }
512  int unusedBits = code.parent()->width() - code.width();
513  for (int i = 0; i < unusedBits; i++) {
514  bits.append("X");
515  }
516  for (int i = 0; i < code.indexWidth(); i++) {
517  bits.append("R");
518  }
519  return bits;
520 }
521 
522 
523 /**
524  * Returns description of the given port code.
525  *
526  * @param code The port code.
527  */
528 static string
530  return "RF: " + code.unitName();
531 }
532 
533 
534 /**
535  * Returns description of the given port code.
536  *
537  * @param code The port code.
538  */
539 static string
541  return "IU: " + code.unitName();
542 }
543 
544 
545 /**
546  * Returns description of the given port code.
547  *
548  * @param code The port code.
549  */
550 static string
552  string desc = "FU port: " + code.unitName() + ", " + code.portName();
553  if (code.hasOperation()) {
554  desc.append(", " + code.operationName());
555  }
556  return desc;
557 }
558 
559 
560 /**
561  * Prints the encodings of the source field of the given move slot.
562  *
563  * @param moveSlot The move slot.
564  */
565 static void
567 
568  if (!moveSlot.hasSourceField()) {
569  return;
570  }
571 
572  SourceField& srcField = moveSlot.sourceField();
573  cout << "Source field encodings:" << endl;
574  printSlotFieldEncodings(srcField);
575 
576  if (srcField.hasImmediateEncoding()) {
577  ImmediateEncoding& enc = srcField.immediateEncoding();
578  printPattern("X", srcField.extraBits());
579  if (srcField.componentIDPosition() == BinaryEncoding::LEFT) {
580  if (enc.encodingWidth()) {
581  cout << Conversion::toBinary(
582  enc.encoding(), enc.encodingWidth());
583  }
584  printPattern(
585  "X", srcField.width() - srcField.extraBits() - enc.width());
586  printPattern("I", enc.immediateWidth());
587  } else {
588  printPattern("I", enc.immediateWidth());
589  printPattern(
590  "X", srcField.width() - srcField.extraBits() - enc.width());
591  if (enc.encodingWidth()) {
592  cout << Conversion::toBinary(
593  enc.encoding(), enc.encodingWidth());
594  }
595  }
596  cout << " : short immediate" << endl;
597  }
598 
599  for (int i = 0; i < srcField.bridgeEncodingCount(); i++) {
600  BridgeEncoding& enc = srcField.bridgeEncoding(i);
601  printPattern("X", srcField.extraBits());
602  if (srcField.componentIDPosition() == BinaryEncoding::RIGHT) {
603  printPattern(
604  "X", srcField.width() - srcField.extraBits() - enc.width());
605  cout << Conversion::toBinary(enc.encoding(), enc.width());
606  } else {
607  cout << Conversion::toBinary(enc.encoding(), enc.width());
608  printPattern(
609  "X", srcField.width() - srcField.extraBits() - enc.width());
610  }
611  cout << " : bridge " << enc.bridgeName() << endl;
612  }
613 }
614 
615 
616 /**
617  * Prints the encodings of the destination field of the given move slot.
618  *
619  * @param moveSlot The move slot.
620  */
621 static void
623 
624  if (!moveSlot.hasDestinationField()) {
625  return;
626  }
627 
628  DestinationField& dstField = moveSlot.destinationField();
629  cout << "Destination field encodings:" << endl;
630  printSlotFieldEncodings(dstField);
631 }
632 
633 
634 /**
635  * Prints the separator.
636  */
637 static void
639  cout << "------------------------------------------------------------"
640  << endl;
641 }
642 
643 
644 /**
645  * Prints the given pattern the given times.
646  *
647  * @param pattern The pattern.
648  * @param times Times the pattern is written.
649  */
650 static void
651 printPattern(const std::string& pattern, int times) {
652  for (int i = 0; i < times; i++) {
653  cout << pattern;
654  }
655 }
BinaryEncoding::childFieldCount
virtual int childFieldCount() const
Definition: BinaryEncoding.cc:681
UnconditionalGuardEncoding.hh
SlotField::noOperationEncoding
NOPEncoding & noOperationEncoding() const
Definition: SlotField.cc:281
MachInfoCmdLineOptions::printHelp
virtual void printHelp() const
Definition: MachInfoCmdLineOptions.cc:89
BinaryEncoding
Definition: BinaryEncoding.hh:61
MoveSlot::name
std::string name() const
Definition: MoveSlot.cc:136
IUPortCode.hh
FileSystem.hh
FUPortCode::operationName
std::string operationName() const
Definition: FUPortCode.cc:160
InstructionField::bitPosition
int bitPosition() const
Definition: InstructionField.cc:132
ParserStopRequest
Definition: Exception.hh:491
SocketCodeTable::rfPortCodeCount
int rfPortCodeCount() const
Definition: SocketCodeTable.cc:471
PortCode
Definition: PortCode.hh:45
DestinationField
Definition: DestinationField.hh:44
MoveSlot
Definition: MoveSlot.hh:60
XMLSerializer::setSourceFile
void setSourceFile(const std::string &fileName)
Definition: XMLSerializer.cc:115
printSlotFieldEncodings
static void printSlotFieldEncodings(const SlotField &slotField)
Definition: ViewBEM.cc:389
GuardField::fuGuardEncoding
FUGuardEncoding & fuGuardEncoding(int index) const
Definition: GuardField.cc:387
portCodeDescription
static string portCodeDescription(const RFPortCode &code)
Definition: ViewBEM.cc:529
GPRGuardEncoding::registerFile
std::string registerFile() const
Definition: GPRGuardEncoding.cc:122
BinaryEncoding::longImmDstRegisterFieldCount
int longImmDstRegisterFieldCount() const
Definition: BinaryEncoding.cc:400
SocketCodeTable::fuPortCode
FUPortCode & fuPortCode(int index) const
Definition: SocketCodeTable.cc:308
GuardField.hh
SourceField::hasImmediateEncoding
bool hasImmediateEncoding() const
Definition: SourceField.cc:279
GuardEncoding::isGuardInverted
bool isGuardInverted() const
Definition: GuardEncoding.cc:101
LImmDstRegisterField::instructionTemplateCount
int instructionTemplateCount() const
Definition: LImmDstRegisterField.cc:148
BinaryEncoding::hasImmediateControlField
bool hasImmediateControlField() const
Definition: BinaryEncoding.cc:334
IUPortCode
Definition: IUPortCode.hh:41
BridgeEncoding
Definition: BridgeEncoding.hh:47
MoveSlot::hasGuardField
bool hasGuardField() const
Definition: MoveSlot.cc:202
SocketCodeTable.hh
ImmediateSlotField.hh
SocketCodeTable::rfPortCode
RFPortCode & rfPortCode(int index) const
Definition: SocketCodeTable.cc:484
RFPortCode.hh
RFPortCode
Definition: RFPortCode.hh:44
FUPortCode
Definition: FUPortCode.hh:47
GuardField
Definition: GuardField.hh:55
SocketCodeTable::fuPortCodeCount
int fuPortCodeCount() const
Definition: SocketCodeTable.cc:295
ImmediateEncoding.hh
ImmediateControlField::templateCount
int templateCount() const
Definition: ImmediateControlField.cc:124
IllegalCommandLine
Definition: Exception.hh:438
GuardField::unconditionalGuardEncoding
UnconditionalGuardEncoding & unconditionalGuardEncoding(bool inverted) const
Definition: GuardField.cc:490
SlotField::hasNoOperationEncoding
bool hasNoOperationEncoding() const
Definition: SlotField.cc:267
SocketEncoding::width
virtual int width() const
Definition: SocketEncoding.cc:276
SourceField.hh
BEMSerializer
Definition: BEMSerializer.hh:43
FUGuardEncoding
Definition: FUGuardEncoding.hh:47
SlotField::socketEncoding
SocketEncoding & socketEncoding(int index) const
Definition: SlotField.cc:170
ImmediateEncoding::width
virtual int width() const
Definition: ImmediateEncoding.cc:207
MoveSlot.hh
BridgeEncoding.hh
FileSystem::fileOfPath
static std::string fileOfPath(const std::string pathName)
Definition: FileSystem.cc:101
printMoveSlotLayout
static void printMoveSlotLayout(const MoveSlot &moveSlot)
Definition: ViewBEM.cc:299
ImmediateSlotField
Definition: ImmediateSlotField.hh:44
InstructionField
Definition: InstructionField.hh:43
SocketCodeTable
Definition: SocketCodeTable.hh:68
PortCode::unitName
std::string unitName() const
Definition: PortCode.cc:140
assert
#define assert(condition)
Definition: Application.hh:86
printPattern
static void printPattern(const std::string &pattern, int times)
Definition: ViewBEM.cc:651
GuardField::gprGuardEncoding
GPRGuardEncoding & gprGuardEncoding(int index) const
Definition: GuardField.cc:290
Encoding::width
virtual int width() const
Definition: Encoding.cc:130
MoveSlot::hasSourceField
bool hasSourceField() const
Definition: MoveSlot.cc:264
Conversion::toBinary
static std::string toBinary(unsigned int source, unsigned int stringWidth=0)
Definition: Conversion.cc:155
FUGuardEncoding::functionUnit
std::string functionUnit() const
Definition: FUGuardEncoding.cc:121
FUGuardEncoding.hh
LImmDstRegisterField::instructionTemplate
std::string instructionTemplate(int index) const
Definition: LImmDstRegisterField.cc:162
ImmediateControlField
Definition: ImmediateControlField.hh:57
ImmediateControlField::width
virtual int width() const
Definition: ImmediateControlField.cc:243
PortCode::indexWidth
int indexWidth() const
Definition: PortCode.cc:215
PortCode::width
int width() const
Definition: PortCode.cc:188
MoveSlot::guardField
GuardField & guardField() const
Definition: MoveSlot.cc:215
Conversion.hh
printImmediateControlField
static void printImmediateControlField(const BinaryEncoding &bem)
Definition: ViewBEM.cc:220
BinaryEncoding.hh
SourceField::immediateEncoding
ImmediateEncoding & immediateEncoding() const
Definition: SourceField.cc:293
MoveSlot::hasDestinationField
bool hasDestinationField() const
Definition: MoveSlot.cc:327
InstructionField::width
virtual int width() const =0
SocketCodeTable::iuPortCode
IUPortCode & iuPortCode(int index) const
Definition: SocketCodeTable.cc:600
BinaryEncoding::width
virtual int width(const TCEString &templateName) const
Definition: BinaryEncoding.cc:768
SocketEncoding::socketName
std::string socketName() const
Definition: SocketEncoding.cc:145
BinaryEncoding::LEFT
@ LEFT
Definition: BinaryEncoding.hh:64
printLImmDstRegisterField
static void printLImmDstRegisterField(const LImmDstRegisterField &field)
Definition: ViewBEM.cc:254
printMoveSlot
static void printMoveSlot(const MoveSlot &moveSlot)
Definition: ViewBEM.cc:276
LImmDstRegisterField::immediateUnit
std::string immediateUnit(const std::string &instructionTemplate) const
Definition: LImmDstRegisterField.cc:197
SlotField::width
virtual int width() const
Definition: SlotField.cc:307
SocketEncoding::hasSocketCodes
bool hasSocketCodes() const
Definition: SocketEncoding.cc:177
NOPEncoding.hh
printSeparator
static void printSeparator()
Definition: ViewBEM.cc:638
SourceField::width
virtual int width() const
Definition: SourceField.cc:308
BridgeEncoding::bridgeName
std::string bridgeName() const
Definition: BridgeEncoding.cc:134
Encoding::encoding
unsigned int encoding() const
Definition: Encoding.cc:108
GuardField::hasUnconditionalGuardEncoding
bool hasUnconditionalGuardEncoding(bool inverted) const
Definition: GuardField.cc:471
SlotField::componentIDPosition
BinaryEncoding::Position componentIDPosition() const
Definition: SlotField.cc:296
LImmDstRegisterField::width
virtual int width() const
Definition: LImmDstRegisterField.cc:213
Exception
Definition: Exception.hh:54
GuardEncoding::encoding
unsigned int encoding() const
Definition: GuardEncoding.cc:112
MoveSlot::width
virtual int width() const
Definition: MoveSlot.cc:406
MoveSlot::sourceField
SourceField & sourceField() const
Definition: MoveSlot.cc:277
ImmediateSlotField::width
virtual int width() const
Definition: ImmediateSlotField.cc:167
NOPEncoding
Definition: NOPEncoding.hh:44
printBEMInfo
static void printBEMInfo(const BinaryEncoding &bem, const std::string &bemFile)
Definition: ViewBEM.cc:145
SocketEncoding.hh
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
CmdLineOptions::parse
void parse(char *argv[], int argc)
Definition: CmdLineOptions.cc:107
GPRGuardEncoding.hh
ImmediateControlField.hh
PortCode::encodingWidth
int encodingWidth() const
Definition: PortCode.cc:204
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
ImmediateEncoding::immediateWidth
int immediateWidth() const
Definition: ImmediateEncoding.cc:144
GuardField::gprGuardEncodingCount
int gprGuardEncodingCount() const
Definition: GuardField.cc:276
ImmediateControlField::instructionTemplate
std::string instructionTemplate(int index) const
Definition: ImmediateControlField.cc:138
ImmediateSlotField::name
std::string name() const
Definition: ImmediateSlotField.cc:123
InstructionField::extraBits
int extraBits() const
Definition: InstructionField.cc:229
ImmediateEncoding::encodingWidth
int encodingWidth() const
Definition: ImmediateEncoding.cc:155
SocketEncoding::socketIDWidth
int socketIDWidth() const
Definition: SocketEncoding.cc:264
SocketCodeTable::iuPortCodeCount
int iuPortCodeCount() const
Definition: SocketCodeTable.cc:587
GuardField::fuGuardEncodingCount
int fuGuardEncodingCount() const
Definition: GuardField.cc:373
MoveSlot::childField
virtual InstructionField & childField(int position) const
Definition: MoveSlot.cc:380
BinaryEncoding::RIGHT
@ RIGHT
Definition: BinaryEncoding.hh:65
FUPortCode::hasOperation
bool hasOperation() const
Definition: FUPortCode.cc:176
SlotField
Definition: SlotField.hh:58
SourceField::bridgeEncodingCount
int bridgeEncodingCount() const
Definition: SourceField.cc:209
LImmDstRegisterField
Definition: LImmDstRegisterField.hh:47
SlotField::socketEncodingCount
int socketEncodingCount() const
Definition: SlotField.cc:156
FUGuardEncoding::port
std::string port() const
Definition: FUGuardEncoding.cc:132
printInstructionLayout
static void printInstructionLayout(const BinaryEncoding &bem)
Definition: ViewBEM.cc:179
BinaryEncoding::immediateControlField
ImmediateControlField & immediateControlField() const
Definition: BinaryEncoding.cc:348
printDestinationFieldEncodings
static void printDestinationFieldEncodings(const MoveSlot &moveSlot)
Definition: ViewBEM.cc:622
BinaryEncoding::moveSlot
MoveSlot & moveSlot(int index) const
Definition: BinaryEncoding.cc:121
PortCode::hasEncoding
bool hasEncoding() const
Definition: PortCode.cc:151
BinaryEncoding::childField
virtual InstructionField & childField(int position) const
Definition: BinaryEncoding.cc:704
MoveSlot::destinationField
DestinationField & destinationField() const
Definition: MoveSlot.cc:341
SourceField::bridgeEncoding
BridgeEncoding & bridgeEncoding(const std::string &bridge) const
Definition: SourceField.cc:191
ImmediateControlField::templateEncoding
unsigned int templateEncoding(const std::string &name) const
Definition: ImmediateControlField.cc:182
DestinationField.hh
PortCode::parent
SocketCodeTable * parent() const
Definition: PortCode.cc:226
BEMSerializer.hh
ImmediateEncoding
Definition: ImmediateEncoding.hh:44
BinaryEncoding::moveSlotCount
int moveSlotCount() const
Definition: BinaryEncoding.cc:104
GPRGuardEncoding::registerIndex
int registerIndex() const
Definition: GPRGuardEncoding.cc:133
printGuardFieldEncodings
static void printGuardFieldEncodings(const MoveSlot &moveSlot)
Definition: ViewBEM.cc:327
SocketEncoding::socketCodes
SocketCodeTable & socketCodes() const
Definition: SocketEncoding.cc:191
SocketEncoding
Definition: SocketEncoding.hh:51
GPRGuardEncoding
Definition: GPRGuardEncoding.hh:47
FUPortCode.hh
PortCode::encoding
unsigned int encoding() const
Definition: PortCode.cc:164
BinaryEncoding::longImmDstRegisterField
LImmDstRegisterField & longImmDstRegisterField(int index) const
Definition: BinaryEncoding.cc:415
UnconditionalGuardEncoding
Definition: UnconditionalGuardEncoding.hh:47
BEMViewerCmdLineOptions.hh
SocketCodeTable::width
int width() const
Definition: SocketCodeTable.cc:200
MoveSlot::childFieldCount
virtual int childFieldCount() const
Definition: MoveSlot.cc:357
LImmDstRegisterField.hh
GuardField::width
virtual int width() const
Definition: GuardField.cc:533
printSourceFieldEncodings
static void printSourceFieldEncodings(const MoveSlot &moveSlot)
Definition: ViewBEM.cc:566
BEMViewerCmdLineOptions
Definition: BEMViewerCmdLineOptions.hh:41
FUPortCode::portName
std::string portName() const
Definition: FUPortCode.cc:147
main
int main(int argc, char *argv[])
Definition: ViewBEM.cc:104
BEMSerializer::readBinaryEncoding
BinaryEncoding * readBinaryEncoding()
Definition: BEMSerializer.cc:258
portCodeBits
static string portCodeBits(const PortCode &code)
Definition: ViewBEM.cc:506
SourceField
Definition: SourceField.hh:48