blob: b521bdc31e9b77902360b84094214ee3c56b614d [file] [log] [blame]
Kristofer Jonsson0c79f892021-06-02 17:15:57 +02001@startuml
2
3skinparam backgroundColor #FEFEFE
4
5box "Application" #0091BD
6participant "main()" as main
7end box
8
9box "Driver library" #00C1DE
10participant "Device" as ddev
11participant "Buffer" as dbuf
12participant "Network" as dnet
13participant "Inference" as dinf
14end box
15
16box "Kernel driver" #7D868C
17participant "Device" as kdev
18participant "Buffer" as kbuf
19participant "Network" as knet
20participant "Inference" as kinf
21participant "Mailbox" as kmbox
22end box
23
24box "Cortex-M application" #E5ECEB
25participant "Message process" as cmsg
26end box
27
28activate main
29
30note over main
31 Create device
32 Create network
33 Allocate and fill IFM buffers
34 Allocate OFM buffers
35end note
36
37main -> dinf++: Inference(network, ifm, ofm)
38 dinf -> knet++: ioctl(INFERENCE_CREATE, network, ifm, ofm)
39 note over kinf
40 Create inference
41 end note
42
43 knet -> kinf++: create(network, ifm, ofm)
44 kinf -> kmbox++: inference()
45 note over kmbox
46 Write inference request to queue in shared memory
47 Send IRQ
48 end note
49
50 kmbox -> cmsg: INFERENCE_REQUEST
51 return
52 return file descriptor
53 return file descriptor
54return
55
56main -> dinf++: wait()
57 dinf -> kinf++: poll()
58
59 cmsg -> kdev++: INFERENCE_RESPONSE
60 note over kdev
61 Inference response is handled by the IRQ bottom handler thread
62 Message is read from queue in shared memory
63 end note
64
65 kdev -> kmbox++: read()
66 return
67
68 note over kinf
69 Inference response handler unlocks the polling thread
70 end note
71
72 kdev -> kinf++: inference_response()
73 return
74 deactivate cmsg
75
76 return
77return
78
79@enduml