Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
071ef18c
"vscode:/vscode.git/clone" did not exist on "b54515a6e16c5a4c1a2d4b62eba1bb59838231be"
Commit
071ef18c
authored
Jun 09, 2020
by
Antoine Kaufmann
Browse files
condrum: checkpoint fix for memreader
parent
d8f4300b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
corundum/mem.cpp
corundum/mem.cpp
+12
-12
No files found.
corundum/mem.cpp
View file @
071ef18c
...
...
@@ -24,9 +24,7 @@ void MemWriter::step()
cur
->
engine
->
mem_op_complete
(
cur
);
cur
=
0
;
}
if
(
!
cur
&&
!
pending
.
empty
())
{
}
else
if
(
!
cur
&&
!
pending
.
empty
())
{
cur
=
pending
.
front
();
pending
.
pop_front
();
...
...
@@ -88,27 +86,26 @@ void MemReader::step()
size_t
data_byte_width
=
DATA_WIDTH
/
8
;
if
(
cur
&&
p
.
mem_resvalid
)
{
std
::
cerr
<<
"completed read from: "
<<
cur
->
ram_addr
<<
std
::
endl
;
std
::
cerr
<<
"completed read from: "
<<
std
::
hex
<<
cur
->
ram_addr
<<
std
::
endl
;
p
.
mem_valid
=
0
;
p
.
mem_resready
=
0
;
/*for (size_t i = 0; i < 32; i++)
std::cerr << " val = " << p.mem_data[i] << std::endl;*/
size_t
off
=
cur
->
ram_addr
%
data_byte_width
;
for
(
size_t
i
=
0
;
i
<
cur
->
len
;
i
++
,
off
++
)
{
size_t
byte_off
=
off
%
4
;
size_t
byte_off
=
(
off
%
4
)
;
cur
->
data
[
i
]
=
(
p
.
mem_data
[
off
/
4
]
>>
(
byte_off
*
8
))
&
0xff
;
}
cur
->
engine
->
mem_op_complete
(
cur
);
cur
=
0
;
}
if
(
!
cur
&&
!
pending
.
empty
())
{
}
else
if
(
!
cur
&&
!
pending
.
empty
())
{
cur
=
pending
.
front
();
pending
.
pop_front
();
std
::
cerr
<<
"issuing read from "
<<
cur
->
ram_addr
<<
std
::
endl
;
std
::
cerr
<<
"issuing read from "
<<
std
::
hex
<<
cur
->
ram_addr
<<
std
::
endl
;
size_t
data_offset
=
cur
->
ram_addr
%
data_byte_width
;
std
::
cerr
<<
" off="
<<
data_offset
<<
std
::
endl
;
if
(
cur
->
len
>
data_byte_width
-
data_offset
)
{
std
::
cerr
<<
"MemReader::step: cannot be written in one cycle TODO"
<<
std
::
endl
;
...
...
@@ -127,6 +124,7 @@ void MemReader::step()
size_t
byte_off
=
off
%
4
;
p
.
mem_valid
|=
(
1
<<
(
off
/
(
SEG_WIDTH
/
8
)));
}
p
.
mem_resready
=
p
.
mem_valid
;
uint64_t
seg_addr
=
cur
->
ram_addr
/
data_byte_width
;
size_t
seg_addr_bits
=
12
;
...
...
@@ -141,7 +139,9 @@ void MemReader::step()
}
}
p
.
mem_resready
=
1
;
/*for (size_t i = 0; i < 3; i++)
std::cerr << " addr = " << p.mem_addr[i] << std::endl;
std::cerr << " mem_valid = " << (unsigned) p.mem_valid << std::endl;*/
}
}
...
...
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