aboutsummaryrefslogtreecommitdiff
path: root/lib/ethosu_monitor/docs/ethosu_monitor_example_usage.puml
blob: 868ac4db5cd04bd269605b284350b845d207b396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@startuml
skinparam backgroundColor #FEFEFE

box "Application" #Orange
participant "Application" as app
end box

box "PMU monitor" #Orange
participant "PMU monitor" as pmumon
end box

box "Tensorflow" #LightGreen
participant "TFLu" as tflu
end box

box "Ethos-U" #LightBlue
participant "Ethos-U driver" as driver
end box

box "EventRecorder" #LightBlue
participant EventRecorder as event
end box

box "Timer source"
participant "Timer source" as timer
end box

app -> event: EventRecorderInitialize()

app -> tflu: Invoke()
tflu -> driver: ethosu_invoke()

driver -> app ++: ethosu_inference_begin(inference data, driver) [weak]
app -> pmumon: ethosu_monitor.configure()
pmumon -> driver: 'Configure PMU'
pmumon -> timer: Enable timer events
return

group While the Ethos-U custom op is executing
group Recurrent: PMU-monitor log events
  ...
  timer -> app++: Timer event
  app -> pmumon: ethosu_monitor.monitorSample()
  pmumon -> driver: 'Sample PMU registers'
  driver --> pmumon
  pmumon -> event : EventRecord2()
...
end
end

driver -> app++: ethosu_inference_end(inference data, driver) [weak]
app -> timer: 'Disable timer events'
app -> pmumon: ethosu_monitor.monitorSample()
pmumon -> driver: 'Sample PMU registers'
driver --> pmumon
pmumon -> event : EventRecord2()
app -> pmumon: ethosu_monitor.release()
pmumon -> driver: 'Disable PMU'
return

@enduml