Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
litex
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jonathan Currier
litex
Commits
23085cff
Unverified
Commit
23085cff
authored
Jul 09, 2020
by
enjoy-digital
Committed by
GitHub
Jul 09, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #584 from ozbenh/memtest
Memtest/memspeed improvements
parents
5c332e4b
83d24d08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
litex/soc/software/libbase/memtest.c
litex/soc/software/libbase/memtest.c
+7
-7
No files found.
litex/soc/software/libbase/memtest.c
View file @
23085cff
...
...
@@ -164,7 +164,7 @@ int memtest_data(unsigned int *addr, unsigned long size, int random)
void
memspeed
(
unsigned
int
*
addr
,
unsigned
long
size
,
bool
read_only
)
{
volatile
unsigned
int
*
array
=
addr
;
volatile
unsigned
long
*
array
=
(
unsigned
long
*
)
addr
;
int
i
;
unsigned
int
start
,
end
;
unsigned
long
write_speed
=
0
;
...
...
@@ -172,7 +172,7 @@ void memspeed(unsigned int *addr, unsigned long size, bool read_only)
__attribute__
((
unused
))
unsigned
long
data
;
const
unsigned
int
sz
=
sizeof
(
unsigned
long
);
printf
(
"Memspeed at 0x%
08x
...
\n
"
,
addr
);
printf
(
"Memspeed at 0x%
p
...
\n
"
,
addr
);
/* init timer */
timer0_en_write
(
0
);
...
...
@@ -185,7 +185,7 @@ void memspeed(unsigned int *addr, unsigned long size, bool read_only)
timer0_update_value_write
(
1
);
start
=
timer0_value_read
();
for
(
i
=
0
;
i
<
size
/
sz
;
i
++
)
{
array
[
i
]
=
i
;
array
[
i
]
=
-
1ul
;
}
timer0_update_value_write
(
1
);
end
=
timer0_value_read
();
...
...
@@ -221,16 +221,16 @@ int memtest(unsigned int *addr, unsigned long maxsize)
unsigned
long
addr_size
=
MEMTEST_ADDR_SIZE
<
maxsize
?
MEMTEST_ADDR_SIZE
:
maxsize
;
unsigned
long
data_size
=
MEMTEST_DATA_SIZE
<
maxsize
?
MEMTEST_DATA_SIZE
:
maxsize
;
printf
(
"Memtest at 0x%
08x
...
\n
"
,
addr
);
printf
(
"Memtest at 0x%
p
...
\n
"
,
addr
);
bus_errors
=
memtest_bus
(
addr
,
bus_size
);
addr_errors
=
memtest_addr
(
addr
,
addr_size
,
MEMTEST_ADDR_RANDOM
);
data_errors
=
memtest_data
(
addr
,
data_size
,
MEMTEST_DATA_RANDOM
);
if
(
bus_errors
+
addr_errors
+
data_errors
!=
0
)
{
printf
(
"- bus errors: %d/%d
\n
"
,
bus_errors
,
2
*
bus_size
/
4
);
printf
(
"- addr errors: %d/%d
\n
"
,
addr_errors
,
addr_size
/
4
);
printf
(
"- data errors: %d/%d
\n
"
,
data_errors
,
data_size
/
4
);
printf
(
"- bus errors: %d/%
l
d
\n
"
,
bus_errors
,
2
*
bus_size
/
4
);
printf
(
"- addr errors: %d/%
l
d
\n
"
,
addr_errors
,
addr_size
/
4
);
printf
(
"- data errors: %d/%
l
d
\n
"
,
data_errors
,
data_size
/
4
);
printf
(
"Memtest KO
\n
"
);
return
0
;
}
...
...
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