OpenASIP 2.2
Loading...
Searching...
No Matches
ResourceVector.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 ResourceVector.hh
26 *
27 * Declaration of ResourceVector class.
28 *
29 * @author Pekka J��skel�inen 2006 (pekka.jaaskelainen-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#ifndef TTA_RESOURCE_VECTOR_HH
34#define TTA_RESOURCE_VECTOR_HH
35
36#include <vector>
37#include <set>
38#include <deque>
39#include <string>
40
41#include "Exception.hh"
42
43namespace TTAMachine {
44 class ExecutionPipeline;
45}
46
47namespace TTAMachine {
48
49/**
50 * Represents a resource vector used in building the states in case
51 * of an function unit FSA.
52 */
54public:
55 /// Resources are stored in a set as strings. Normal pipeline resource
56 /// usages are prefixed with "res:", port usages with "port:".
57 typedef std::set<std::string> ResourceSet;
58
61 virtual ~ResourceVector();
62
63 const ResourceSet& resourcesUsedAtCycle(unsigned cycle) const;
64
65 std::size_t width() const;
66
67 std::string toString() const;
68
69 virtual bool conflictsWith(const ResourceVector& other, unsigned cycle)
70 const;
71
72 virtual void mergeWith(const ResourceVector& other, unsigned cycle);
73
74 virtual void shiftLeft();
75
76 virtual void clear();
77
78 virtual bool operator==(const ResourceVector& rightHand) const;
79
80private:
81 /// Each resource usage is stored as a string.
82 typedef std::deque<ResourceSet> ResourceUsageIndex;
83 /// The storage for the resource usages.
85};
86}
87#endif
ResourceUsageIndex resources_
The storage for the resource usages.
std::set< std::string > ResourceSet
Resources are stored in a set as strings. Normal pipeline resource usages are prefixed with "res:",...
const ResourceSet & resourcesUsedAtCycle(unsigned cycle) const
std::string toString() const
virtual bool conflictsWith(const ResourceVector &other, unsigned cycle) const
std::size_t width() const
virtual bool operator==(const ResourceVector &rightHand) const
std::deque< ResourceSet > ResourceUsageIndex
Each resource usage is stored as a string.
virtual void mergeWith(const ResourceVector &other, unsigned cycle)