View Issue Details
764 [Taste] TASTE-IV/DV major always 2018-04-25 07:41 2021-12-02 10:11
shd01  
maxime  
high  
assigned  
open  
none    
none  
   
Can't reuse functions due to namespace conflicts
I created a container function, with some functions inside, to use as a generic block for a redundant subsystem. When I import this block into a project for the second time, TASTE renames all the contained functions to default names (e.g. Function6). This is tedious as I have to rename all the functions by hand to something unique, and then create new behavioural code. I can't have a single source for the implementation. What I would really like is a clean facility to be able to reuse or duplicate modules, perhaps by creating libraries. For the time being, I could get by with a hierarchical namespace, i.e. where names are only required to be unique within a function. I've made this a major severity report as I think it is an impediment to serious use of TASTE in systems modelling.
Notes
(0003290)
shd01   
2018-05-02 09:32   
This could be a problem with my understanding. Is it possible to create generic functions that are also containers? Actually, I am having some trouble creating even a basic generic function (like the ones in Demo_Multi_Instances). What is the correct way to do this?
(0003291)
maxime   
2018-05-02 11:31   
At the moment, the notion of generic functions is still provided as a proof-of-concept prototype. We are addressing it in the current set of updates for TASTE and we will update it step by step based on the needs. It is so far restricted to individual functions in SDL. One function can be defined as a type, and other as instances of this type. No further refinements on the instance can be made, i.e. we have no inheritance mechanism yet. The next version of the GUI will ease the creation of types and the instantiation process, as well as the storage in an external library of components (available on the left side, like the PeekPoke component). Here are a few of the ideas in the roadmad, in order of complexity: 1) Extend to pure Ada and to C++ 2) Use context parameters to specify context-dependent constants (set as placeholder in the type with a default value, and actual value in the instances) 3) Use context parameters as they are defined in the SDL standard (i.e. a full template engine / close to Ada generics) 4) Support inheritance / allow overriding the code of PI (ie. OO model from SDL) and 5) what you introduce: SDL Block/System Type - (Nesting function that is a type and that can be instantiated). This will be a bit more complicated, but we'll eventually get there.
(0003809)
maxime   
2021-12-02 10:11   
1 and 2 have been implemented





View Issue Details
669 [Taste] ASN.1 Compiler v4 feature have not tried 2017-08-31 09:37 2018-07-10 12:09
maxime  
gmamais  
normal  
assigned  
open  
none    
none  
   
Improvements of asn1scc (WUT)
In order to iterate on this - and define priorities, I summarize here the list of issues reported by WUT: 1. Missing/Incomplete documentation (we have no real end-user documentation of the compiler (apart from the ACN part).) 2. Management of errors : * [*DONE*] Lack of automatic constraints check in Decode functions (Add call to isConstraintValid after decoding) * Usage of assert in asn1scc generated functions * [*DONE*] Returning of unnamed / undefined error codes 3. Misleading initialisation of a kind attribute for ASN.1 CHOICE construction (Some confusion with the NONE choice) 4. Bitstream structure issues (arious issues, such as the meaning of the "count" field which is different for encoding and decoding) 5. Not sufficient model consistency checks 6. Ambiguity in the definition of the required buffer sizes for encoding ("+1 for zero-sized type" is not documented) 7. Quality of the asn1scc-generated test suite
There are no notes attached to this issue.





View Issue Details
411 [Taste] ASN.1 Compiler feature N/A 2015-01-26 09:31 2018-07-05 08:35
ttsiodras  
gmamais  
normal  
feedback  
reopened  
none    
none  
   
