Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rtic_f4xx_nucleo
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
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
Niklas Lundberg
rtic_f4xx_nucleo
Commits
e0f00e1a
Commit
e0f00e1a
authored
4 years ago
by
Blinningjr
Browse files
Options
Downloads
Patches
Plain Diff
Corrected my answers in rtt_timing
parent
61d8332c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/rtt_timing.rs
+11
-11
11 additions, 11 deletions
examples/rtt_timing.rs
with
11 additions
and
11 deletions
examples/rtt_timing.rs
+
11
−
11
View file @
e0f00e1a
...
...
@@ -55,12 +55,12 @@ fn timed_loop() -> (u32, u32) {
// > cargo run --example rtt_timing
//
// [Your answer here]
//
2987
//
4790152 cycles
//
// A.2) How many cycles per iteration?
//
// [Your answer here]
// 4790152
// 479
.
0152
cycles
//
// A.3) Why do we need a wrapping subtraction?
//
...
...
@@ -75,17 +75,17 @@ fn timed_loop() -> (u32, u32) {
// start 30305915, end 30375916, diff 70001
//
// [Your answer here]
//
30305915
//
70001 cycles
//
// B.2) How many cycles per iteration?
//
// [Your answer here]
// 70001
// 7
.
0001
cycles
//
// What is the speedup (A/B)?
//
// [Your answer here]
// 4790152 / 70001 = 68.4297652891
// 479
.
0152 / 7
.
0001 = 68.4297652891
//
//
// Why do you think it differs that much?
...
...
@@ -124,17 +124,17 @@ fn timed_loop() -> (u32, u32) {
// start 1356808538, end 1356848539, diff 40001
//
// [Your answer here]
//
1356808538
//
40001 cycles
//
// C.2) How many cycles per iteration?
//
// [Your answer here]
// 40001
// 4
.
0001
cycles
//
// What is the speedup (A/C)?
//
// [Your answer here]
// 4790152 / 40001 = 119.75080623
// 479
.
0152 / 4
.
0001 = 119.75080623
//
// ------------------------------------------------------------------------
// D) Now lets have a closer look at the generated assembly.
...
...
@@ -223,7 +223,7 @@ fn timed_loop() -> (u32, u32) {
// https://developer.arm.com/documentation/ddi0439/b/Data-Watchpoint-and-Trace-Unit/DWT-Programmers-Model
//
// [Your answer here]
// No, there is no function call. The two following line loads in the lo
a
ction of the cycle count,
// No, there is no function call. The two following line loads in the loc
a
tion of the cycle count,
// which is always updated. Thus r1 holds the location of the cycle counter.
// 0x08000232 <+0>: movw r1, #4100 ; 0x1004
// 0x0800023a <+8>: movt r1, #57344 ; 0xe000
...
...
@@ -300,7 +300,7 @@ fn timed_loop() -> (u32, u32) {
// By how much does the cycle counter increase for each iteration?
//
// [Your answer here]
// 4
// 4
cycles
//
// ------------------------------------------------------------------------
// F) Reseting the cycle counter
...
...
@@ -337,7 +337,7 @@ fn timed_loop() -> (u32, u32) {
// (when hitting the `timed_loop` breakpoint)?
//
// [Your answer here]
// 0x00000009
// 0x00000009
= 9 cycles
//
// ------------------------------------------------------------------------
// G) Finally some statics
...
...
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