OpenASIP 2.2
Loading...
Searching...
No Matches
CUOpcodeGenerator.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2014 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 CUOpcodeGenerator.hh
26 *
27 * Declaration of ProcessorGenerator class.
28 *
29 * @author Henry Linjamäki 2014 (henry.linjamaki-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef GCUOPCODEGENERATOR_HH
34#define GCUOPCODEGENERATOR_HH
35
36#include <fstream>
37#include <string>
38#include <map>
39
40#include "TCEString.hh"
41#include "MachineInfo.hh"
42#include "ProGeTypes.hh"
43
44#include "Exception.hh"
45
46namespace TTAMachine {
47 class Machine;
48}
49
50namespace ProGe {
51
52/**
53 * Class that for given ADF generates encodings for Global Control Unit and
54 * RTL package that holds encoding information for CU RTL source codes.
55 *
56 */
58public:
59
60 typedef std::string OperationType;
61 typedef size_t EncodingType;
62 typedef std::map<OperationType, EncodingType, TCEString::ICLess>
64
66 const TTAMachine::Machine& mach,
67 const std::string& entityName = "tta0");
68 virtual ~CUOpcodeGenerator();
69
71 size_t encoding(const std::string& operName) const;
72 size_t opcodeWidth() const;
73 void generateOpcodePackage(HDL language, std::ofstream& stream) const;
74 static size_t gcuOpcodeWidth(const TTAMachine::Machine& mach);
75
76private:
80 std::ofstream& stream) const;
83 std::ofstream& stream) const;
84
86 const std::string entityStr_;
87};
88
89} /* namespace ProGe */
90
91#endif /* GCUOPCODEGENERATOR_HH */
void generateOpcodePackage(HDL language, std::ofstream &stream) const
std::map< OperationType, EncodingType, TCEString::ICLess > OperationEncodingMapType
size_t encoding(const std::string &operName) const
void WriteVhdlOpcodePackage(const OperationEncodingMapType &encodings, std::ofstream &stream) const
const TTAMachine::Machine * mach_
OperationEncodingMapType encodings() const
void WriteVerilogOpcodePackage(const OperationEncodingMapType &encodings, std::ofstream &stream) const
static size_t gcuOpcodeWidth(const TTAMachine::Machine &mach)
Definition FUGen.hh:54
HDL
HDLs supported by ProGe.
Definition ProGeTypes.hh:40