Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PHASE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PHASE
Commits
e0e5eb0e
Commit
e0e5eb0e
authored
Apr 11, 2011
by
Wesley W. Terpstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use same name as other LM32 components
parent
5b3533f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
lm32-drom.cpp
src/components/lm32/lm32-drom.cpp
+8
-8
lm32-drom.h
src/components/lm32/lm32-drom.h
+2
-2
No files found.
src/components/lm32/lm32-drom.cpp
View file @
e0e5eb0e
...
...
@@ -6,7 +6,7 @@
#include <cstring>
#include <assert.h>
LM32
_DROM
::
LM32_
DROM
(
Interconnect
*
ic
)
LM32
DROM
::
LM32
DROM
(
Interconnect
*
ic
)
:
Component
(
ic
),
register_address
(
*
addMasterPort
(
"register/address"
,
Pinout
(
"address"
,
8
))),
register_write
(
*
addMasterPort
(
"register/write"
,
Pinout
(
"data"
,
32
))),
...
...
@@ -21,7 +21,7 @@ LM32_DROM::LM32_DROM(Interconnect* ic)
state
(
STOPPED
)
{
}
SendQueue
::
const_iterator
LM32
_
DROM
::
send
(
SendQueue
::
const_iterator
i
,
SendQueue
::
const_iterator
end
)
{
SendQueue
::
const_iterator
LM32DROM
::
send
(
SendQueue
::
const_iterator
i
,
SendQueue
::
const_iterator
end
)
{
for
(;
i
!=
end
;
++
i
)
{
if
(
i
->
master
==
&
reset
)
{
state
=
RUNNING
;
...
...
@@ -80,7 +80,7 @@ SendQueue::const_iterator LM32_DROM::send(SendQueue::const_iterator i, SendQueue
return
i
;
}
void
LM32
_
DROM
::
recv
(
RecvQueue
::
const_iterator
i
,
RecvQueue
::
const_iterator
end
)
{
void
LM32DROM
::
recv
(
RecvQueue
::
const_iterator
i
,
RecvQueue
::
const_iterator
end
)
{
for
(;
i
!=
end
;
++
i
)
{
if
(
i
->
slave
==
&
echo
)
{
register_read
(
i
->
bits
);
...
...
@@ -161,7 +161,7 @@ void LM32_DROM::recv(RecvQueue::const_iterator i, RecvQueue::const_iterator end)
}
}
void
LM32
_
DROM
::
read
(
uint32_t
address
,
uint32_t
len
)
{
void
LM32DROM
::
read
(
uint32_t
address
,
uint32_t
len
)
{
while
(
len
>
0
)
{
uint32_t
cut
;
if
(
len
>
127
)
cut
=
127
;
else
cut
=
len
;
...
...
@@ -179,7 +179,7 @@ void LM32_DROM::read(uint32_t address, uint32_t len) {
}
}
void
LM32
_
DROM
::
write
(
uint32_t
address
,
SendQueue
::
const_iterator
&
i
,
SendQueue
::
const_iterator
end
)
{
void
LM32DROM
::
write
(
uint32_t
address
,
SendQueue
::
const_iterator
&
i
,
SendQueue
::
const_iterator
end
)
{
uint32_t
len
=
0
;
for
(
SendQueue
::
const_iterator
scan
=
i
;
scan
!=
end
&&
scan
->
master
==
&
memory_write
;
++
scan
)
++
len
;
...
...
@@ -201,14 +201,14 @@ void LM32_DROM::write(uint32_t address, SendQueue::const_iterator& i, SendQueue:
}
}
void
LM32
_
DROM
::
setReg
(
int
reg
,
uint32_t
val
)
{
void
LM32DROM
::
setReg
(
int
reg
,
uint32_t
val
)
{
now
[
reg
*
4
+
0
]
=
val
>>
24
;
now
[
reg
*
4
+
1
]
=
val
>>
16
;
now
[
reg
*
4
+
2
]
=
val
>>
8
;
now
[
reg
*
4
+
3
]
=
val
>>
0
;
}
uint32_t
LM32
_
DROM
::
getReg
(
int
reg
)
{
uint32_t
LM32DROM
::
getReg
(
int
reg
)
{
return
static_cast
<
uint32_t
>
(
now
[
reg
*
4
+
0
])
<<
24
|
static_cast
<
uint32_t
>
(
now
[
reg
*
4
+
1
])
<<
16
|
...
...
@@ -216,7 +216,7 @@ uint32_t LM32_DROM::getReg(int reg) {
static_cast
<
uint32_t
>
(
now
[
reg
*
4
+
3
])
<<
0
;
}
void
LM32
_
DROM
::
update
()
{
void
LM32DROM
::
update
()
{
now
[
0
]
=
now
[
1
]
=
now
[
2
]
=
now
[
3
]
=
0
;
/* R0 */
#if 0
...
...
src/components/lm32/lm32-drom.h
View file @
e0e5eb0e
...
...
@@ -3,9 +3,9 @@
#include "common/component.h"
class
LM32
_
DROM
:
public
Component
{
class
LM32DROM
:
public
Component
{
public
:
LM32
_
DROM
(
Interconnect
*
ic
);
LM32DROM
(
Interconnect
*
ic
);
SendQueue
::
const_iterator
send
(
SendQueue
::
const_iterator
i
,
SendQueue
::
const_iterator
end
);
void
recv
(
RecvQueue
::
const_iterator
i
,
RecvQueue
::
const_iterator
end
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment