Uživatelské nástroje

Nástroje pro tento web


simkernel_systemvariables

Toto je starší verze dokumentu!


Formát dát na definovanie Simulátoru (SimComponent)

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.

  1. EnvironmentInstID=-1 : ovládač prostredia (spúšťa sa samostatne).
  2. EnvironmentInstID>=0 : komponenta v danom prostredí (môže sa spúšťať automaticky cez ovládač daného prostredia).

PlantUML Graph

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.1326365372.txt.gz · Poslední úprava: 2012/01/12 11:49 autor: marek