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
01bdcb45
Commit
01bdcb45
authored
May 04, 2023
by
Jonas Kaufmann
Committed by
Antoine Kaufmann
May 09, 2023
Browse files
lib/nicbm: implement posted writes
parent
a0a2473d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
+20
-11
lib/simbricks/nicbm/nicbm.cc
lib/simbricks/nicbm/nicbm.cc
+19
-10
lib/simbricks/nicbm/nicbm.h
lib/simbricks/nicbm/nicbm.h
+1
-1
No files found.
lib/simbricks/nicbm/nicbm.cc
View file @
01bdcb45
...
@@ -295,24 +295,29 @@ void Runner::H2DRead(volatile struct SimbricksProtoPcieH2DRead *read) {
...
@@ -295,24 +295,29 @@ void Runner::H2DRead(volatile struct SimbricksProtoPcieH2DRead *read) {
SIMBRICKS_PROTO_PCIE_D2H_MSG_READCOMP
);
SIMBRICKS_PROTO_PCIE_D2H_MSG_READCOMP
);
}
}
void
Runner
::
H2DWrite
(
volatile
struct
SimbricksProtoPcieH2DWrite
*
write
)
{
void
Runner
::
H2DWrite
(
volatile
struct
SimbricksProtoPcieH2DWrite
*
write
,
bool
posted
)
{
volatile
union
SimbricksProtoPcieD2H
*
msg
;
volatile
union
SimbricksProtoPcieD2H
*
msg
;
volatile
struct
SimbricksProtoPcieD2HWritecomp
*
wc
;
volatile
struct
SimbricksProtoPcieD2HWritecomp
*
wc
;
msg
=
D2HAlloc
();
wc
=
&
msg
->
writecomp
;
#ifdef DEBUG_NICBM
#ifdef DEBUG_NICBM
uint64_t
dbg_val
=
0
;
uint64_t
dbg_val
=
0
;
memcpy
(
&
dbg_val
,
(
const
void
*
)
write
->
data
,
write
->
len
<=
8
?
write
->
len
:
8
);
memcpy
(
&
dbg_val
,
(
const
void
*
)
write
->
data
,
write
->
len
<=
8
?
write
->
len
:
8
);
printf
(
"main_time = %lu: nicbm: write(off=0x%lx, len=%u, val=0x%lx)
\n
"
,
printf
(
main_time_
,
write
->
offset
,
write
->
len
,
dbg_val
);
"main_time = %lu: nicbm: write(off=0x%lx, len=%u, val=0x%lx, "
"posted=%u)
\n
"
,
main_time_
,
write
->
offset
,
write
->
len
,
dbg_val
,
posted
);
#endif
#endif
dev_
.
RegWrite
(
write
->
bar
,
write
->
offset
,
(
void
*
)
write
->
data
,
write
->
len
);
dev_
.
RegWrite
(
write
->
bar
,
write
->
offset
,
(
void
*
)
write
->
data
,
write
->
len
);
wc
->
req_id
=
write
->
req_id
;
SimbricksPcieIfD2HOutSend
(
&
nicif_
.
pcie
,
msg
,
if
(
!
posted
)
{
SIMBRICKS_PROTO_PCIE_D2H_MSG_WRITECOMP
);
msg
=
D2HAlloc
();
wc
=
&
msg
->
writecomp
;
wc
->
req_id
=
write
->
req_id
;
SimbricksPcieIfD2HOutSend
(
&
nicif_
.
pcie
,
msg
,
SIMBRICKS_PROTO_PCIE_D2H_MSG_WRITECOMP
);
}
}
}
void
Runner
::
H2DReadcomp
(
volatile
struct
SimbricksProtoPcieH2DReadcomp
*
rc
)
{
void
Runner
::
H2DReadcomp
(
volatile
struct
SimbricksProtoPcieH2DReadcomp
*
rc
)
{
...
@@ -399,7 +404,11 @@ void Runner::PollH2D() {
...
@@ -399,7 +404,11 @@ void Runner::PollH2D() {
break
;
break
;
case
SIMBRICKS_PROTO_PCIE_H2D_MSG_WRITE
:
case
SIMBRICKS_PROTO_PCIE_H2D_MSG_WRITE
:
H2DWrite
(
&
msg
->
write
);
H2DWrite
(
&
msg
->
write
,
false
);
break
;
case
SIMBRICKS_PROTO_PCIE_H2D_MSG_WRITE_POSTED
:
H2DWrite
(
&
msg
->
write
,
true
);
break
;
break
;
case
SIMBRICKS_PROTO_PCIE_H2D_MSG_READCOMP
:
case
SIMBRICKS_PROTO_PCIE_H2D_MSG_READCOMP
:
...
...
lib/simbricks/nicbm/nicbm.h
View file @
01bdcb45
...
@@ -141,7 +141,7 @@ class Runner {
...
@@ -141,7 +141,7 @@ class Runner {
volatile
union
SimbricksProtoNetMsg
*
D2NAlloc
();
volatile
union
SimbricksProtoNetMsg
*
D2NAlloc
();
void
H2DRead
(
volatile
struct
SimbricksProtoPcieH2DRead
*
read
);
void
H2DRead
(
volatile
struct
SimbricksProtoPcieH2DRead
*
read
);
void
H2DWrite
(
volatile
struct
SimbricksProtoPcieH2DWrite
*
write
);
void
H2DWrite
(
volatile
struct
SimbricksProtoPcieH2DWrite
*
write
,
bool
posted
);
void
H2DReadcomp
(
volatile
struct
SimbricksProtoPcieH2DReadcomp
*
rc
);
void
H2DReadcomp
(
volatile
struct
SimbricksProtoPcieH2DReadcomp
*
rc
);
void
H2DWritecomp
(
volatile
struct
SimbricksProtoPcieH2DWritecomp
*
wc
);
void
H2DWritecomp
(
volatile
struct
SimbricksProtoPcieH2DWritecomp
*
wc
);
void
H2DDevctrl
(
volatile
struct
SimbricksProtoPcieH2DDevctrl
*
dc
);
void
H2DDevctrl
(
volatile
struct
SimbricksProtoPcieH2DDevctrl
*
dc
);
...
...
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