Improve rename policy for enumerants
Improve the so-called “rename policy” for enumerants of CHOICE / ENUMERATED types – thus providing consistency between C/Ada.
Notes
(0002387)
gmamais   
2015-07-13 13:26   
(edited on: 2016-04-15 07:54)
I am not sure what is required here. Let me summarize the current situation. Suppose an ASN.1 grammar with one Enumerated type RGBCOLORS ::= ENUMERATED { red, green, blue } The generated C and Ada types are typedef enum { red = 0, green = 1, blue = 2 } RGBCOLORS; SUBTYPE RGBCOLORS_index_range is integer range 0..2; TYPE RGBCOLORS IS (red, green, blue); for RGBCOLORS use (red => 0, green => 1, blue => 2); for RGBCOLORS'Size use 32; The names (as well as the values) of the enumerants are the same. Suppose an ASN.1 grammar with two Enumerated types with one common enumerant e.g. RGBCOLORS ::= ENUMERATED { red, green, blue } OTHERCOLORS ::= ENUMERATED { red, cyan, magenta } The generated C and Ada types are typedef enum { RGBCOLORS_red = 0, green = 1, blue = 2 } RGBCOLORS; typedef enum { OTHERCOLORS_red = 0, cyan = 1, magenta = 2 } OTHERCOLORS; SUBTYPE RGBCOLORS_index_range is integer range 0..2; TYPE RGBCOLORS IS (RGBCOLORS_red, green, blue); for RGBCOLORS use (RGBCOLORS_red => 0, green => 1, blue => 2); for RGBCOLORS'Size use 32; SUBTYPE OTHERCOLORS_index_range is integer range 0..2; TYPE OTHERCOLORS IS (OTHERCOLORS_red, cyan, magenta); for OTHERCOLORS use (OTHERCOLORS_red => 0, cyan => 1, magenta => 2); for OTHERCOLORS'Size use 32; Again the names match in C and Ada. Please note that the common enumerated item (red) has been renamed to red otherwise there would be a name class. Choices follow the same principle as enums. So, what should we change?
(0002388)
maxime   
2015-07-13 13:34   
The "rename policy" was discussed over mail a couple of years ago. Here is the thread: RE: [taste-dev] r6613 - trunk/DMT/asn1scc.3 George Mamais to: 'Maxime Perrotin' 10/06/2013 12:04 Cc: ttsiodras Hide Details From: "George Mamais" <gmamais@semantix.gr> To: "'Maxime Perrotin'" <Maxime.Perrotin@esa.int> Cc: <ttsiodras@semantix.gr> History: This message has been replied to. Yes you are right. I will add also the no rename policy From: Maxime Perrotin [mailto:Maxime.Perrotin@esa.int] Sent: Monday, June 10, 2013 12:53 PM To: George Mamais Cc: ttsiodras@semantix.gr Subject: Re: [taste-dev] r6613 - trunk/DMT/asn1scc.3 I would suggest a third policy, for Ada, without any prefix, since they are not required by the language (policy A or B are only needed because of SPARK, if I understood correctly, but they add unnecessary noise to the code). No? On Mon, 10 Jun 2013 11:45:36 +0200, George Mamais <gmamais@semantix.gr> wrote: Hi Maxime, This is to let you know, that in the next release of the ASN.1 compiler, I plan to change this behavior. In particular the user will be able to set rename policy: Policy A (existing one, i.e. Mychoice_a_PRESENT, b_PRESENT, etc) Policy B (existing one, i.e. Mychoice_a_PRESENT, Mychoice_b_PRESENT, etc) The default policy for C will be Policy A (in order to avoid breaking existing code), while the default policy for Ada (where the existing user code is much less) will be Policy B. Please tell me if you are OK with this. Kind regards, George From: George Mamais [mailto:gmamais@semantix.gr] Sent: Thursday, June 06, 2013 5:55 PM To: 'Maxime Perrotin' Cc: 'ttsiodras@semantix.gr' Subject: RE: [taste-dev] r6613 - trunk/DMT/asn1scc.3 You are right it would be better to have the behavior you describe. However, that behavior was adopted in the previous version ASN.1 compiler and the new compiler copied that behavior (otherwise user code would break). Kind regards, George From: Maxime Perrotin [mailto:Maxime.Perrotin@esa.int] Sent: Thursday, June 06, 2013 4:22 PM To: George Mamais Cc: ttsiodras@semantix.gr Subject: Re: [taste-dev] r6613 - trunk/DMT/asn1scc.3 But then it would be better to have a consistent naming. All enumerant should be built with the same rules to make the code using a particular type portable. In the example below, having Mychoice_a_PRESENT next to b_PRESENT is confusing, and makes it impossible to reuse the same type and code if the type is copied in a different ASN.1 grammar (since the naming is computed based on the neighbouring types). On Thu, 06 Jun 2013 15:20:03 +0200, George Mamais <gmamais@semantix.gr> wrote: Hi Maxime, Indeed, in Ada is not need. However, Spark has problem with this (it is an error), so I decided to handled it like in C. Piotr grammar has enums with the same enumerant names, so this how I discovered this issue. Kind regards, George From: Maxime Perrotin [mailto:Maxime.Perrotin@esa.int] Sent: Thursday, June 06, 2013 3:47 PM To: George Mamais Cc: ttsiodras@semantix.gr Subject: Fwd: [taste-dev] r6613 - trunk/DMT/asn1scc.3 Hi George, From the log of the new version of the compiler, I noticed this (from Thanassis): * emum names are not required to be unique I do not understand - this creates a regression in some code because the naming of the choice determinant (in Ada) is now prefixed with the type name in some cases, like in C : TYPE asn1SccMyChoice_selection IS (MyChoice_a_PRESENT, b_PRESENT); Is there a reason for that ? In Ada, this should not be needed, contrary to C (and until now it was working well without it). Thanks Maxime
(0002389)
gmamais   
2015-07-14 08:59   
fixed in version 3.2.55 A new command line argument -renamePolicy was added. -renamePolicy 0 => no rename, (Ada default) -renamePolicy 1 => rename only conflicting enumerants (C default). -renamePolicy 2 => rename all enumerants of an enum with at lest one conflicting enumerant.
(0002392)
maxime   
2015-07-14 14:33   
Thanks, closing
(0002404)
maxime   
2015-08-07 08:03   
There is still a rename policy issue: ``` TASTE-Dataview DEFINITIONS ::= BEGIN MyEnum ::= ENUMERATED { hello (0), world } hello INTEGER ::= 0 END ``` $ asn1.exe -c -atc -uPER dataview.asn $ make -> will complain about the redefinition of "hello"
(0002435)
gmamais   
2015-09-18 08:56   
Yes you are right. How should we handle this case? (a) emit error (b) rename enum (c) rename integer value assignment I would go for (b) using the enum rename policy provided by user (or the default one if not provided).
(0002437)
maxime   
2015-09-18 08:58   
Agreed to go for (b)
(0002439)
gmamais   
2015-09-18 10:00   
fixed in version 3.2.66
(0002445)
maxime   
2015-09-21 07:16   
Thanks! Closing
(0003192)
maxime   
2018-01-18 14:10   
Re-opening.. We miss the rename policy applied to named INTEGERs : A ::= INTEGER { hello (1) } (0..100) B ::= INTEGER { hello (2) } (0..100) this causes an error of the compiler (duplicate definition of hello) shouldn't the rename policy name the constants TYPE_constant ? (Here : A_hello and B_hello)
(0003359)
gmamais   
2018-06-12 18:01   
This will not be an easy fix because I am not really sure what I have to do. I read the book of Mr. Dubuisson about named INTEGERs. Here the relevant text: "ASN.1, therefore, provides a specific syntax for the INTEGER type: the list of integers, where every one of them is preceded by its identifier (which begins with a lower-case letter); this list is denoted in curly brackets after the keyword INTEGER. The error code of a floppy can then be modeled with the type: ErrorCode ::= INTEGER { disk-full(1), no-disk(-1), disk-not-formatted(2) } stupid-error ErrorCode ::= disk-full these identifiers have only a local scope, i.e. they can only be used to define values of type ErrorCode like stupid-error for example. The same number can obviously not be named by two different identifiers and a given identifier cannot name two different numbers. The named integers are not necessarily ordered or consecutive and the list of integers in curly brackets is not restrictive " The key word is that these identifiers have only a *local scope*. Unfortunately, the current implementation of ASN1SCC does not handle named INTEGERs as local scope values but as global value assignments. I.e. it transforms them into value assignments as follows: hello INTEGER ::= 1 hello INTEGER ::= 2 (which of course, in this case, does not make any sense and the compiler emits the error) In our ASN.1 compiler, it is even possible to do the following B ::= INTEGER { hello (20) } (0..100) C ::= SEQUENCE (SIZE (0..hello)) OF INTEGER So, the problem is not the lack of renaming (as we do in enums) but the fact that named INTEGERs are handled like global value assignments. Now, if we implement the ASN.1 standard as described in Mr. Dubuisson's book then the only actual use of named Integers is to define other value assignments such as stupid-error ErrorCode ::= disk-full (this is an example of Mr Dubuisson, not mine) which is very limited. In this case, named INTEGERs values will not appear in the generated code as constants (only the stupid-error will appear) and hence there is no need for any renaming. Which means that if the protocol designer of the PUS had in mind another usage for hello, then this will not appear in the generated code. What I am trying to say is that perhaps this is not a high priority issue and can be easily handled if we change the grammar. Please tell me your thoughts on this issue.
(0003360)
maxime   
2018-06-12 20:21   
(edited on: 2018-06-12 20:23)
A think a local scope means that if you have two different types you cannot assign a value of the first type to a variable of the other type. so indeed if you declare: A ::= INTEGER { hello(1) } (0..255) B ::= INTEGER (0..255) In the code it should be forbidden to have a variable of type B and assign value `hello` to it. Of course I know that C does not respect this basics of data typing... With Ada, this is enforced, if you have something like type A is new integer range 0..255; type B is new integer range 0..255; A_hello : constant A := 1; var : B := A_hello; -- Compilation error With that in mind, it does make sense to have a systematic renaming (TypeName_ConstantName, as in A_hello) Without renaming, the original case: A ::= INTEGER { hello (1) } (0..100) B ::= INTEGER { hello (2) } (0..100) which is valid ASN.1, had to chance to exist in C, since it is forbidden to declare two constants of the same name with different values. A trick in Ada would make it possible using polymorphism: type A is new integer range 0..100; type B is new integer range 0..100; function hello return A is (1); function hello return B is (2); c : B := hello; -- will assign 2 d : A := hello; -- will assign 1 This is nice (including syntactic sugar - no parenthesis), and the compiler would probably optimize things out to have no overhead (function call) at runtime but since this is not possible in C, let's not go there :-( Back to our problem: If you translate into: hello INTEGER ::= 1 hello INTEGER ::= 2 instead of hello A ::= 1 hello B ::= 2 then indeed there is no chance that it works as local scope values Does a translation to A-hello A ::= 1 B-hello B ::= 2 imply complex changes on your side? I think that would make it comply to the ASN.1 semantics that you explained from the book of Mr. Dubuisson Perhaps I am missing something. If you think it's the case, a short term solution is to reject grammars that have these kind of conflicting named integers constants with an error message (rather than at compile time).
(0003361)
gmamais   
2018-06-13 05:55   
(edited on: 2018-06-13 06:44)
But suppose someone defines the following A ::= INTEGER { hello (1) } (0..100) B ::= INTEGER { hello (2) } (0..100) C ::= SEQUENCE (SIZE(1..hello)) OF INTEGER then what is the size of C 1 or 2?
(0003362)
maxime   
2018-06-13 06:44   
I think this construct is illegal in `ASN.1` The right way would be to declare a standalone constant for this one max-size INTEGER ::= 5 C ::= SEQUENCE (SIZE (1..max-size)) OF INTEGER And in the generated code, you replace max-size with the actual value (this is what you do already).
(0003363)
gmamais   
2018-06-13 07:14   
So, what is the usage of named integers such as hello within the ASN.1? In my understanding named integers can only be used to define other value assignments such as other-hello A ::= hello which is as I said before is very limited. Anyway, to recap I propose to do the following changes: 1) Named integers will no more be translated to value assignments 2) Named integers will be mapped to integer named items that will have only local scope (same as Enumerated). These named items can be used only in the scope of the specific INTEGER type (i.e. to define value assignments of this type or to define constraints of this type). This is a big change since it requires changes in the definition of the INTEGER AST and then to all places that INTEGER is accessed 3) Named integers will be mapped to the target language as constants (same thing as now) 4) If there are conflicts within named integers, then these will be resolved like enumerated. Please tell me if you agree with this approach.
(0003364)
maxime   
2018-06-13 07:32   
(edited on: 2018-06-13 07:33)
I don't really understand point 2. I do not think you need to do anything different from enumerated values. If you have: A ::= INTEGER { hello (-1), world (10) } (-10..100) The only thing you need to do is create two AST entries with value assignments: a-hello A ::= -1 a-world A ::= 10 And if you had some places in the model with: myVal A ::= hello you need to replace `hello` with value `-1`, after checking it's either part of `A` or defined as a constant. And *if there is a conflict*, i.e. is is both a named value of A _and_ a module-level constant then favour local scope, i.e. take the named value of A, and raise a warning (`hello is defined twice, using the type's named value`) Regarding point 4, I think it's better to apply the prefix with the type name systematically, for consistency (i.e. _always_ Typename_constant) However, if the user has defined a constant named a-hello already, then there is no other option than raising an error.
(0003365)
gmamais   
2018-06-13 08:46   
(edited on: 2018-06-13 10:44)
I have to do what I do for enumerated types. Let me give an example: RGB ::= ENUMERATED {red, green, blue} blueValue RGB ::= blue MySeq ::= SEQUENCE{ a RGB (red | blueValue) } when the compiler process the constraint (`red|blueValue`) it has to decide whether each reference is enumerated value defined in the scope of this type (red) or a value assignment (`blueValue`). On the other hand, when processing Integer values (in the scope of constraints or value assignments) the compiler checks only for value assignments. This has to change and make INTEGER type to behave more or less as enumerated. This check is made at various places (constraints, DEFAULT values, value assignments, composite values etc). The current (frontend) AST has to change Asn1TypeKind = | Integer | Enumerated of list to Asn1TypeKind = | Integer of list | Enumerated of list I hope I made my point more clear. I am not saying that I am not willing to do this modification. I just want you to understand that this change has a bigger impact than just prefixing the names of named `INTEGER` with the type name.
(0003370)
maxime   
2018-06-13 14:18   
Ok, thanks for the explanations. Keep it low priority if it implies too many changes.





