OpenASIP 2.2
Loading...
Searching...
No Matches
ADFSerializer.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 ADFSerializer.hh
26 *
27 * Declaration of ADFSerializer class.
28 *
29 * @author Lasse Laasonen 2004 (lasse.laasonen-no.spam-tut.fi)
30 * @note reviewed 15 Jun 2004 by pj, vpj, ml, ll
31 * @note rating: red
32 */
33
34#ifndef TTA_MDF_SERIALIZER_HH
35#define TTA_MDF_SERIALIZER_HH
36
37#include "XMLSerializer.hh"
38
39namespace TTAMachine {
40 class Machine;
41}
42
43/**
44 * This class is used to generate a machine object model from MDF file and to
45 * generate MDF file from a machine object model.
46 *
47 * By default ADFSerializer validates the files it reads with ADF Schema.
48 */
50public:
52 virtual ~ADFSerializer();
53
54 void writeState(const ObjectState* machineState);
58
59protected:
60 /// Copying forbidden.
62 /// Assingment forbidden.
64
65private:
66 // machine format to MDF format conversion functions
67 static ObjectState* convertToMDFFormat(const ObjectState* machineState);
68 static ObjectState* busToMDF(const ObjectState* busState);
69 static ObjectState* socketToMDF(const ObjectState* socketState);
70 static ObjectState* bridgeToMDF(const ObjectState* bridgeState);
71 static ObjectState* functionUnitToMDF(const ObjectState* fuState);
72 static ObjectState* registerFileToMDF(const ObjectState* rfState);
74 const ObjectState* iuState,
75 const ObjectState* machineState);
76 static ObjectState* addressSpaceToMDF(const ObjectState* asState);
77 static ObjectState* controlUnitToMDF(const ObjectState* cuState);
78 static ObjectState* immediateSlotToMDF(const ObjectState* isState);
79
80 // MDF format to machine format conversion functions
81 static ObjectState* convertToMachineFormat(const ObjectState* mdfState);
82 static ObjectState* busToMachine(const ObjectState* busState);
83 static ObjectState* socketToMachine(const ObjectState* socketState);
84 static ObjectState* bridgeToMachine(const ObjectState* bridgeState);
86 const ObjectState* fuState,
87 const int orderNumber);
88 static ObjectState* registerFileToMachine(const ObjectState* rfState);
89 static ObjectState* addressSpaceToMachine(const ObjectState* asState);
90 static ObjectState* controlUnitToMachine(const ObjectState* cuState);
92 const ObjectState* iuState, ObjectState* machineState);
93 static ObjectState* immediateSlotToMachine(const ObjectState* isState);
94
95 // small helper functions
96 static ObjectState* machineSRPort(const ObjectState* mdfSRPortState);
97 static ObjectState* mdfSRPort(const ObjectState* machineSRPortState);
98 static void setIUExtensionMode(
99 const ObjectState* mdfIUState,
100 ObjectState* momIUState);
101 static ObjectState* machineRFPort(const ObjectState* mdfPortState);
102 static ObjectState* mdfPort(const ObjectState* machinePortState);
103 static ObjectState* machineFUPort(const ObjectState* mdfFUPortState);
104 static ObjectState* mdfFUPort(const ObjectState* machineFUPortState);
106 const ObjectState* mdfOperationState);
108 const ObjectState* machineOperationState);
109 static ObjectState* machinePipeline(const ObjectState* mdfPipelineState);
110 static ObjectState* mdfPipeline(const ObjectState* machinePipelineState);
111 static void instructionTemplateToMDF(
112 const ObjectState* momITState,
113 ObjectState* mdfIUState);
115 const ObjectState* mdfITState, ObjectState* momMachineState,
116 const std::string& iuName = std::string(""));
118 const ObjectState* momITState,
119 const std::string& busName);
120 static bool hasEmptyInstructionTemplate(
121 const ObjectState* momMachineState);
122
123};
124
125
126#endif
TTAMachine::Machine * machine
the architecture definition of the estimated processor
static ObjectState * convertToMachineFormat(const ObjectState *mdfState)
void writeMachine(const TTAMachine::Machine &machine)
TTAMachine::Machine * readMachine()
static ObjectState * machineOperation(const ObjectState *mdfOperationState)
static ObjectState * immediateUnitToMachine(const ObjectState *iuState, ObjectState *machineState)
static ObjectState * addressSpaceToMDF(const ObjectState *asState)
static ObjectState * momTemplateSlot(const ObjectState *momITState, const std::string &busName)
static bool hasEmptyInstructionTemplate(const ObjectState *momMachineState)
static ObjectState * mdfSRPort(const ObjectState *machineSRPortState)
static ObjectState * controlUnitToMDF(const ObjectState *cuState)
static ObjectState * controlUnitToMachine(const ObjectState *cuState)
ADFSerializer(const ADFSerializer &)
Copying forbidden.
static ObjectState * machineSRPort(const ObjectState *mdfSRPortState)
static ObjectState * mdfOperation(const ObjectState *machineOperationState)
static ObjectState * functionUnitToMDF(const ObjectState *fuState)
static ObjectState * functionUnitToMachine(const ObjectState *fuState, const int orderNumber)
static ObjectState * busToMachine(const ObjectState *busState)
static ObjectState * machineRFPort(const ObjectState *mdfPortState)
static ObjectState * mdfPort(const ObjectState *machinePortState)
static ObjectState * socketToMachine(const ObjectState *socketState)
void writeState(const ObjectState *machineState)
ADFSerializer & operator=(const ADFSerializer &)
Assingment forbidden.
static ObjectState * addressSpaceToMachine(const ObjectState *asState)
static ObjectState * registerFileToMachine(const ObjectState *rfState)
static void instructionTemplateToMachine(const ObjectState *mdfITState, ObjectState *momMachineState, const std::string &iuName=std::string(""))
static ObjectState * bridgeToMachine(const ObjectState *bridgeState)
static ObjectState * immediateSlotToMDF(const ObjectState *isState)
static ObjectState * machinePipeline(const ObjectState *mdfPipelineState)
static ObjectState * convertToMDFFormat(const ObjectState *machineState)
static ObjectState * immediateSlotToMachine(const ObjectState *isState)
static void instructionTemplateToMDF(const ObjectState *momITState, ObjectState *mdfIUState)
static ObjectState * machineFUPort(const ObjectState *mdfFUPortState)
static ObjectState * mdfPipeline(const ObjectState *machinePipelineState)
static ObjectState * socketToMDF(const ObjectState *socketState)
ObjectState * readState()
static ObjectState * mdfFUPort(const ObjectState *machineFUPortState)
static ObjectState * immediateUnitToMDF(const ObjectState *iuState, const ObjectState *machineState)
static void setIUExtensionMode(const ObjectState *mdfIUState, ObjectState *momIUState)
static ObjectState * bridgeToMDF(const ObjectState *bridgeState)
static ObjectState * busToMDF(const ObjectState *busState)
virtual ~ADFSerializer()
static ObjectState * registerFileToMDF(const ObjectState *rfState)