gem5
v24.1.0.1
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
q
r
s
t
v
x
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Symbols
:
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
s
t
v
w
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Typedefs
a
b
c
d
g
h
i
l
m
r
s
t
u
w
Enumerations
b
h
i
o
p
Enumerator
h
i
o
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
systemc
tests
tlm
nb2b_adapter
mm.h
Go to the documentation of this file.
1
2
// *******************************************************************
3
// User-defined memory manager, which maintains a pool of transactions
4
// *******************************************************************
5
6
#include "tlm.h"
7
8
class
mm
:
public
tlm::tlm_mm_interface
9
{
10
typedef
tlm::tlm_generic_payload
gp_t
;
11
12
public
:
13
mm
() :
free_list
(0),
empties
(0) {}
14
15
virtual
~mm
()
16
{
17
gp_t
* ptr;
18
19
while
(
free_list
)
20
{
21
ptr =
free_list
->
trans
;
22
23
// Delete generic payload and all extensions
24
sc_assert
(ptr);
25
delete
ptr;
26
27
free_list
=
free_list
->
next
;
28
}
29
30
while
(
empties
)
31
{
32
access
* x =
empties
;
33
empties
=
empties
->
next
;
34
35
// Delete free list access struct
36
delete
x;
37
}
38
}
15
virtual
~mm
() {
…
}
39
40
gp_t
*
allocate
();
41
void
free
(
gp_t
* trans);
42
43
private
:
44
struct
access
45
{
46
gp_t
*
trans
;
47
access
*
next
;
48
access
*
prev
;
49
};
44
struct
access
{
…
};
50
51
access
*
free_list
;
52
access
*
empties
;
53
};
8
class
mm
:
public
tlm::tlm_mm_interface
{
…
};
54
55
mm::gp_t
*
mm::allocate
()
56
{
57
gp_t
* ptr;
58
if
(
free_list
)
59
{
60
ptr =
free_list
->
trans
;
61
empties
=
free_list
;
62
free_list
=
free_list
->
next
;
63
}
64
else
65
{
66
ptr =
new
gp_t
(
this
);
67
}
68
return
ptr;
69
}
55
mm::gp_t
*
mm::allocate
() {
…
}
70
71
void
mm::free
(
gp_t
* trans)
72
{
73
trans->
reset
();
// Delete auto extensions
74
if
(!
empties
)
75
{
76
empties
=
new
access
;
77
empties
->
next
=
free_list
;
78
empties
->
prev
= 0;
79
if
(
free_list
)
80
free_list
->
prev
=
empties
;
81
}
82
free_list
=
empties
;
83
free_list
->
trans
= trans;
84
empties
=
free_list
->
prev
;
85
}
71
void
mm::free
(
gp_t
* trans) {
…
}
mm
Definition
mm.h:9
mm::free_list
access * free_list
Definition
mm.h:51
mm::gp_t
tlm::tlm_generic_payload gp_t
Definition
mm.h:10
mm::mm
mm()
Definition
mm.h:13
mm::allocate
gp_t * allocate()
Definition
mm.h:55
mm::~mm
virtual ~mm()
Definition
mm.h:15
mm::free
void free(gp_t *trans)
Definition
mm.h:71
mm::empties
access * empties
Definition
mm.h:52
tlm::tlm_generic_payload
Definition
gp.hh:117
tlm::tlm_generic_payload::reset
void reset()
Definition
gp.cc:117
tlm::tlm_mm_interface
Definition
gp.hh:34
sc_assert
#define sc_assert(expr)
Definition
sc_report_handler.hh:135
mm::access
Definition
mm.h:45
mm::access::trans
gp_t * trans
Definition
mm.h:46
mm::access::next
access * next
Definition
mm.h:47
mm::access::prev
access * prev
Definition
mm.h:48
Generated on Mon Jan 13 2025 04:28:45 for gem5 by
doxygen
1.9.8