OpenASIP  2.0
BEMSerializer.hh
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 BEMSerializer.hh
26  *
27  * Declaration of BEMSerializer class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_BEM_SERIALIZER_HH
34 #define TTA_BEM_SERIALIZER_HH
35 
36 #include "XMLSerializer.hh"
37 
38 class BinaryEncoding;
39 
40 /**
41  * BEMSerializer reads and writes BEM (Binary Encoding Map) files.
42  */
43 class BEMSerializer : public XMLSerializer {
44 public:
45  BEMSerializer();
46  virtual ~BEMSerializer();
47 
48  virtual ObjectState* readState();
49  virtual void writeState(const ObjectState* state);
51  void writeBinaryEncoding(const BinaryEncoding& bem);
52 
53 private:
54  static ObjectState* convertToOMFormat(const ObjectState* fileState);
55  static ObjectState* convertToFileFormat(const ObjectState* omState);
56  static void convertZeroEncExtraBits(ObjectState* os);
57 
58  static ObjectState* socketCodeTableToFile(const ObjectState* scTable);
59  static ObjectState* longImmTagToFile(const ObjectState* immTag);
60  static ObjectState* moveSlotToFile(const ObjectState* slotState);
61  static ObjectState* guardFieldToFile(const ObjectState* gFieldState);
62  static ObjectState* sourceFieldToFile(const ObjectState* sFieldState);
64  const ObjectState* dFieldState);
65  static ObjectState* slotFieldToFile(const ObjectState* sFieldState);
66  static ObjectState* immediateSlotToFile(const ObjectState* slotState);
68  const ObjectState* omState);
69 
70 
71  static ObjectState* socketCodeTableToOM(const ObjectState* scTable);
72  static ObjectState* longImmTagToOM(const ObjectState* fileTag);
73  static ObjectState* moveSlotToOM(const ObjectState* fileSlot);
74  static ObjectState* guardFieldToOM(const ObjectState* fileGuard);
75  static ObjectState* sourceFieldToOM(const ObjectState* fileSource);
77  const ObjectState* fileDestination);
78  static ObjectState* slotFieldToOM(const ObjectState* fileSlot);
79  static ObjectState* immediateSlotToOM(const ObjectState* fileSlot);
80  static ObjectState* longImmDstRegFieldToOM(const ObjectState* fileField);
81 
82  static void readRegisterFilePortCode(
83  const ObjectState* filePortCode,
84  ObjectState* omPortCode);
85 };
86 
87 #endif
BinaryEncoding
Definition: BinaryEncoding.hh:61
BEMSerializer::BEMSerializer
BEMSerializer()
Definition: BEMSerializer.cc:164
BEMSerializer::immediateSlotToFile
static ObjectState * immediateSlotToFile(const ObjectState *slotState)
Definition: BEMSerializer.cc:870
BEMSerializer::longImmDstRegisterFieldToFile
static ObjectState * longImmDstRegisterFieldToFile(const ObjectState *omState)
Definition: BEMSerializer.cc:895
BEMSerializer::slotFieldToOM
static ObjectState * slotFieldToOM(const ObjectState *fileSlot)
Definition: BEMSerializer.cc:1239
ObjectState
Definition: ObjectState.hh:59
BEMSerializer
Definition: BEMSerializer.hh:43
BEMSerializer::destinationFieldToFile
static ObjectState * destinationFieldToFile(const ObjectState *dFieldState)
Definition: BEMSerializer.cc:784
BEMSerializer::sourceFieldToOM
static ObjectState * sourceFieldToOM(const ObjectState *fileSource)
Definition: BEMSerializer.cc:1167
XMLSerializer.hh
BEMSerializer::convertToFileFormat
static ObjectState * convertToFileFormat(const ObjectState *omState)
Definition: BEMSerializer.cc:327
BEMSerializer::~BEMSerializer
virtual ~BEMSerializer()
Definition: BEMSerializer.cc:173
BEMSerializer::sourceFieldToFile
static ObjectState * sourceFieldToFile(const ObjectState *sFieldState)
Definition: BEMSerializer.cc:704
BEMSerializer::moveSlotToOM
static ObjectState * moveSlotToOM(const ObjectState *fileSlot)
Definition: BEMSerializer.cc:1032
BEMSerializer::guardFieldToOM
static ObjectState * guardFieldToOM(const ObjectState *fileGuard)
Definition: BEMSerializer.cc:1076
BEMSerializer::longImmTagToFile
static ObjectState * longImmTagToFile(const ObjectState *immTag)
Definition: BEMSerializer.cc:524
BEMSerializer::guardFieldToFile
static ObjectState * guardFieldToFile(const ObjectState *gFieldState)
Definition: BEMSerializer.cc:608
BEMSerializer::readState
virtual ObjectState * readState()
Definition: BEMSerializer.cc:186
BEMSerializer::writeState
virtual void writeState(const ObjectState *state)
Definition: BEMSerializer.cc:246
BEMSerializer::moveSlotToFile
static ObjectState * moveSlotToFile(const ObjectState *slotState)
Definition: BEMSerializer.cc:562
BEMSerializer::socketCodeTableToOM
static ObjectState * socketCodeTableToOM(const ObjectState *scTable)
Definition: BEMSerializer.cc:934
BEMSerializer::immediateSlotToOM
static ObjectState * immediateSlotToOM(const ObjectState *fileSlot)
Definition: BEMSerializer.cc:1312
BEMSerializer::convertToOMFormat
static ObjectState * convertToOMFormat(const ObjectState *fileState)
Definition: BEMSerializer.cc:287
BEMSerializer::convertZeroEncExtraBits
static void convertZeroEncExtraBits(ObjectState *os)
Definition: BEMSerializer.cc:214
BEMSerializer::readRegisterFilePortCode
static void readRegisterFilePortCode(const ObjectState *filePortCode, ObjectState *omPortCode)
Definition: BEMSerializer.cc:1377
BEMSerializer::writeBinaryEncoding
void writeBinaryEncoding(const BinaryEncoding &bem)
Definition: BEMSerializer.cc:272
BEMSerializer::socketCodeTableToFile
static ObjectState * socketCodeTableToFile(const ObjectState *scTable)
Definition: BEMSerializer.cc:404
BEMSerializer::longImmTagToOM
static ObjectState * longImmTagToOM(const ObjectState *fileTag)
Definition: BEMSerializer.cc:995
BEMSerializer::slotFieldToFile
static ObjectState * slotFieldToFile(const ObjectState *sFieldState)
Definition: BEMSerializer.cc:798
BEMSerializer::longImmDstRegFieldToOM
static ObjectState * longImmDstRegFieldToOM(const ObjectState *fileField)
Definition: BEMSerializer.cc:1337
XMLSerializer
Definition: XMLSerializer.hh:62
BEMSerializer::destinationFieldToOM
static ObjectState * destinationFieldToOM(const ObjectState *fileDestination)
Definition: BEMSerializer.cc:1222
BEMSerializer::readBinaryEncoding
BinaryEncoding * readBinaryEncoding()
Definition: BEMSerializer.cc:258