Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
47
Issues
47
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
02bf7e83
Commit
02bf7e83
authored
Dec 01, 2013
by
Pietro Fezzardi
Committed by
Alessandro Rubini
Mar 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
time-sim: added sim_fast_forward_ns
It will be used to jump ahead in time when no machine is executing.
parent
202f3e82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
ppsi-sim.h
arch-sim/ppsi-sim.h
+1
-0
sim-time.c
time-sim/sim-time.c
+14
-0
No files found.
arch-sim/ppsi-sim.h
View file @
02bf7e83
...
...
@@ -102,5 +102,6 @@ static inline int pp_sim_is_slave(struct pp_instance *ppi)
return
((
ppi
-
ppi
->
glbs
->
pp_instances
)
==
SIM_SLAVE
);
}
extern
int
sim_fast_forward_ns
(
struct
pp_globals
*
ppg
,
int64_t
ff_ns
);
extern
int
sim_set_global_DS
(
struct
pp_instance
*
ppi
);
extern
void
sim_main_loop
(
struct
pp_globals
*
ppg
);
time-sim/sim-time.c
View file @
02bf7e83
...
...
@@ -15,6 +15,20 @@
#include <ppsi/ppsi.h>
#include "../arch-sim/ppsi-sim.h"
int
sim_fast_forward_ns
(
struct
pp_globals
*
ppg
,
int64_t
ff_ns
)
{
struct
pp_sim_time_instance
*
t_inst
;
int
i
;
for
(
i
=
0
;
i
<
ppg
->
nlinks
;
i
++
)
{
t_inst
=
&
SIM_PPI_ARCH
(
ppg
->
pp_instances
+
i
)
->
time
;
t_inst
->
current_ns
+=
ff_ns
+
(
t_inst
->
freq_ppm_servo
+
t_inst
->
freq_ppm_real
)
*
ff_ns
/
1000
/
1000
/
1000
;
}
pp_diag
(
0
,
time
,
1
,
"%s: %li ns
\n
"
,
__func__
,
(
long
)
ff_ns
);
return
0
;
}
static
int
sim_time_get
(
struct
pp_instance
*
ppi
,
TimeInternal
*
t
)
{
struct
timespec
ts
;
...
...
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