aboutsummaryrefslogtreecommitdiff
path: root/docs/kernel_inference.svg
blob: 53ed8b02554c3581c434cb6e122ea95e980a0eea (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="832px" preserveAspectRatio="none" style="width:1288px;height:832px;background:#FEFEFE;" version="1.1" viewBox="0 0 1288 832" width="1288px" zoomAndPan="magnify"><defs><filter height="300%" id="fhqhey4ocrvwe" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><rect fill="#0091BD" height="817.6484" style="stroke: #A80036; stroke-width: 1.0;" width="89" x="60" y="4"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="83" x="63" y="16.0669">Application</text><rect fill="#00C1DE" height="817.6484" style="stroke: #A80036; stroke-width: 1.0;" width="320" x="151" y="4"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="96" x="263" y="16.0669">Driver library</text><rect fill="#7D868C" height="817.6484" style="stroke: #A80036; stroke-width: 1.0;" width="591" x="473" y="4"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="95" x="721" y="16.0669">Kernel driver</text><rect fill="#E5ECEB" height="817.6484" style="stroke: #A80036; stroke-width: 1.0;" width="159" x="1118" y="4"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="153" x="1121" y="16.0669">Cortex-M application</text><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="705.9219" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="99.5" y="68.4297"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="296.3281" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="420.5" y="173.9609"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="266.0625" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="420.5" y="499.2891"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="216.7969" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="504.5" y="557.5547"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="253.0625" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="731.5" y="203.0938"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="155.6641" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="922.5" y="271.3594"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="222.9297" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="922.5" y="528.4219"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="14.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="927.5" y="723.2188"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="97.5313" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="1020.5" y="300.4922"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="14.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="1020.5" y="640.9531"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="104" x2="104" y1="58.4297" y2="783.3516"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="187" x2="187" y1="58.4297" y2="783.3516"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="259" x2="259" y1="58.4297" y2="783.3516"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="336" x2="336" y1="58.4297" y2="783.3516"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="425" x2="425" y1="58.4297" y2="783.3516"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="509" x2="509" y1="58.4297" y2="783.3516"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="581" x2="581" y1="58.4297" y2="783.3516"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="736" x2="736" y1="58.4297" y2="783.3516"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="927" x2="927" y1="58.4297" y2="783.3516"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="1025" x2="1025" y1="58.4297" y2="783.3516"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="1197" x2="1197" y1="58.4297" y2="783.3516"/><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="57" x="74" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="43" x="81" y="43.1279">main()</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="57" x="74" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="43" x="81" y="802.3467">main()</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="61" x="155" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="47" x="162" y="43.1279">Device</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="61" x="155" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="47" x="162" y="802.3467">Device</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="55" x="230" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="41" x="237" y="43.1279">Buffer</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="55" x="230" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="41" x="237" y="802.3467">Buffer</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="71" x="299" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="57" x="306" y="43.1279">Network</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="71" x="299" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="57" x="306" y="802.3467">Network</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="79" x="384" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="65" x="391" y="43.1279">Inference</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="79" x="384" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="65" x="391" y="802.3467">Inference</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="61" x="477" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="47" x="484" y="43.1279">Device</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="61" x="477" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="47" x="484" y="802.3467">Device</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="55" x="552" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="41" x="559" y="43.1279">Buffer</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="55" x="552" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="41" x="559" y="802.3467">Buffer</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="71" x="699" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="57" x="706" y="43.1279">Network</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="71" x="699" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="57" x="706" y="802.3467">Network</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="79" x="886" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="65" x="893" y="43.1279">Inference</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="79" x="886" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="65" x="893" y="802.3467">Inference</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="65" x="991" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="51" x="998" y="43.1279">Mailbox</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="65" x="991" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="51" x="998" y="802.3467">Mailbox</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="137" x="1127" y="23.1328"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="123" x="1134" y="43.1279">Message process</text><rect fill="#FEFECE" filter="url(#fhqhey4ocrvwe)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="137" x="1127" y="782.3516"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="123" x="1134" y="802.3467">Message process</text><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="705.9219" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="99.5" y="68.4297"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="296.3281" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="420.5" y="173.9609"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="266.0625" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="420.5" y="499.2891"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="216.7969" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="504.5" y="557.5547"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="253.0625" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="731.5" y="203.0938"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="155.6641" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="922.5" y="271.3594"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="222.9297" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="922.5" y="528.4219"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="14.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="927.5" y="723.2188"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="97.5313" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="1020.5" y="300.4922"/><rect fill="#FFFFFF" filter="url(#fhqhey4ocrvwe)" height="14.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="1020.5" y="640.9531"/><polygon fill="#FBFB77" filter="url(#fhqhey4ocrvwe)" points="8,73.4297,8,143.4297,198,143.4297,198,83.4297,188,73.4297,8,73.4297" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="188" x2="188" y1="73.4297" y2="83.4297"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="198" x2="188" y1="83.4297" y2="83.4297"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="88" x="14" y="90.4966">Create device</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="97" x="14" y="105.6294">Create network</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="169" x="14" y="120.7622">Allocate and fill IFM buffers</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="131" x="14" y="135.895">Allocate OFM buffers</text><polygon fill="#A80036" points="408.5,169.9609,418.5,173.9609,408.5,177.9609,412.5,173.9609" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="109.5" x2="414.5" y1="173.9609" y2="173.9609"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="180" x="116.5" y="169.0278">Inference(network, ifm, ofm)</text><polygon fill="#A80036" points="719.5,199.0938,729.5,203.0938,719.5,207.0938,723.5,203.0938" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="430.5" x2="725.5" y1="203.0938" y2="203.0938"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="282" x="437.5" y="198.1606">ioctl(INFERENCE_CREATE, network, ifm, ofm)</text><polygon fill="#FBFB77" filter="url(#fhqhey4ocrvwe)" points="862,216.2266,862,241.2266,989,241.2266,989,226.2266,979,216.2266,862,216.2266" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="979" x2="979" y1="216.2266" y2="226.2266"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="989" x2="979" y1="226.2266" y2="226.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="106" x="868" y="233.2935">Create inference</text><polygon fill="#A80036" points="910.5,267.3594,920.5,271.3594,910.5,275.3594,914.5,271.3594" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="741.5" x2="916.5" y1="271.3594" y2="271.3594"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="162" x="748.5" y="266.4263">create(network, ifm, ofm)</text><polygon fill="#A80036" points="1008.5,296.4922,1018.5,300.4922,1008.5,304.4922,1012.5,300.4922" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="932.5" x2="1014.5" y1="300.4922" y2="300.4922"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="69" x="939.5" y="295.5591">inference()</text><polygon fill="#FBFB77" filter="url(#fhqhey4ocrvwe)" points="848,313.625,848,353.625,1199,353.625,1199,323.625,1189,313.625,848,313.625" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="1189" x2="1189" y1="313.625" y2="323.625"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="1199" x2="1189" y1="323.625" y2="323.625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="330" x="854" y="330.6919">Write inference request to queue in shared memory</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="58" x="854" y="345.8247">Send IRQ</text><polygon fill="#A80036" points="1185.5,379.8906,1195.5,383.8906,1185.5,387.8906,1189.5,383.8906" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="1030.5" x2="1191.5" y1="383.8906" y2="383.8906"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="138" x="1037.5" y="378.9575">INFERENCE_REQUEST</text><polygon fill="#A80036" points="943.5,394.0234,933.5,398.0234,943.5,402.0234,939.5,398.0234" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 2.0,2.0;" x1="937.5" x2="1024.5" y1="398.0234" y2="398.0234"/><polygon fill="#A80036" points="752.5,423.0234,742.5,427.0234,752.5,431.0234,748.5,427.0234" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 2.0,2.0;" x1="746.5" x2="926.5" y1="427.0234" y2="427.0234"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="86" x="758.5" y="422.0903">file descriptor</text><polygon fill="#A80036" points="441.5,452.1563,431.5,456.1563,441.5,460.1563,437.5,456.1563" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 2.0,2.0;" x1="435.5" x2="735.5" y1="456.1563" y2="456.1563"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="86" x="447.5" y="451.2231">file descriptor</text><polygon fill="#A80036" points="120.5,466.2891,110.5,470.2891,120.5,474.2891,116.5,470.2891" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 2.0,2.0;" x1="114.5" x2="424.5" y1="470.2891" y2="470.2891"/><polygon fill="#A80036" points="408.5,495.2891,418.5,499.2891,408.5,503.2891,412.5,499.2891" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="109.5" x2="414.5" y1="499.2891" y2="499.2891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="35" x="116.5" y="494.356">wait()</text><polygon fill="#A80036" points="910.5,524.4219,920.5,528.4219,910.5,532.4219,914.5,528.4219" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="430.5" x2="916.5" y1="528.4219" y2="528.4219"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="32" x="437.5" y="523.4888">poll()</text><polygon fill="#A80036" points="525.5,553.5547,515.5,557.5547,525.5,561.5547,521.5,557.5547" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="519.5" x2="1196.5" y1="557.5547" y2="557.5547"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="148" x="531.5" y="552.6216">INFERENCE_RESPONSE</text><polygon fill="#FBFB77" filter="url(#fhqhey4ocrvwe)" points="292,570.6875,292,610.6875,722,610.6875,722,580.6875,712,570.6875,292,570.6875" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="712" x2="712" y1="570.6875" y2="580.6875"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="722" x2="712" y1="580.6875" y2="580.6875"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="409" x="298" y="587.7544">Inference response is handled by the IRQ bottom handler thread</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="303" x="298" y="602.8872">Message is read from queue in shared memory</text><polygon fill="#A80036" points="1008.5,636.9531,1018.5,640.9531,1008.5,644.9531,1012.5,640.9531" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="514.5" x2="1014.5" y1="640.9531" y2="640.9531"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="39" x="521.5" y="636.02">read()</text><polygon fill="#A80036" points="525.5,651.0859,515.5,655.0859,525.5,659.0859,521.5,655.0859" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 2.0,2.0;" x1="519.5" x2="1024.5" y1="655.0859" y2="655.0859"/><polygon fill="#FBFB77" filter="url(#fhqhey4ocrvwe)" points="744,668.0859,744,693.0859,1107,693.0859,1107,678.0859,1097,668.0859,744,668.0859" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="1097" x2="1097" y1="668.0859" y2="678.0859"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="1107" x2="1097" y1="678.0859" y2="678.0859"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="342" x="750" y="685.1528">Inference response handler unlocks the polling thread</text><polygon fill="#A80036" points="915.5,719.2188,925.5,723.2188,915.5,727.2188,919.5,723.2188" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="514.5" x2="921.5" y1="723.2188" y2="723.2188"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="135" x="521.5" y="718.2856">inference_response()</text><polygon fill="#A80036" points="525.5,733.3516,515.5,737.3516,525.5,741.3516,521.5,737.3516" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 2.0,2.0;" x1="519.5" x2="921.5" y1="737.3516" y2="737.3516"/><polygon fill="#A80036" points="441.5,747.3516,431.5,751.3516,441.5,755.3516,437.5,751.3516" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 2.0,2.0;" x1="435.5" x2="926.5" y1="751.3516" y2="751.3516"/><polygon fill="#A80036" points="120.5,761.3516,110.5,765.3516,120.5,769.3516,116.5,765.3516" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 2.0,2.0;" x1="114.5" x2="424.5" y1="765.3516" y2="765.3516"/><!--
@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

PlantUML version 1.2017.15(Mon Jul 03 18:45:34 CEST 2017)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 11.0.11+9-Ubuntu-0ubuntu2.18.04
Operating System: Linux
OS Version: 5.4.0-73-generic
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>