Uživatelské nástroje

Nástroje pro tento web


simkernel_systemvariables

Rozdíly

Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.

Odkaz na výstup diff

simkernel_systemvariables [2012/01/12 11:49]
marek [Prvá implementácia podporných premenných v surovom formáte na SimKernel-u]
simkernel_systemvariables [2012/01/18 10:34] (aktuální)
marek
Řádek 1: Řádek 1:
-==== Formát dát na definovanie Simulátoru (SimComponent) ==== +Under development
- +
- ​Definovať spustiteľný simulátor je možné pomocou **SimCompoment**-u ako komponentového stromu. Je to zloženie základných komponent, ktorých vstupy a výstupy sú navzájom prepojené. Základná komponenta (list stromu) môže byť dvoch druhov.  +
-  - EnvironmentInstID=-1 : ovládač prostredia (spúšťa sa samostatne). +
-  - EnvironmentInstID>​=0 : komponenta v danom prostredí (môže sa spúšťať automaticky cez ovládač daného prostredia). +
- +
- +
-<​uml>​ +
- +
-class "​Leaf"​ as SimIComponentDefinition  +
-SimIComponentDefinition : instancesIDs "​instances of this definition"​ +
-SimIComponentDefinition : name "​definition name"​ +
-SimIComponentDefinition : input [0..*] "input variable names"​ +
-SimIComponentDefinition : output [0..*] "​output variable names"​ +
-SimIComponentDefinition : shared [0..*] "​shared variable names"​ +
-SimIComponentDefinition : inputEvent [0..*] "input event names"​ +
-SimIComponentDefinition : outputEvent [0..*] "​output event names"​ +
-SimIComponentDefinition : bus [0..*] "buses names"​ +
-SimIComponentDefinition : baseDefID "-1 if not inherited"​ +
-SimIComponentDefinition : environmentInstID "-1 for driver"​ +
- +
-class "​Node"​ as SimGroupComponentDefinition +
-SimGroupComponentDefinition : outputFromRef [0..*] ​  "​connect each output with a child|child.bus output"​ +
-SimGroupComponentDefinition : inputEventToRefs [0..*] "​connect each input event with child|child.bus input events"​ +
-SimGroupComponentDefinition : busOutputFromRef [0..*] "​define some bus output such a child|child.bus output"​ +
-SimGroupComponentDefinition : busInputEventToRefs [0..*] "​define some bus input event such a child|child.bus input events"​ +
-SimGroupComponentDefinition : children [1..*]  +
- +
- +
-SimGroupComponentDefinition -right-|>​ SimIComponentDefinition +
- +
-class "​Child"​ as SimComponentInstanceDefinition +
-SimComponentInstanceDefinition : localName +
-SimComponentInstanceDefinition : compDefID "Child content"​ +
-SimComponentInstanceDefinition : inputFromRef ​ [0..*] "​connect each input with sibling|sibling.bus output or parent|parent.bus input"​ +
-SimComponentInstanceDefinition : sharedEqRef [0..*] "​connect each shared variable with parent|parent.bus shared variable or stop sharing above"​ +
-SimComponentInstanceDefinition : outputEventToRefs ​ [0..*] "​connect each output event with sibling|sibling.bus input events or parent|parent.bus output events"​  +
-SimComponentInstanceDefinition : busEqRef [0..*] "​connect each bus with a sibling'​s or parent'​s bus" +
-SimGroupComponentDefinition "​1"​ o-down- "​1..*"​ SimComponentInstanceDefinition +
-SimComponentInstanceDefinition "​1"​ o-- "​1"​ SimIComponentDefinition +
- +
-</​uml>​ +
- +
-Je dobré si uvedomiť, že pri práci s definíciami komponent a ich prepojení sa nepracuje s hodnotami premenných(resp. udalostí). Hodnotu premennej(resp. udalosti) za behu aplikácie je lepšie držať pevne v rukách komponenty, ktorá danú hodnotu vytvorila(v prípade udalostí je to komponenta, ktorá dané udalosti spracováva). Ukazuje sa, že nie je nutné ani vhodné aby túto hodnotu menili iné komponenty. Inštancia základnej komponenty tak definuje v SimKernel-e každú jej výstupnú premennú(resp. poslucháča udalostí) avšak nedefinuje v SimKernel-e žiadne vstupné premenné (resp. samotnú hodnotu udalosti). Prepojenie výstupných premenných na vstupné zabezpečujú atribúty "​inputRef"​ a "​outputRef"​. Hodnotou atribútu je lokálny názov vstupu spolu so skupinovým názvom výstupu. Prepojenie udalostí(outputEvent) na poslucháčov udalostí(inputEvents) zabezpečujú atribúty "​inputEventsRefs"​ a "​outputEventsRefs"​. Hodnotou atribútu je lokálny názov udalosti spolu so skupinovým názvom poslucháča. Premenné skupiny je z pohľadu z vnútra skupiny nutné chápať obrátene, tak aby platilo: vonkajší výstup zo skupiny je výstupom z jej potomka(output),​ vonkajší vstup do skupiny je napojený na vstupy potomkov(inputs),​ vonkajší poslucháč skupiny je poslucháčom potomoka(inputEvents),​ vonkajšia udalosť skupiny je napojená na udalosti potomkov(outputEvents). +
- +
-====== Prvá implementácia podporných premenných v surovom formáte na SimKernel-u ====== +
-Na jednom SimKernel-u môže v jeden moment bežať viacero inštancií viacerých aplikácií. V tomto režime, keď SimKernel beží nonstop ako služba je nutné riešiť réžie s rôznymi časťami =komponentmi rôznych aplikácií. +
- +
-Definície SimComponent +
- +
-^ SimKernel request ​    ^ answer type ^ description ^  +
-| get(1) | long[] | Pointer array to component definitions identificators. ​ |  +
-| get(get(1)[i]) | long[] | Pointer array to attributes identificators of i-th component definition . | +
-| get(get(get(1)[i])[0]) | long[] | **Instances** of i-th component definition. | +
-| get(get(get(1)[i])[0]) | long[] | Pointer array to component instances of i-th component definition. ​ |  +
-| get(get(get(get(1)[i])[0])[j]) | long[] | Pointer array to attributes identificators (j-th component instance,​i-th component definition). | +
-| get(get(get(get(get(1)[i])[0])[j])[0]) | long | **DefID** definition identificator (j-th component instance,​i-th component definition). | +
-| get(get(get(get(get(1)[i])[0])[j])[1]) | byte[] | **InputEvents** current mask of last events requests (j-th component instance,​i-th component definition). | +
-| get(get(get(get(get(1)[i])[0])[j])[2]) | long[] | Pointer array to **children** component instances identificators (j-th component instance,​i-th component definition). __Only for node!__| +
-| get(get(get(get(get(1)[i])[0])[j]))[3])[k] | long | **ChildID** k-th child component instance identificator (j-th component instance,​i-th component definition). __Only for node!__ | +
-| get(get(get(get(get(1)[i])[0])[j]))[4])[n] | long[] | **Buses** instances identificators of n-th bus (j-th component instance,​i-th component definition). | +
-| get(get(get(get(get(1)[i])[0])[j]))[5+m]) | byte[] | **Output** current value of m-th output variable (j-th component instance,​i-th component definition). | +
-| get(get(get(1)[i])[1]) | string | **Name** of i-th component definition. | +
-| get(get(get(1)[i])[2]) | string[] | **Input** names of i-th component definition. | +
-| get(get(get(1)[i])[3]) | string[] | **Output** names of i-th component definition. | +
-| get(get(get(1)[i])[4]) | string[] | **Shared** names of i-th component definition. | +
-| get(get(get(1)[i])[5]) | string[] | **InputEvent** names of i-th component definition. | +
-| get(get(get(1)[i])[6]) | string[] | **OutputEvent** names of i-th component definition.| +
-| get(get(get(1)[i])[7]) | string[] | **Bus** names of i-th component definition . | +
-| get(get(1)[i])[8] | long | **BaseID** pointer to base definition if this is extension, -1 otherwise.| +
-| get(get(1)[i])[9] | long | **EnvironmentInstID** pointer to environment driver instance of i-th component definition. ​ | +
-| get(get(get(1)[i])[10])) | int[] | **OutputFromRef** of i-th component definition. __Only for node!__ | +
-| get(get(get(1)[i])[10])[0+k*3] | int | Index of child from which is k-th output connected (__internal variable connection__ in i-th component definition). | +
-| get(get(get(1)[i])[10])[1+k*3] | int | Index of bus(or -1) from which is k-th output connected (__internal variable connection__ in i-th component definition). | +
-| get(get(get(1)[i])[10])[2+k*3] | int | Index of output from which is k-th output connected (__internal variable connection__ in i-th component definition). | +
-| get(get(get(1)[i])[11]) | long[] | **InputEventToRefs** as pointer array to identificators of internal event connections in i-th component definition. ​ __Only for node!__ | +
-| get(get(get(get(1)[i])[11])[m])[0+n*3] | int | Indexes of child to which is m-th input event connected (__internal event connection__ in i-th component definition). | +
-| get(get(get(get(1)[i])[11])[m])[1+n*3] | int | Indexes of bus(or -1) to which is m-th input event connected (__internal event connection__ in i-th component definition). | +
-| get(get(get(get(1)[i])[11])[m])[2+n*3] | int | Indexes of input event to which is m-th input event connected (__internal event connection__ in i-th component definition). | +
-| get(get(get(1)[i])[12]) | long[] | **BusOutputFromRef** of i-th component definition . | +
-| get(get(get(1)[i])[12])[0+k*4] | int | Bus index of signal. | +
-| get(get(get(1)[i])[12])[1+k*4] | int | Index of child from which is bus output connected (__internal variable connection__ in i-th component definition). | +
-| get(get(get(1)[i])[12])[2+k*4] | int | Index of bus(or -1) from which is bus output connected (__internal variable connection__ in i-th component definition). | +
-| get(get(get(1)[i])[12])[3+k*4] | int | Index of output from which is bus output connected (__internal variable connection__ in i-th component definition). | +
-| get(get(get(1)[i])[13]) | long[] | **BusInputEventToRefs** of i-th component definition . | +
-| get(get(get(get(1)[i])[13])[m])[0+n*4] | int | Bus index of event. | +
-| get(get(get(get(1)[i])[13])[m])[1+n*4] | int | Indexes of child to which is bus input event connected (__internal event connection__ in i-th component definition). | +
-| get(get(get(get(1)[i])[13])[m])[2+n*4] | int | Indexes of bus(or -1) to which is bus input event connected (__internal event connection__ in i-th component definition). | +
-| get(get(get(get(1)[i])[13])[m])[3+n*4] | int | Indexes of input event to which is bus input event connected (__internal event connection__ in i-th component definition). | +
-| get(get(get(1)[i])[14+j*6]) | string | **LocalName** of j-th child in i-th component definition . | +
-| get(get(1)[i])[15+j*6] | long | **CompDefID** component definition identificator of j-th child in i-th component definition . | +
-| get(get(get(1)[i])[16+j*6]) | int[] | **InputFromToRef** of j-th child input variables connections in i-th component definition. | +
-| get(get(get(1)[i])[16+j*6])[0+k*3] | int | Index of sibling (resp. -1 for parent) from which is k-th input connected (__variable connection__ of j-th child in i-th component definition. | +
-| get(get(get(1)[i])[16+j*6])[1+k*3] | int | Index of bus (or -1) from which is k-th input connected (__variable connection__ of j-th child in i-th component definition. | +
-| get(get(get(1)[i])[16+j*6])[2+k*3] | int | Index of output (resp. parent'​s input) variable from which is k-th input connected (__variable connection__ of j-th child in i-th component definition. | +
-| get(get(get(1)[i])[17+j*6]) | int[] | **SharedEqualRef** as parent shared variable indexes for each local shared variable of j-th child in i-th component definition. ​ | +
-| get(get(get(1)[i])[17+j*6])[0+2*s] | int | Parent bus (or -1) of shared variable for s-th local shared variable of j-th child in i-th component definition. ​ | +
-| get(get(get(1)[i])[17+j*6])[1+2*s] | int | Parent shared variable index(resp. -1 if not sharing above) for s-th local shared variable of j-th child in i-th component definition. ​ | +
-| get(get(get(1)[i])[18+j*6]) | long[] | **OutputEventToRefs** as pointer array to identificators of j-th child output event connections in i-th component definition). ​ | +
-| get(get(get(get(1)[i])[18+j*6])[m])[0+n*3] | int | Indexes of siblings (res. -1 for parent) to which is m-th input event connected (__event connection__ of j-th child in i-th component definition). | +
-| get(get(get(get(1)[i])[18+j*6])[m])[1+n*3] | int | Indexes of buses (or -1) to which is m-th input event connected (__event connection__ of j-th child in i-th component definition). | +
-| get(get(get(get(1)[i])[18+j*6])[m])[2+n*3] | int | Indexes of input event (resp. output event indexes for parent) to which is m-th output event connected (__event connection__ of j-th child in i-th component definition). | +
-| get(get(get(1)[i])[19+j*6]) | int[] | **BusEqualRef** as pointer array to bus indexes for each bus of j-th child in i-th component definition. ​ | +
-| get(get(get(get(1)[i])[19+j*6])[m])[0+b*2] | int | Indexes of siblings (res. -1 for parent) to which is b-th bus connected (__bus connection__ of j-th child in i-th component definition). | +
-| get(get(get(get(1)[i])[19+j*6])[m])[1+b*2] | int | Indexes of buses to which is b-th bus connected (__bus connection__ of j-th child in i-th component definition). | +
- +
- +
- +
-Dátové typy +
- +
-^ type ^ description ^   +
-| double | 64 bitové číslo s desatinnou čiarkou v little endian | +
-| long | 64 bitové celé číslo v little endian | +
-| int | 32 bitové celé číslo v little endian | +
-| string | pole 8 bitových znakov v UTF-8 zakončené nulou | +
-| long[] | pole typu long | +
-| string[] | pole typu string | +
-| int[] | pole typu int | +
-| double[] | pole typu double | +
-| byte[] | pole bajtov ako univerzálny typ | +
- +
-Prvým komponentom sú vždy ovládače prostredí, ktoré umožnia definovanie ďalších komponent, spúšťanie ich inštancií. Spustenie celého komponentového stromu je plne v rukách ovládača, ktorého inštancia je pridelená ku koreňu daného definičného stromu. To umožňuje robiť ovládačom optimalizácie nad celým stromom. Ovládače sa samozrejme môžu spúšťať navzájom, na čo treba brať zreteľ pri vytváraní rekurzívnych komponent. +
- +
-Komponentové stromy, ktorých všetky komponenty sú v zaregistrovaných prostrediach,​ je možné spúšťať jednotným príkazom (poslanie udalosti START danému ovládaču),​ ktorý vyžaduje na vstup identifikátor definície komponenty (defID) a na výstup poskytuje číslo inštancie komponentu (instanceID). ​+
simkernel_systemvariables.txt · Poslední úprava: 2012/01/18 10:34 autor: marek