Kristofer Jonsson | 0c79f89 | 2021-06-02 17:15:57 +0200 | [diff] [blame] | 1 | @startuml |
| 2 | |
| 3 | skinparam backgroundColor #FEFEFE |
| 4 | |
| 5 | box "Application" #0091BD |
| 6 | participant "main()" as main |
| 7 | end box |
| 8 | |
| 9 | box "Driver library" #00C1DE |
| 10 | participant "Device" as ddev |
| 11 | participant "Buffer" as dbuf |
| 12 | participant "Network" as dnet |
| 13 | participant "Inference" as dinf |
| 14 | end box |
| 15 | |
| 16 | box "Kernel driver" #7D868C |
| 17 | participant "Device" as kdev |
| 18 | participant "Buffer" as kbuf |
| 19 | participant "Network" as knet |
| 20 | participant "Inference" as kinf |
| 21 | participant "Mailbox" as kmbox |
| 22 | end box |
| 23 | |
| 24 | box "Cortex-M application" #E5ECEB |
| 25 | participant "Message process" as cmsg |
| 26 | end box |
| 27 | |
| 28 | activate main |
| 29 | |
| 30 | note over main |
| 31 | Create device |
| 32 | Create network |
| 33 | Allocate and fill IFM buffers |
| 34 | Allocate OFM buffers |
| 35 | end note |
| 36 | |
| 37 | main -> 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 |
| 54 | return |
| 55 | |
| 56 | main -> 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 |
| 77 | return |
| 78 | |
| 79 | @enduml |