Skip to main content
Jump to: navigation, search

Difference between revisions of "Eclipse 4diacWiki/Development/Dynamic Type Loader"

 
(One intermediate revision by the same user not shown)
Line 28: Line 28:
 
: In this section, will give a brief overview on the current state we are now in, a reference to all the code i wrote and what bugs we did not manage to finish.
 
: In this section, will give a brief overview on the current state we are now in, a reference to all the code i wrote and what bugs we did not manage to finish.
  
: As of the end of the GSoC, i created a whole set of new function blocks, for testing most of the functionality Eclipse 4diac provides. Furthermore there is now a documentation, on how to get the Lua JIT into the 4diac FORTE and to use the Dynamic Type Loader.  
+
: As of the end of the GSoC, i created a whole set of new function blocks, for testing most of the functionality Eclipse 4diac provides. Overall 35 new function blocks have been created, trying to cover most of the test cases and corner cases.
: I reworked the deploying mechanism of function block types and adapter types and fixed many bugs, that stopped e.g. adapters from working. A more detailed explanation is in the roadmap below, where all gerrit commits and bugs are linked.
+
: There is now a documentation, on how to get the Lua JIT into the 4diac FORTE and to use the Dynamic Type Loader.
 +
: Now working is the deploying mechanism, function block types and adapter types are genreated correctly and the 4diac FORTE responds with proper answers.
 +
: All arithmetic operations are working (e.g. multiplication, division).
 +
: All until now verfied issues with adapter are resolved and should be working correctly.
  
 
;Code  
 
;Code  
Line 42: Line 45:
 
