Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
VILLASframework
VILLASfpga
VILLASfpga
Commits
e6a7aa77
Commit
e6a7aa77
authored
Nov 03, 2021
by
Steffen Vogel
🎅🏼
Browse files
wip
parent
bda5171c
Pipeline
#583389
canceled with stages
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/villas/fpga/card.hpp
View file @
e6a7aa77
...
@@ -141,6 +141,12 @@ public:
...
@@ -141,6 +141,12 @@ public:
virtual
std
::
string
virtual
std
::
string
getDescription
()
const
getDescription
()
const
{
return
"Xilinx PCIe FPGA cards"
;
}
{
return
"Xilinx PCIe FPGA cards"
;
}
virtual
std
::
string
getType
()
const
{
return
"card"
;
}
};
};
}
/* namespace fpga */
}
/* namespace fpga */
...
...
include/villas/fpga/core.hpp
View file @
e6a7aa77
...
@@ -55,7 +55,6 @@ class Core;
...
@@ -55,7 +55,6 @@ class Core;
class
CoreFactory
;
class
CoreFactory
;
class
InterruptController
;
class
InterruptController
;
class
IpIdentifier
{
class
IpIdentifier
{
public:
public:
...
@@ -245,6 +244,12 @@ public:
...
@@ -245,6 +244,12 @@ public:
static
Core
::
List
static
Core
::
List
make
(
PCIeCard
*
card
,
json_t
*
json_ips
);
make
(
PCIeCard
*
card
,
json_t
*
json_ips
);
virtual
std
::
string
getType
()
const
{
return
"core"
;
}
protected:
protected:
Logger
Logger
getLogger
()
const
getLogger
()
const
...
...
lib/ips/intc.cpp
View file @
e6a7aa77
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include <unistd.h>
#include <unistd.h>
#include <errno.h>
#include <errno.h>
#include <villas/config.h>
#include <villas/config.h
pp
>
#include <villas/plugin.hpp>
#include <villas/plugin.hpp>
#include <villas/kernel/kernel.hpp>
#include <villas/kernel/kernel.hpp>
...
@@ -58,7 +58,7 @@ InterruptController::init()
...
@@ -58,7 +58,7 @@ InterruptController::init()
for
(
int
i
=
0
;
i
<
num_irqs
;
i
++
)
{
for
(
int
i
=
0
;
i
<
num_irqs
;
i
++
)
{
/* Try pinning to core */
/* Try pinning to core */
int
ret
=
kernel
::
irq_seta
ffinity
(
nos
[
i
],
card
->
affinity
,
nullptr
);
int
ret
=
kernel
::
setIRQA
ffinity
(
nos
[
i
],
card
->
affinity
,
nullptr
);
switch
(
ret
)
{
switch
(
ret
)
{
case
0
:
case
0
:
...
...
lib/ips/rtds2gpu/gpu2rtds.cpp
View file @
e6a7aa77
...
@@ -48,9 +48,9 @@ void Gpu2Rtds::dump(spdlog::level::level_enum logLevel)
...
@@ -48,9 +48,9 @@ void Gpu2Rtds::dump(spdlog::level::level_enum logLevel)
logger
->
log
(
logLevel
,
" Frame too short: {}"
,
(
status
.
frame_too_short
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Frame too short: {}"
,
(
status
.
frame_too_short
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Frame too long: {}"
,
(
status
.
frame_too_long
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Frame too long: {}"
,
(
status
.
frame_too_long
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Frame size invalid: {}"
,
(
status
.
invalid_frame_size
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Frame size invalid: {}"
,
(
status
.
invalid_frame_size
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Last count: {}"
,
status
.
last_count
);
logger
->
log
(
logLevel
,
" Last count: {}"
,
(
int
)
status
.
last_count
);
logger
->
log
(
logLevel
,
" Last seq. number: {}"
,
status
.
last_seq_nr
);
logger
->
log
(
logLevel
,
" Last seq. number: {}"
,
(
int
)
status
.
last_seq_nr
);
logger
->
log
(
logLevel
,
" Max. frame size: {}"
,
status
.
max_frame_size
);
logger
->
log
(
logLevel
,
" Max. frame size: {}"
,
(
int
)
status
.
max_frame_size
);
}
}
//bool Gpu2Rtds::startOnce(const MemoryBlock &mem, size_t frameSize, size_t dataOffset, size_t doorbellOffset)
//bool Gpu2Rtds::startOnce(const MemoryBlock &mem, size_t frameSize, size_t dataOffset, size_t doorbellOffset)
...
@@ -126,6 +126,6 @@ Gpu2Rtds::getMaxFrameSize()
...
@@ -126,6 +126,6 @@ Gpu2Rtds::getMaxFrameSize()
// logger->info("Doorbell register: {:#08x}", doorbell.value);
// logger->info("Doorbell register: {:#08x}", doorbell.value);
// logger->info(" Valid: {}", (doorbell.is_valid ? "yes" : "no"));
// logger->info(" Valid: {}", (doorbell.is_valid ? "yes" : "no"));
// logger->info(" Count: {}", doorbell.count);
// logger->info(" Count: {}", doorbell.count);
// logger->info(" Seq. number: {}", doorbell.seq_nr);
// logger->info(" Seq. number: {}",
(int)
doorbell.seq_nr);
//}
//}
lib/ips/rtds2gpu/rtds2gpu.cpp
View file @
e6a7aa77
...
@@ -42,9 +42,9 @@ void Rtds2Gpu::dump(spdlog::level::level_enum logLevel)
...
@@ -42,9 +42,9 @@ void Rtds2Gpu::dump(spdlog::level::level_enum logLevel)
logger
->
log
(
logLevel
,
" Frame too short: {}"
,
(
status
.
frame_too_short
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Frame too short: {}"
,
(
status
.
frame_too_short
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Frame too long: {}"
,
(
status
.
frame_too_long
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Frame too long: {}"
,
(
status
.
frame_too_long
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Frame size invalid: {}"
,
(
status
.
invalid_frame_size
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Frame size invalid: {}"
,
(
status
.
invalid_frame_size
?
"yes"
:
"no"
));
logger
->
log
(
logLevel
,
" Last count: {}"
,
status
.
last_count
);
logger
->
log
(
logLevel
,
" Last count: {}"
,
(
int
)
status
.
last_count
);
logger
->
log
(
logLevel
,
" Last seq. number: {}"
,
status
.
last_seq_nr
);
logger
->
log
(
logLevel
,
" Last seq. number: {}"
,
(
int
)
status
.
last_seq_nr
);
logger
->
log
(
logLevel
,
" Max. frame size: {}"
,
status
.
max_frame_size
);
logger
->
log
(
logLevel
,
" Max. frame size: {}"
,
(
int
)
status
.
max_frame_size
);
}
}
bool
Rtds2Gpu
::
startOnce
(
const
MemoryBlock
&
mem
,
size_t
frameSize
,
size_t
dataOffset
,
size_t
doorbellOffset
)
bool
Rtds2Gpu
::
startOnce
(
const
MemoryBlock
&
mem
,
size_t
frameSize
,
size_t
dataOffset
,
size_t
doorbellOffset
)
...
@@ -106,8 +106,8 @@ Rtds2Gpu::dumpDoorbell(uint32_t doorbellRegister) const
...
@@ -106,8 +106,8 @@ Rtds2Gpu::dumpDoorbell(uint32_t doorbellRegister) const
auto
&
doorbell
=
reinterpret_cast
<
reg_doorbell_t
&>
(
doorbellRegister
);
auto
&
doorbell
=
reinterpret_cast
<
reg_doorbell_t
&>
(
doorbellRegister
);
logger
->
info
(
"Doorbell register: {:#08x}"
,
doorbell
.
value
);
logger
->
info
(
"Doorbell register: {:#08x}"
,
doorbell
.
value
);
logger
->
info
(
" Valid: {}"
,
(
doorbell
.
is_valid
?
"yes"
:
"no"
)
)
;
logger
->
info
(
" Valid: {}"
,
doorbell
.
is_valid
?
"yes"
:
"no"
);
logger
->
info
(
" Count: {}"
,
doorbell
.
count
);
logger
->
info
(
" Count: {}"
,
(
int
)
doorbell
.
count
);
logger
->
info
(
" Seq. number: {}"
,
doorbell
.
seq_nr
);
logger
->
info
(
" Seq. number: {}"
,
(
int
)
doorbell
.
seq_nr
);
}
}
src/pcimem.c
View file @
e6a7aa77
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <unistd.h>
#include <string.h>
#include <string.h>
#include <errno.h>
#include <errno.h>
...
@@ -73,14 +74,14 @@ int main(int argc, char **argv) {
...
@@ -73,14 +74,14 @@ int main(int argc, char **argv) {
PRINT_ERROR
;
PRINT_ERROR
;
printf
(
"%s opened.
\n
"
,
filename
);
printf
(
"%s opened.
\n
"
,
filename
);
printf
(
"Target offset is %#
lx
, page size is %lu
\n
"
,
target
,
sysconf
(
_SC_PAGE_SIZE
));
printf
(
"Target offset is %#
jd
, page size is %lu
\n
"
,
(
intmax_t
)
target
,
sysconf
(
_SC_PAGE_SIZE
));
fflush
(
stdout
);
fflush
(
stdout
);
/* Map one page */
/* Map one page */
printf
(
"mmap(%d, %lu, %#x, %#x, %d, %#
lx
)
\n
"
,
0
,
printf
(
"mmap(%d, %lu, %#x, %#x, %d, %#
jd
)
\n
"
,
0
,
MAP_SIZE
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
MAP_SIZE
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
fd
,
target
);
fd
,
(
intmax_t
)
target
);
map_base
=
mmap
(
0
,
MAP_SIZE
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
fd
,
target
&
~
MAP_MASK
);
map_base
=
mmap
(
0
,
MAP_SIZE
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
fd
,
target
&
~
MAP_MASK
);
...
@@ -107,7 +108,7 @@ int main(int argc, char **argv) {
...
@@ -107,7 +108,7 @@ int main(int argc, char **argv) {
exit
(
2
);
exit
(
2
);
}
}
printf
(
"Value at offset %#
lx
(%p): %#x
\n
"
,
target
,
virt_addr
,
read_result
);
printf
(
"Value at offset %#
jd
(%p): %#x
\n
"
,
(
intmax_t
)
target
,
virt_addr
,
read_result
);
fflush
(
stdout
);
fflush
(
stdout
);
if
(
argc
>
4
)
{
if
(
argc
>
4
)
{
...
...
tests/unit/timer.cpp
View file @
e6a7aa77
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include <villas/fpga/card.hpp>
#include <villas/fpga/card.hpp>
#include <villas/fpga/ips/timer.hpp>
#include <villas/fpga/ips/timer.hpp>
#include <villas/config.h>
#include <villas/config.h
pp
>
#include "global.hpp"
#include "global.hpp"
// cppcheck-suppress unknownMacro
// cppcheck-suppress unknownMacro
...
...
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