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
ff491d33
Commit
ff491d33
authored
Sep 16, 2020
by
Antoine Kaufmann
Browse files
netsim_common: fix for completely unsynchronized operation
parent
f692c71a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
netsim_common/netsim.c
netsim_common/netsim.c
+4
-1
No files found.
netsim_common/netsim.c
View file @
ff491d33
...
@@ -64,7 +64,7 @@ int netsim_init(struct netsim_interface *nsif,
...
@@ -64,7 +64,7 @@ int netsim_init(struct netsim_interface *nsif,
if
((
di
.
flags
&
COSIM_ETH_PROTO_FLAGS_DI_SYNC
)
==
0
)
{
if
((
di
.
flags
&
COSIM_ETH_PROTO_FLAGS_DI_SYNC
)
==
0
)
{
*
sync_eth
=
0
;
*
sync_eth
=
0
;
nsif
->
sync
=
1
;
nsif
->
sync
=
0
;
}
else
{
}
else
{
nsif
->
sync
=
*
sync_eth
;
nsif
->
sync
=
*
sync_eth
;
}
}
...
@@ -142,6 +142,9 @@ int netsim_n2d_sync(struct netsim_interface *nsif, uint64_t timestamp,
...
@@ -142,6 +142,9 @@ int netsim_n2d_sync(struct netsim_interface *nsif, uint64_t timestamp,
volatile
union
cosim_eth_proto_n2d
*
msg
;
volatile
union
cosim_eth_proto_n2d
*
msg
;
volatile
struct
cosim_eth_proto_n2d_sync
*
sync
;
volatile
struct
cosim_eth_proto_n2d_sync
*
sync
;
if
(
!
nsif
->
sync
)
return
0
;
if
(
nsif
->
n2d_timestamp
!=
0
&&
if
(
nsif
->
n2d_timestamp
!=
0
&&
timestamp
-
nsif
->
n2d_timestamp
<
sync_delay
)
timestamp
-
nsif
->
n2d_timestamp
<
sync_delay
)
return
0
;
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