Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

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

(Created page with "== Milestones == ;Evaluating the existing Tool (In Progress) :Testing the functionality of the Lua Code Generator with custom built Function Blocks (FBs) :* Using all languag...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Milestones ==
 
== Milestones ==
  
;Evaluating the existing Tool (In Progress)
+
;Evaluating the existing Tool
 
:Testing the functionality of the Lua Code Generator with custom built Function Blocks (FBs)
 
:Testing the functionality of the Lua Code Generator with custom built Function Blocks (FBs)
 
:* Using all language specific constructs from Structured Text - ST:
 
:* Using all language specific constructs from Structured Text - ST:
:** IF/ SWITCH CASE
+
:** IF/ SWITCH CASE working
:** FOR/ WHILE/ DO WHILE
+
:** FOR ''working'' // WHILE/ DO WHILE ''not working''
:** Function Calls
+
:** Function Calls ''not working''
:** Variable Declaration
+
:** Variable Declaration ''working''
 
:* Creating different Execution Control Charts (ECC):
 
:* Creating different Execution Control Charts (ECC):
:** All combinations of algorithms and events
+
:** All combinations of algorithms and events ''working''
:** Corner Cases
+
:** 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
+
:* 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.
+
:* 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.  
 
: 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.  
  
;Starting to fix the the identified bugs and implement additional functionality (To Be Done)
+
Testing Results:
: Will Be updated as we progress
+
: 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
 +
[https://docs.google.com/spreadsheets/d/12IVIfe8WYDiQJNWz7THVTNwRJWDSYDlt0IJrPDY-9_8/edit?usp=sharing 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 [https://bugs.eclipse.org/bugs/showdependencytree.cgi?id=548766&hide_resolved=1 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 [https://docs.google.com/spreadsheets/d/12IVIfe8WYDiQJNWz7THVTNwRJWDSYDlt0IJrPDY-9_8/edit?usp=sharing 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
 +
 
 +
:* Added Test Function Blocks for Adapters and Functions [https://git.eclipse.org/r/#/c/144017/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=547887 Bugzilla Bug]
 +
:* Added Test Function Blocks for ECCs [https://git.eclipse.org/r/#/c/144018/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=547912 Bugzilla bug]
 +
:* Added Test Function Blocks for simple Functionality e.g. Mathematical Operations [https://git.eclipse.org/r/#/c/144019/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=547886 Bugzilla bug]
 +
:* Added a documentation on how to compile and use the Lua Code generator in Eclipse 4diac [https://git.eclipse.org/r/#/c/144372/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=548396 Bugzilla bug]
 +
:* Added additional Test Function Blocks for Adapter Transitions [https://git.eclipse.org/r/#/c/144607/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=547887 Bugzilla bug]
 +
:* Fixed a Parameter issue in the 4diac FORTE [https://git.eclipse.org/r/#/c/145122/ gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=548764 Bugzilla bug]
 +
:* Reworked deploying mechanism of the generated Lua Code [https://git.eclipse.org/r/#/c/144911/ 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]
 +
:* 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 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 wrong names of Adapter Variables [https://git.eclipse.org/r/#/c/147879/ Gerrit commit] [https://bugs.eclipse.org/bugs/show_bug.cgi?id=548985 Bugzilla bug]
 +
 
 +
;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) [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]: 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=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 08: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