OpenASIP
2.0
|
#include <iostream>
#include <string>
#include "BEMViewerCmdLineOptions.hh"
#include "BEMSerializer.hh"
#include "BinaryEncoding.hh"
#include "ImmediateControlField.hh"
#include "MoveSlot.hh"
#include "ImmediateSlotField.hh"
#include "LImmDstRegisterField.hh"
#include "GuardField.hh"
#include "DestinationField.hh"
#include "SourceField.hh"
#include "GPRGuardEncoding.hh"
#include "FUGuardEncoding.hh"
#include "UnconditionalGuardEncoding.hh"
#include "ImmediateEncoding.hh"
#include "BridgeEncoding.hh"
#include "NOPEncoding.hh"
#include "SocketEncoding.hh"
#include "SocketCodeTable.hh"
#include "FUPortCode.hh"
#include "RFPortCode.hh"
#include "IUPortCode.hh"
#include "Conversion.hh"
#include "FileSystem.hh"
Go to the source code of this file.
Functions | |
static void | printBEMInfo (const BinaryEncoding &bem, const std::string &bemFile) |
static void | printInstructionLayout (const BinaryEncoding &bem) |
static void | printImmediateControlField (const BinaryEncoding &bem) |
static void | printLImmDstRegisterField (const LImmDstRegisterField &field) |
static void | printMoveSlot (const MoveSlot &moveSlot) |
static void | printMoveSlotLayout (const MoveSlot &moveSlot) |
static void | printGuardFieldEncodings (const MoveSlot &moveSlot) |
static void | printSlotFieldEncodings (const SlotField &slotField) |
static string | portCodeBits (const PortCode &code) |
static string | portCodeDescription (const RFPortCode &code) |
static string | portCodeDescription (const IUPortCode &code) |
static string | portCodeDescription (const FUPortCode &code) |
static void | printSourceFieldEncodings (const MoveSlot &moveSlot) |
static void | printDestinationFieldEncodings (const MoveSlot &moveSlot) |
static void | printSeparator () |
static void | printPattern (const std::string &pattern, int times) |
int | main (int argc, char *argv[]) |
Implements the viewbem application which prints out human readable information of given binary encoding map.
Definition in file ViewBEM.cc.
int main | ( | int | argc, |
char * | argv[] | ||
) |
The main function.
Definition at line 104 of file ViewBEM.cc.
References Exception::errorMessage(), options, CmdLineOptions::parse(), printBEMInfo(), MachInfoCmdLineOptions::printHelp(), BEMSerializer::readBinaryEncoding(), and XMLSerializer::setSourceFile().
|
static |
Returns the bit string of the given port code.
code | The port code. |
Definition at line 506 of file ViewBEM.cc.
References PortCode::encoding(), PortCode::encodingWidth(), PortCode::hasEncoding(), PortCode::indexWidth(), PortCode::parent(), Conversion::toBinary(), PortCode::width(), and SocketCodeTable::width().
Referenced by printSlotFieldEncodings().
|
static |
Returns description of the given port code.
code | The port code. |
Definition at line 551 of file ViewBEM.cc.
References FUPortCode::hasOperation(), FUPortCode::operationName(), FUPortCode::portName(), and PortCode::unitName().
|
static |
Returns description of the given port code.
code | The port code. |
Definition at line 540 of file ViewBEM.cc.
References PortCode::unitName().
|
static |
Returns description of the given port code.
code | The port code. |
Definition at line 529 of file ViewBEM.cc.
References PortCode::unitName().
Referenced by printSlotFieldEncodings().
|
static |
Prints information of BEM to standard output.
bem | The BEM. |
bemFile | Name of the BEM file. |
Definition at line 145 of file ViewBEM.cc.
References FileSystem::fileOfPath(), BinaryEncoding::longImmDstRegisterField(), BinaryEncoding::longImmDstRegisterFieldCount(), BinaryEncoding::moveSlot(), BinaryEncoding::moveSlotCount(), printImmediateControlField(), printInstructionLayout(), printLImmDstRegisterField(), printMoveSlot(), and BinaryEncoding::width().
Referenced by main().
|
static |
Prints the encodings of the destination field of the given move slot.
moveSlot | The move slot. |
Definition at line 622 of file ViewBEM.cc.
References MoveSlot::destinationField(), MoveSlot::hasDestinationField(), and printSlotFieldEncodings().
Referenced by printMoveSlot().
|
static |
Prints the encodings of the guard field of the given move slot.
moveSlot | The move slot. |
Definition at line 327 of file ViewBEM.cc.
References GuardEncoding::encoding(), InstructionField::extraBits(), GuardField::fuGuardEncoding(), GuardField::fuGuardEncodingCount(), FUGuardEncoding::functionUnit(), GuardField::gprGuardEncoding(), GuardField::gprGuardEncodingCount(), MoveSlot::guardField(), MoveSlot::hasGuardField(), GuardField::hasUnconditionalGuardEncoding(), GuardEncoding::isGuardInverted(), FUGuardEncoding::port(), GPRGuardEncoding::registerFile(), GPRGuardEncoding::registerIndex(), Conversion::toBinary(), GuardField::unconditionalGuardEncoding(), and GuardField::width().
Referenced by printMoveSlot().
|
static |
Prints information of immediate control field of the given BEM.
bem | The BEM. |
Definition at line 220 of file ViewBEM.cc.
References InstructionField::bitPosition(), InstructionField::extraBits(), BinaryEncoding::hasImmediateControlField(), BinaryEncoding::immediateControlField(), ImmediateControlField::instructionTemplate(), printSeparator(), ImmediateControlField::templateCount(), ImmediateControlField::templateEncoding(), Conversion::toBinary(), and ImmediateControlField::width().
Referenced by printBEMInfo().
|
static |
Prints the instruction layout of the given BEM.
bem | The BEM. |
Definition at line 179 of file ViewBEM.cc.
References assert, BinaryEncoding::childField(), BinaryEncoding::childFieldCount(), ImmediateSlotField::name(), MoveSlot::name(), ImmediateSlotField::width(), InstructionField::width(), LImmDstRegisterField::width(), and MoveSlot::width().
Referenced by printBEMInfo().
|
static |
Prints information of the given long immediate destination register field.
field | The field. |
Definition at line 254 of file ViewBEM.cc.
References InstructionField::bitPosition(), LImmDstRegisterField::immediateUnit(), LImmDstRegisterField::instructionTemplate(), LImmDstRegisterField::instructionTemplateCount(), printSeparator(), and LImmDstRegisterField::width().
Referenced by printBEMInfo().
|
static |
Prints information of the given move slot.
moveSlot | The move slot. |
Definition at line 276 of file ViewBEM.cc.
References InstructionField::bitPosition(), MoveSlot::name(), printDestinationFieldEncodings(), printGuardFieldEncodings(), printMoveSlotLayout(), printSeparator(), printSourceFieldEncodings(), and MoveSlot::width().
Referenced by printBEMInfo().
|
static |
Prints the layout of the given move slot.
moveSlot | The move slot. |
Definition at line 299 of file ViewBEM.cc.
References assert, MoveSlot::childField(), MoveSlot::childFieldCount(), SourceField::width(), SlotField::width(), and GuardField::width().
Referenced by printMoveSlot().
|
static |
Prints the given pattern the given times.
pattern | The pattern. |
times | Times the pattern is written. |
Definition at line 651 of file ViewBEM.cc.
Referenced by printSlotFieldEncodings(), and printSourceFieldEncodings().
|
static |
Prints the separator.
Definition at line 638 of file ViewBEM.cc.
Referenced by printImmediateControlField(), printLImmDstRegisterField(), and printMoveSlot().
|
static |
Prints the socket and NOP encodings of the given slot field.
slotField | The source or destination field. |
Definition at line 389 of file ViewBEM.cc.
References SlotField::componentIDPosition(), Encoding::encoding(), InstructionField::extraBits(), SocketCodeTable::fuPortCode(), SocketCodeTable::fuPortCodeCount(), SlotField::hasNoOperationEncoding(), SocketEncoding::hasSocketCodes(), SocketCodeTable::iuPortCode(), SocketCodeTable::iuPortCodeCount(), SlotField::noOperationEncoding(), portCodeBits(), portCodeDescription(), printPattern(), SocketCodeTable::rfPortCode(), SocketCodeTable::rfPortCodeCount(), BinaryEncoding::RIGHT, SocketEncoding::socketCodes(), SlotField::socketEncoding(), SlotField::socketEncodingCount(), SocketEncoding::socketIDWidth(), SocketEncoding::socketName(), Conversion::toBinary(), Encoding::width(), SocketEncoding::width(), SlotField::width(), and SocketCodeTable::width().
Referenced by printDestinationFieldEncodings(), and printSourceFieldEncodings().
|
static |
Prints the encodings of the source field of the given move slot.
moveSlot | The move slot. |
Definition at line 566 of file ViewBEM.cc.
References SourceField::bridgeEncoding(), SourceField::bridgeEncodingCount(), BridgeEncoding::bridgeName(), SlotField::componentIDPosition(), Encoding::encoding(), ImmediateEncoding::encodingWidth(), InstructionField::extraBits(), SourceField::hasImmediateEncoding(), MoveSlot::hasSourceField(), SourceField::immediateEncoding(), ImmediateEncoding::immediateWidth(), BinaryEncoding::LEFT, printPattern(), printSlotFieldEncodings(), BinaryEncoding::RIGHT, MoveSlot::sourceField(), Conversion::toBinary(), Encoding::width(), ImmediateEncoding::width(), and SourceField::width().
Referenced by printMoveSlot().