OpenASIP
2.0
src
applibs
Scheduler
ResourceModel
ShortImmPSocketResource.cc
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 ShortImmPSocketResource.cc
26
*
27
* Implementation of ShortImmPSocketResource class.
28
*
29
* @author Ari Metsähalme 2006 (ari.metsahalme-no.spam-tut.fi)
30
* @note rating: red
31
*/
32
33
#include "
ShortImmPSocketResource.hh
"
34
35
/**
36
* Constructor.
37
*
38
* @param name Name of socket.
39
*/
40
ShortImmPSocketResource::ShortImmPSocketResource
(
41
const
std::string& name,
42
int
immediateWidth,
bool
signExtends,
43
unsigned
int
initiationInterval):
44
OutputPSocketResource
(name, initiationInterval),
45
immediateWidth_(immediateWidth), signExtends_(signExtends) {}
46
47
/**
48
* Destructor.
49
*/
50
ShortImmPSocketResource::~ShortImmPSocketResource
() {}
51
52
/**
53
* Return true always.
54
*
55
* @return True always.
56
*/
57
bool
58
ShortImmPSocketResource::isShortImmPSocketResource
()
const
{
59
return
true
;
60
}
61
62
/**
63
* Return the width of immediate carried by the related bus.
64
*
65
* @return The width of immediate carried by the related bus.
66
*/
67
int
68
ShortImmPSocketResource::immediateWidth
()
const
{
69
return
immediateWidth_
;
70
}
71
72
/**
73
* Return true if the related bus sign extends.
74
*
75
* @return True if the related bus sign extends.
76
*/
77
bool
78
ShortImmPSocketResource::signExtends
()
const
{
79
return
signExtends_
;
80
}
81
82
/**
83
* Return true if the related bus does not sign extend.
84
*
85
* @return True if the related bus does not sign extend.
86
*/
87
bool
88
ShortImmPSocketResource::zeroExtends
()
const
{
89
return
!
signExtends_
;
90
}
91
92
/**
93
* Tests if all referred resources in related groups are of
94
* proper types.
95
*
96
* @return true If all resources in related groups are bus resources.
97
*/
98
bool
99
ShortImmPSocketResource::validateRelatedGroups
() {
100
for
(
int
i = 0; i <
relatedResourceGroupCount
(); i++) {
101
for
(
int
j = 0; j <
relatedResourceCount
(i); j++) {
102
if
(!
relatedResource
(i, j).
isBusResource
()) {
103
return
false
;
104
}
105
}
106
}
107
return
true
;
108
}
ShortImmPSocketResource::immediateWidth_
int immediateWidth_
Width of immediates carried by the related bus.
Definition:
ShortImmPSocketResource.hh:68
ShortImmPSocketResource::signExtends_
bool signExtends_
Extension mode of related bus.
Definition:
ShortImmPSocketResource.hh:70
ShortImmPSocketResource::signExtends
bool signExtends() const
Definition:
ShortImmPSocketResource.cc:78
SchedulingResource::relatedResource
virtual SchedulingResource & relatedResource(const int group, const int index) const
Definition:
SchedulingResource.cc:120
ShortImmPSocketResource::validateRelatedGroups
virtual bool validateRelatedGroups()
Definition:
ShortImmPSocketResource.cc:99
SchedulingResource::isBusResource
virtual bool isBusResource() const
ShortImmPSocketResource::immediateWidth
int immediateWidth() const
Definition:
ShortImmPSocketResource.cc:68
OutputPSocketResource
Definition:
OutputPSocketResource.hh:52
ShortImmPSocketResource.hh
SchedulingResource::relatedResourceCount
int relatedResourceCount(const int group) const
ShortImmPSocketResource::~ShortImmPSocketResource
virtual ~ShortImmPSocketResource()
Definition:
ShortImmPSocketResource.cc:50
ShortImmPSocketResource::isShortImmPSocketResource
virtual bool isShortImmPSocketResource() const
Definition:
ShortImmPSocketResource.cc:58
SchedulingResource::relatedResourceGroupCount
virtual int relatedResourceGroupCount() const
Definition:
SchedulingResource.cc:61
ShortImmPSocketResource::ShortImmPSocketResource
ShortImmPSocketResource(const std::string &name, int immediateWidth, bool signExtends, unsigned int initiationInterval=0)
Definition:
ShortImmPSocketResource.cc:40
ShortImmPSocketResource::zeroExtends
bool zeroExtends() const
Definition:
ShortImmPSocketResource.cc:88
Generated by
1.8.17