Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmytro Levit
Software
Commits
c65e64cb
Commit
c65e64cb
authored
5 years ago
by
Patrick Robbe
Browse files
Options
Downloads
Patches
Plain Diff
Add DMA test softwrae
parent
6dcc76a1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
Pcie40Applications/Makefile
+7
-0
7 additions, 0 deletions
Pcie40Applications/Makefile
Pcie40Applications/main_pcie40_dma.c
+44
-0
44 additions, 0 deletions
Pcie40Applications/main_pcie40_dma.c
with
52 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
c65e64cb
...
...
@@ -27,5 +27,6 @@ modules.order
Pcie40Applications/pcie40_ecs
Pcie40Applications/pcie40_reload
Pcie40Applications/pcie40_b2slc
Pcie40Applications/pcie40_dma
*.d
**/pcie40_reload.out
This diff is collapsed.
Click to expand it.
Pcie40Applications/Makefile
+
7
−
0
View file @
c65e64cb
...
...
@@ -27,6 +27,12 @@ PCIE40_SLC_CFLAGS =$(CFLAGS) -I$(TOP) -I$(TOP)/../Pcie40Libraries
PCIE40_SLC_INSTALL
=
$(
PREFIX
)
/bin
PCIE40_SLC_LDFLAGS
=
-L
../Pcie40Libraries/lib
-lpcie40
-L
../Pcie40DriverLibraries/
-lpcie40driver_ecs
PCIE40_DMA
:=
pcie40_dma
PCIE40_DMA_OBJS
=
main_pcie40_dma.o
PCIE40_DMA_CFLAGS
=
$(
CFLAGS
)
-I
$(
TOP
)
-I
$(
TOP
)
/../Pcie40Driver
PCIE40_DMA_INSTALL
=
$(
PREFIX
)
/bin
PCIE40_DMA_LDFLAGS
=
-L
../Pcie40Libraries/lib
-lpcie40
-L
../Pcie40DriverLibraries/
-lpcie40driver_ecs
VPATH
:=
$(
TOP
)
include
$(TOP)/rules.mk
...
...
@@ -34,6 +40,7 @@ include $(TOP)/rules.mk
ifeq
($(ENABLE_PCIE40), true)
$(
eval
$(
call ODIR_template,PCIE40_ECS
))
$(
eval
$(
call ODIR_template,PCIE40_SLC
))
$(
eval
$(
call ODIR_template,PCIE40_DMA
))
$(
eval
$(
call COPY_template,SCRIPTS,755
))
$(
eval
$(
call LINK_template,PCIE40_RELOAD
))
$(
eval
$(
call ODIR_template,PCIE40_RELOAD_SUID
))
...
...
This diff is collapsed.
Click to expand it.
Pcie40Applications/main_pcie40_dma.c
0 → 100644
+
44
−
0
View file @
c65e64cb
#include
<stdlib.h>
#include
<stdio.h>
#include
<unistd.h>
#include
<sys/mman.h>
#include
<sys/types.h>
#include
<fcntl.h>
#include
"altera_dma_cmd.h"
#include
"altera_dma_regs.h"
#define BUFFER_LENGTH 40
unsigned
int
*
pDmaUser
;
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
int
rc
=
0
;
int
on_chip_size
=
(
DMASIZE
*
4
)
*
ALTERA_DMA_DESCRIPTOR_NUM
;
ssize_t
f
;
f
=
open
(
"/dev/pcie40_0_altdma"
,
O_RDWR
);
if
(
f
==
-
1
)
{
printf
(
"Couldn't open the device.
\n
"
);
return
0
;
}
else
{
printf
(
"Opened the device: file handle #%lu!
\n
"
,
(
long
unsigned
int
)
f
);
}
pDmaUser
=
(
unsigned
int
*
)
mmap
(
NULL
,
on_chip_size
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
f
,
0x000
);
rc
=
ioctl
(
f
,
ALTERA_IOCX_START
);
if
((
pDmaUser
!=
NULL
)
&
(
rc
>
0
)
)
{
for
(
i
=
0
;
i
<
DMASIZE
;
i
++
)
printf
(
"0X%08x
\n
"
,
pDmaUser
[
i
]);
}
else
{
printf
(
" No data available :
\n
"
);
if
(
rc
==
-
1
)
printf
(
"DMA too longs
\n
"
);
if
(
rc
==
-
2
)
printf
(
"FIFO is empty
\n
"
);
}
close
(
f
);
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment