SCL defines a set of primitive data types like any other strongly typed language. These represent the basic data containers that can be used to store data. The data is stored in a variable. The variable is just an instance of a given type. The type defines the semantics (the meaning) behind the data stored in a variable. It also dictates the operations that can be applied on a variable.
So by declaring a variable you just allocate some storage. But where is the data actually stored? In the case of SCL in Process Simulate the data is stored in a symbol table associated with the script. Each script has exactly one symbol table defining the scope of the variables. So the variable is visible only in the executing script. Temporary variables are inserted in the symbol table before executing the script and removed after executing the script. All the others are inserted before executing the script and are kept alive until the script is needed. This allows for querying their values before/after the script runs. This is how inputs and outputs are handled.
So which are the primitive types?
This short list will probably be the only thing you need when starting with SCL. When things go a little bit more complicated you'll also need arrays and structures but for now let's keep it simple.
Once you have the variables declared you may notice that not all SCL types have matching signal types in Process Simulate. Why? The user needs to connect signals to variables right? Well ... SCL is pretty new ... so we have to deal with all the legacy that we have. Signal types are a subset of the SCL types. Sorry.
Comments