aboutsummaryrefslogtreecommitdiff
path: root/docs/kernel_inference.puml
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2021-06-02 17:15:57 +0200
committerKristofer Jonsson <kristofer.jonsson@arm.com>2021-06-10 11:35:45 +0200
commit0c79f896caf1a0ac16dd92810c4b15bfff00bdb3 (patch)
treed831c0a297894065865ecd680a4ccaeb67859d39 /docs/kernel_inference.puml
parent2c01713dbeba8446b135ef19fc443b6abe098210 (diff)
downloadethos-u-linux-driver-stack-0c79f896caf1a0ac16dd92810c4b15bfff00bdb3.tar.gz
Adding documentation
Adding documentation, component- and sequence diagrams how the driver library and kernel driver work. Change-Id: I4e71b5e1f5d926386efe8f103a0f4fbc8636a494
Diffstat (limited to 'docs/kernel_inference.puml')
-rw-r--r--docs/kernel_inference.puml79
1 files changed, 79 insertions, 0 deletions
diff --git a/docs/kernel_inference.puml b/docs/kernel_inference.puml
new file mode 100644
index 0000000..b521bdc
--- /dev/null
+++ b/docs/kernel_inference.puml
@@ -0,0 +1,79 @@
+@startuml
+
+skinparam backgroundColor #FEFEFE
+
+box "Application" #0091BD
+participant "main()" as main
+end box
+
+box "Driver library" #00C1DE
+participant "Device" as ddev
+participant "Buffer" as dbuf
+participant "Network" as dnet
+participant "Inference" as dinf
+end box
+
+box "Kernel driver" #7D868C
+participant "Device" as kdev
+participant "Buffer" as kbuf
+participant "Network" as knet
+participant "Inference" as kinf
+participant "Mailbox" as kmbox
+end box
+
+box "Cortex-M application" #E5ECEB
+participant "Message process" as cmsg
+end box
+
+activate main
+
+note over main
+ Create device
+ Create network
+ Allocate and fill IFM buffers
+ Allocate OFM buffers
+end note
+
+main -> dinf++: Inference(network, ifm, ofm)
+ dinf -> knet++: ioctl(INFERENCE_CREATE, network, ifm, ofm)
+ note over kinf
+ Create inference
+ end note
+
+ knet -> kinf++: create(network, ifm, ofm)
+ kinf -> kmbox++: inference()
+ note over kmbox
+ Write inference request to queue in shared memory
+ Send IRQ
+ end note
+
+ kmbox -> cmsg: INFERENCE_REQUEST
+ return
+ return file descriptor
+ return file descriptor
+return
+
+main -> dinf++: wait()
+ dinf -> kinf++: poll()
+
+ cmsg -> kdev++: INFERENCE_RESPONSE
+ note over kdev
+ Inference response is handled by the IRQ bottom handler thread
+ Message is read from queue in shared memory
+ end note
+
+ kdev -> kmbox++: read()
+ return
+
+ note over kinf
+ Inference response handler unlocks the polling thread
+ end note
+
+ kdev -> kinf++: inference_response()
+ return
+ deactivate cmsg
+
+ return
+return
+
+@enduml