:* Reworked querying of Adapter Types [https://git.eclipse.org/r/#/c/145299/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=547888 Bugzilla bug]
 
:* Reworked querying of Adapter Types [https://git.eclipse.org/r/#/c/145299/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=547888 Bugzilla bug]
 
:* Escaping Xml Characters in the Lua Code [https://git.eclipse.org/r/#/c/145856/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=549096 Bugzilla bug]
 
:* Escaping Xml Characters in the Lua Code [https://git.eclipse.org/r/#/c/145856/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=549096 Bugzilla bug]
:* Added addititonal FUnction Blocks for testing Adapters [https://git.eclipse.org/r/#/c/146325/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=547887 Bugzilla bug]
+
:* Added addititonal Function Blocks for testing Adapters [https://git.eclipse.org/r/#/c/146325/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=547887 Bugzilla bug]
 
:* Fixed generated Lua code, for Adapter Variables [https://git.eclipse.org/r/#/c/146914/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=549553 Bugzilla bug]
 
:* Fixed generated Lua code, for Adapter Variables [https://git.eclipse.org/r/#/c/146914/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=549553 Bugzilla bug]
 
:* Fixed calculation of IDs for the Adapter Variables [https://git.eclipse.org/r/#/c/147645/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=549837 Bugzilla bug]
 
:* Fixed calculation of IDs for the Adapter Variables [https://git.eclipse.org/r/#/c/147645/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=549837 Bugzilla bug]
Line 48: Line 51:
  
 
;Still Open
 
;Still Open
: Unfortunately i could not finish all of the open bugs, as many of them where much more complicated than expected. I will list all of the bugs here tht are still open and need treatment.
+
: Unfortunately i could not finish all of the open bugs, as many of them where much more complicated than expected. I will list all of the bugs here tht are still open and need treatment. Although they are open, i had some some ideas in mind on how to fix them.
:* Structured Text Functions (e.g. SQRT, LOG) [https://bugs.eclipse.org/bugs/show_bug.cgi?id=548771 Bugzilla bug]
+
:* Structured Text Functions (e.g. SQRT, LOG) [https://bugs.eclipse.org/bugs/show_bug.cgi?id=548771 Bugzilla bug]: It is possible to call C-Code from Lua. Therefore we do not neet to implement all functions from the Structured-Text library in Lua, we should be able to call them through the Lua-C API.
:* Duartion Literals [https://bugs.eclipse.org/bugs/show_bug.cgi?id=510956 Bugzilla bug]
+
:* Duartion Literals [https://bugs.eclipse.org/bugs/show_bug.cgi?id=510956 Bugzilla bug]: Duration literals are a bit tricky, as the format, on how they are written varies between Eclipse 4diac, Lua and C. It has to be decide, on how to handle these literals in Lua and how they are then converted into the right format in C.
:* Bitwise/Logical Operators are not working [https://bugs.eclipse.org/bugs/show_bug.cgi?id=548770 Bugzilla bug]
+
:* Bitwise/Logical Operators are not working [https://bugs.eclipse.org/bugs/show_bug.cgi?id=550531 Bugzilla bug]: To differentiate between bitwise and logical operators in Lua, we have to evaluate the expression written in structured text. This means if the result from this expression is either a bit result (e.g. <, >=) or a byte/int etc. result (e.g. 0110 & 1100, which yields 0100). My idea is to evaluate expressions like (5 < 7) & ((9 | 1) > (3*2)) recursively, to find out if the LHS and RHS yield boolean result. If they do, we know the & is a logical operator, otherwise it is a bitwise operator.

Latest revision as of 07:05, 28 August 2019

Milestones

Evaluating the existing Tool
Testing the functionality of the Lua Code Generator with custom built Function Blocks (FBs)
  • Using all language specific constructs from Structured Text - ST:
    • IF/ SWITCH CASE working
    • FOR working // WHILE/ DO WHILE not working
    • Function Calls not working
    • Variable Declaration working
  • Creating different Execution Control Charts (ECC):
    • All combinations of algorithms and events working
    • Corner Cases working (at least for all my corner cases)
  • Testing if events from adapters can be used, when deploying in Lua. Furthermore defining the adapters themselfs in Lua not working
  • Testing the new simple FB: a FB with one algorithm, one input event and one output event. not working
In general, the FBs will no be applicable in the real world. The are on purpose kept very synthetically to encapsulate certain functionality and test it.

Testing Results:

I added a summary to the description above.

A detailed description on the errormessages and what works, does not work is found in the sheet Errorsheet.

Identifying errors
We have now identified where bugs occure and what functionality is working and which not. The next Step will be to figure out, why and where this errors occure e.g. if it is the fault from the Lua code generator, because it can not generate code for a certain FB or if parsing errors happen while downloading the code to the 4diac FORTE.
For this i have created a road map of bugs in Bugzilla. After this is done, i am going to start to fix this bugs.
I will also keep track of the errors and their causes in my Errorsheet.
Final Report
In this section, will give a brief overview on the current state we are now in, a reference to all the code i wrote and what bugs we did not manage to finish.
As of the end of the GSoC, i created a whole set of new function blocks, for testing most of the functionality Eclipse 4diac provides. Overall 35 new function blocks have been created, trying to cover most of the test cases and corner cases.
There is now a documentation, on how to get the Lua JIT into the 4diac FORTE and to use the Dynamic Type Loader.
Now working is the deploying mechanism, function block types and adapter types are genreated correctly and the 4diac FORTE responds with proper answers.
All arithmetic operations are working (e.g. multiplication, division).
All until now verfied issues with adapter are resolved and should be working correctly.
Code
Still Open
Unfortunately i could not finish all of the open bugs, as many of them where much more complicated than expected. I will list all of the bugs here tht are still open and need treatment. Although they are open, i had some some ideas in mind on how to fix them.
  • Structured Text Functions (e.g. SQRT, LOG) Bugzilla bug: It is possible to call C-Code from Lua. Therefore we do not neet to implement all functions from the Structured-Text library in Lua, we should be able to call them through the Lua-C API.
  • Duartion Literals Bugzilla bug: Duration literals are a bit tricky, as the format, on how they are written varies between Eclipse 4diac, Lua and C. It has to be decide, on how to handle these literals in Lua and how they are then converted into the right format in C.
  • Bitwise/Logical Operators are not working Bugzilla bug: To differentiate between bitwise and logical operators in Lua, we have to evaluate the expression written in structured text. This means if the result from this expression is either a bit result (e.g. <, >=) or a byte/int etc. result (e.g. 0110 & 1100, which yields 0100). My idea is to evaluate expressions like (5 < 7) & ((9 | 1) > (3*2)) recursively, to find out if the LHS and RHS yield boolean result. If they do, we know the & is a logical operator, otherwise it is a bitwise operator.

Back to the top