View Issue Details
699 [Taste] General minor have not tried 2017-10-26 14:09 2018-01-23 15:41
miguel_munoz All  
maxime  
normal  
assigned  
open  
none    
none  
   
Native encoding not checked between nodes of different architecture
The editors and code generation allow that an interface with parameters set to native encoding is deployed between nodes that have a different architecture (e.g. x86 and leon). The information contained in the models should be sufficient to detect this condition, and report an error. Otherwise, at runtime, this will produce garbage data or possibly a crash.
Notes
(0003063)
ttsiodras   
2017-10-26 14:50   
Indeed, this should be handled. Maxime, can the check be done in buildsupport?
(0003206)
maxime   
2018-01-23 15:41   
I propose an alternative : we should rename "Native" to "Automatic" and let the tools make sure the encoding ensures consistent data. On local nodes, Native will be chosen, and whenever there is distribution across networks, uPER would be chosen.





View Issue Details
82 [Taste] PolyORB-HI-All feature N/A 2011-01-12 10:45 2011-02-07 19:32
maxime  
 
normal  
new  
open  
none    
none  
   
Add runtime configuration for communication drivers
Add a mean to configure network configuration from the user code. For example, the IP address and port number could be determined dynamically rather than being fixed in the AADL code. Expected benefit: allow users to build native client-server applications with minimal effort Specifying the possibility for a driver to be reconfigured at runtime should be a feature of the ASN.1 model of the driver configuration. Eg. Available-devices ::= ENUMERATED { eth0, eth1 } Ethernet ::= SEQUENCE { default-device Available-devices, port INTEGER (0..65535), ip IA5String (SIZE (3..11)), reconfigurable BOOLEAN } Then when the user sets the Ethernet values in the Deployment view he would write: { default-device eth0, port 80, ip "192.168.1.1", reconfigurable true } In addition to Send and Receive, the driver should in turn contain some form of reconfiguration API, of course.
Notes
(0000229)
hugues   
2011-01-12 11:13   
Reconfiguration is a complex best: if you change parameters for node B, then all nodes connected to B shall be aware of that, and be also reconfigured. This is costly to support and requires application-wide consensus. Hence, I'm not favorable to support dynamic reconfiguration: we should clearly specify what we can support at a decent cost. I agree it would be nice to set configuration parameters when starting the application, but once it is started, we should not allow for it, except in error handlers for instance: if connection to B crash with one connection, give the possibility to use another channel, but even in this case, stability of the system is complex to preserve
(0000294)
user2   
2011-02-07 16:56   
I think we can close this issue since the driver configuration using ASN.1 would be the reference configuration directive.
(0000295)
maxime   
2011-02-07 19:32   
We should keep the discussion open. The points from Jerome have to be investigated. Reconfiguration at runtime is something we will need because this is something which happens in embedded systems: we loose a communication line, we switch to another. At the moment we have no possibility to define protocols for the establishment of communication between two nodes, so as soon as one dies, the others die too and the system becomes unrecoverable. It is likely that we will use the new ASN.1 configuration mechanism to specify some additional properties for a given interface, but that does not solve everything - not the protocol specification.