Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Simple VME FMC Carrier SVEC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
14
Issues
14
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
Simple VME FMC Carrier SVEC
Commits
bfc53781
Commit
bfc53781
authored
Oct 02, 2017
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test_vme.c: improve output of DMA tests.
parent
57fdecdc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
14 deletions
+46
-14
test_vme.c
software/vmecore_test/test_vme.c
+46
-14
No files found.
software/vmecore_test/test_vme.c
View file @
bfc53781
...
...
@@ -257,14 +257,8 @@ rate_done (struct timespec *start_ts, unsigned int nbr_bytes)
}
static
void
do_test_
dma
(
uint8_t
am
)
do_test_
error_counter
(
void
)
{
struct
vme_dma
dma
;
uint32_t
base
;
void
*
buf
;
int
s
;
struct
timespec
start_ts
;
// Clear pattern write error counter
map_for_am
(
0x39
);
ptr32
[
0x1004
]
=
0
;
...
...
@@ -276,6 +270,26 @@ do_test_dma (uint8_t am)
report
(
swapbe32
(
ptr32
[
0x1004
])
==
1
,
"write error counter is working (on correct)"
);
ptr32
[
0x1004
]
=
0
;
}
static
void
do_test_dma
(
uint8_t
am
)
{
struct
vme_dma
dma
;
uint32_t
base
;
void
*
buf
;
int
s
;
struct
timespec
start_ts
;
enum
vme_dma_block_size
bsize
;
// Clear pattern write error counter
map_for_am
(
0x39
);
ptr32
[
0x1004
]
=
0
;
if
(
ptr32
[
0x1004
]
!=
0
)
{
printf
(
"FATAL: write error counter correctly reset
\n
"
);
exit
(
3
);
}
printf
(
"INFO: test DMA for am 0x%02x
\n
"
,
am
);
base
=
map_for_am
(
am
);
...
...
@@ -301,9 +315,17 @@ do_test_dma (uint8_t am)
dma
.
dst
.
addru
=
((
uintptr_t
)
buf
)
>>
32
;
dma
.
dst
.
addrl
=
(
uintptr_t
)
buf
;
dma
.
ctrl
.
vme_block_size
=
VME_DMA_BSIZE_256
;
if
(
am
==
VME_A24_SUP_MBLT
||
am
==
VME_A24_USER_MBLT
||
am
==
VME_A32_SUP_MBLT
||
am
==
VME_A32_USER_MBLT
)
bsize
=
VME_DMA_BSIZE_2048
;
else
bsize
=
VME_DMA_BSIZE_256
;
dma
.
ctrl
.
vme_block_size
=
bsize
;
dma
.
ctrl
.
vme_backoff_time
=
VME_DMA_BACKOFF_1
;
dma
.
ctrl
.
pci_block_size
=
VME_DMA_BSIZE_256
;
dma
.
ctrl
.
pci_block_size
=
bsize
;
dma
.
ctrl
.
pci_backoff_time
=
VME_DMA_BACKOFF_1
;
rate_start
(
&
start_ts
);
...
...
@@ -347,9 +369,9 @@ do_test_dma (uint8_t am)
dma
.
dst
.
addru
=
0
;
dma
.
dst
.
addrl
=
base
+
0xc000
;
dma
.
ctrl
.
vme_block_size
=
VME_DMA_BSIZE_256
;
dma
.
ctrl
.
vme_block_size
=
bsize
;
dma
.
ctrl
.
vme_backoff_time
=
VME_DMA_BACKOFF_1
;
dma
.
ctrl
.
pci_block_size
=
VME_DMA_BSIZE_256
;
dma
.
ctrl
.
pci_block_size
=
bsize
;
dma
.
ctrl
.
pci_backoff_time
=
VME_DMA_BACKOFF_1
;
rate_start
(
&
start_ts
);
...
...
@@ -360,7 +382,8 @@ do_test_dma (uint8_t am)
free
(
buf
);
map_for_am
(
0x39
);
report
(
ptr32
[
0x1004
]
==
0
,
"no write error during DMA"
);
report
(
ptr32
[
0x1004
]
==
0
,
"no write error during DMA (%d errors)"
,
swapbe32
(
ptr32
[
0x1004
]));
}
static
void
...
...
@@ -421,11 +444,18 @@ do_vme_test (void)
do_test_mem
(
0x0a
);
// DMA
do_test_error_counter
();
printf
(
"
\n
"
"PERF: SCT rate
\n
"
);
do_test_dma
(
0x3d
);
// Single
printf
(
"
\n
"
"PERF: BLT rate
\n
"
);
do_test_dma
(
0x3f
);
// BLT
printf
(
"
\n
"
"PERF: MBLT rate
\n
"
);
do_test_dma
(
0x3c
);
// MBLT
do_test_dma
(
0x38
);
// MBLT
printf
(
"
\n
"
);
do_irq_test
();
do_berr_test
();
...
...
@@ -436,7 +466,9 @@ do_vme_test (void)
}
else
{
printf
(
"FAILED!!!
\n
"
);
printf
(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
\n
"
);
printf
(
"FAILED!!! FAILED!!! FAILED!!! FAILED!!! FAILED!!! FAILED!!!
\n
"
);
printf
(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
\n
"
);
return
1
;
}
}
...
...
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