Coder Social home page Coder Social logo

openaadl / ocarina Goto Github PK

View Code? Open in Web Editor NEW
62.0 62.0 30.0 26.83 MB

AADL model processor: mappings to code (C, Ada); Petri Nets; scheduling tools (MAST, Cheddar); WCET; REAL

Home Page: http://www.openaadl.org

License: Other

Shell 2.27% Papyrus 0.01% Ada 96.70% Makefile 0.33% Python 0.29% M4 0.21% Alloy 0.19% C 0.01%
aadl ada

ocarina's People

Contributors

bouazizrahma avatar hannamk avatar jjhugues avatar juli1 avatar maxime-esa avatar nvcyc avatar yoogx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ocarina's Issues

Syntax error on record []

I am running the latest Ocarina within the latest OSATE. The two now enforce a different syntax for property value records, Ocarina wanting () and OSATE []. The following is accepted by OSATE but not by Ocarina.

package PropValue
public

bus Ethernet_Cable
end Ethernet_Cable;

bus implementation Ethernet_Cable.ARINC_664
properties
    -- The following is legal AADL 2 and accepted by OSATE
    -- but not by Ocarina.  Ocarina only accepts () and OSATE
    -- only accepts [] for records.
    Transmission_Time => [Fixed => 3360 ns .. 3360 ns; PerByte => 80 ns .. 80 ns;];
end Ethernet_Cable.ARINC_664;

system Test
end Test;

system implementation Test.Imp
subcomponents
    aBus : bus Ethernet_Cable.ARINC_664;
end Test.Imp;

end PropValue;

clean target fails

When trying to issue a make clean, the makefile fails

ocarina-main.gpr:41:09: unit "ocarina.configuration" cannot belong to several projects
ocarina-main.gpr:41:09: project "ocarina.main", "/home/julien/wip/ocarina/src/main/ocarina-configuration.adb"
ocarina-main.gpr:41:09: project "ocarina.config", "/home/julien/wip/ocarina/src/config/ocarina-configuration.adb"
gnatclean: "ocarina-main.gpr" processing failed
Makefile:610: recipe for target 'ocarina-main.gpr-clean' failed
make[1]: *** [ocarina-main.gpr-clean] Error 4
make[1]: Leaving directory '/home/julien/wip/ocarina/projects'
Makefile:402: recipe for target 'clean-recursive' failed
make: *** [clean-recursive] Error 1

src/config/ocarina-configuration.adb shall not be deleted by clean target

Files generated by the configure script shall be deleted by distclean, not by clean.
The problem is coming from a dirty fix in projects/Makefile.am l.104-113:

[...]
# XXX creating/deleting ocarina-configuration.adb is to please
# gnatclean that requires this file to be present to delete files ...

$(CLEAN_STAMPS): %-clean:
    touch $(top_builddir)/src/config/ocarina-configuration.adb
    $(INIT_ADA_PROJECT_PATH) $(GNATCLEAN) -P $* $(GNATFLAGS) $(GNAT_LIB_FLAGS)\
      -XABS_SRC_DIR="$(PL_DEP_ABS_SRC_DIR)" \
      -XABS_BUILD_DIR="$(PL_DEP_ABS_BUILD_DIR)" \
      $(AP_FLAGS) ;
    rm $(top_builddir)/src/config/ocarina-configuration.adb
[...]

To fix it, it may be sufficient to remove the last line "rm $(top_builddir)/src/config/ocarina-configuration.adb". To be confirmed by a GNAT expert ;-)

generate wrong prototype for subprogram access in data

It seems that ocarina generate wrong prototype in some situation
I have a file das.aadl,but when I use ocarina -x scenario.aadl to build skeleton code,it seems it deduces wrong prototype

-- das.aadl
package das
public
    with deployment;
    with Data_Model;

    ---------------
    -- data      --
    ---------------
    data value_t
    properties
        Data_Model::Data_RePresentation=>Integer;
    end value_t;

    data sensor_data
    features
        get_value:provides subprogram access get_value;
        set_value:provides subprogram access set_value;
    end sensor_data;

    data implementation sensor_data.impl
    subcomponents
        data_value:data value_t;
        s_get_value:subprogram get_value;
        s_set_value:subprogram set_value;
    connections
        sa1:subprogram access s_get_value->get_value;
        sa2:subprogram access s_set_value->set_value;
    properties
            Data_Model::Data_Representation => Struct;
    end sensor_data.impl;

    ---------------
    -- subprogram--
    ---------------
    subprogram get_value
    features                
      data_out: out parameter value_t;
      this:requires data access sensor_data.impl;

    properties
        source_language => (C);
        source_name     => "get_value";
        source_text     => ("das.c");
    end get_value;

    subprogram set_value
    features
            this:requires data access sensor_data.impl;
    properties
        source_language => (C);
        source_name     => "set_value";
        source_text     => ("das.c");
    end set_value;

    subprogram process_value
    features
        data_in : in parameter value_t;
    properties
        source_language => (C);
        source_name     => "process_value";
        source_text     => ("das.c");
    end process_value;


    subprogram total
    features
        sensor_value : requires data access sensor_data.impl;
    end total;

    subprogram implementation total.impl
    calls
        call_seq:{
            set_value:subprogram sensor_data.set_value;
            get_value:subprogram sensor_data.get_value;
            process_value: subprogram process_value;
        };
    connections
        da1:data access sensor_value->set_value.this;
        da2:data access sensor_value->get_value.this;
        da3: parameter get_value.data_out -> process_value.data_in;
    end total.impl;

    ---------------
    -- thread    --
    ---------------
    thread das_user
    features
        sensor_value:requires data access sensor_data.impl;
    end das_user;

    thread implementation das_user.impl
    calls
    call_seq:{
        total:subprogram total.impl;
    };
    connections
        da:data access sensor_value->total.sensor_value;
    properties
        Dispatch_Protocol                  => periodic;
        Period                             => 1000ms;
    end das_user.impl;

    ---------------
    -- process   --
    ---------------
    process node_a
    end node_a;

    process implementation node_a.impl
    subcomponents
        das_user:thread das_user.impl;
        sensor_data:data sensor_data.impl;
    connections
        da:data access sensor_data->das_user.sensor_value;
    end node_a.impl;

    ---------------
    -- processor --
    ---------------
    processor x86 
    properties 
        Deployment::Execution_Platform => Native; 
    end x86; 

    processor implementation x86.linux 
    properties 
        Deployment::Execution_Platform => Native; 
    end x86.linux;

    ---------------
    -- system   --
    ---------------
    system das
    end das;

    system implementation das.impl
    subcomponents
        node_a:process node_a.impl;
        cpu_x86_linux:processor x86.linux;
    properties
        Actual_Processor_Binding => (reference (cpu_x86_linux)) applies to node_a;
    end das.impl;

end das;

--scenario.aadl
--  This is a scenario file describing the AADL 
--  application rma

--  $Id: scenario.aadl 6404 2009-04-22 10:10:04Z hugues $

system das 
properties
  Ocarina_Config::Timeout_Property     => 4000ms;
  Ocarina_Config::Referencial_Files    =>
    ("node_a", "node_a.ref");
  Ocarina_Config::AADL_Files           => 
    ("das.aadl");
  Ocarina_Config::Generator            => polyorb_hi_c;
  Ocarina_Config::Needed_Property_Sets => 
    (--value (Ocarina_Config::Base_types),
     value (Ocarina_Config::Data_Model),
     value (Ocarina_Config::Deployment),
     value (Ocarina_Config::Cheddar_Properties));
  Ocarina_Config::AADL_Version         => AADLv2;
end das;

system implementation das.Impl
end  das.Impl;
#include<stdio.h>   
#include"types.h"

das__value_t data=1;
void set_value(das__value_t* data_value)
{
    *data_value=data;
    data++;
    printf("set value,the value is %d.\n",*data_value);
}


void get_value 
    (das__value_t* data_out,
    das__value_t* data_value)
{

    *data_out = *data_value;

    printf("get value,the value is %d.\n",*data_value);
}

void process_value 
    (das__value_t data_in)
{
    printf("process value,the value is %d.\n",data_in);

}

in the generated code types.c
I got

void sensor_data_impl_get_value 
    (das__sensor_data_impl* value)
{

  __po_hi_protected_lock (value->protected_id);
  das__get_value (data_out, &(value->data_value));
  __po_hi_protected_unlock (value->protected_id);
}

but It seems that the true prototye is
void sensor_data_impl_get_value (das__value_t* data_out, das__sensor_data_impl* value)
because the implementation use data_out,but it doesn't occurs in parameters,and It cause compiler
errors

subprograms.c:16:56: error: too many arguments to function call, expected
      single argument 'value', have 2 arguments
  sensor_data_impl_get_value (&(data_out_request_var), &(sensor_data));
  ~~~~~~~~~~~~~~~~~~~~~~~~~~                           ^~~~~~~~~~~~~~
./types.h:25:1: note: 'sensor_data_impl_get_value' declared here
void sensor_data_impl_get_value 
^
1 error generated.

when I change it ,It works.

Generation of top-level makefile

As suggested by Kenneth, it would be good to have a top-level makefile generated by the code generators. This makefile would simply iterate on all subdirectories

./configure missing

Hi,
I can not install the program. ./configuration does not work. I had already installed gnatgcc. In bin folder, there is just ocarina-config but I dont know how I can create configuration and make files.

I just started to use ocarina. Thank you.

No error message on wrong root instantiation

When instantiating an AADL model in Ocarina with le -r command line option:

  • if the provided element is not a root, and the AADL model contains only one root, a correct error message is printed out
  • if the provided element is not a root, and the AADL model contains 2 or more possible root, there are no error message printed out.

type declaration error when using Arinc 653 Blackboard with POK

When using intra partition communication with Pok, ocarina-backends-pok_c-deployment.adb check wether ARINC 653 is used or not but in both case the final type used is uint8_t. In fact in case of using ARINC653, BLACK_BOARD_ID_TYPE is a 32 bits integer and not a 8 bits. This will not result in a compilation error but probably in an execution error (misaligned address for example).

To correct this problem, I suggest to change lines 2306 to 2309 of ocarina-backends-pok_c-deployment.adb :

CTU.Make_Variable_Declaration
                         (Defining_Identifier =>
                            CTU.Make_Defining_Identifier (Map_Port_Var (F)),
                          Used_Type => RE (RE_Uint8_T));

by :

CTU.Make_Variable_Declaration
                         (Defining_Identifier =>
                            CTU.Make_Defining_Identifier (Map_Port_Var (F)),
                          Used_Type => Type_Used);

I also suggest to change "RH_Types" line 644 of ocarina-backends-pok_c-runtime.ads by "RH_Blackboard" in order to add the correct header

API Python stop python engine on ocarina error

When error occurs in Ocarina, the procedure Exit_On_Error from the file src\core\common_files\errors.adb is called.

This procedure call "OS_Exit" which works well in standalone Ocarina but stops the Python engine when used through the Python API. Then it is not possible to catch Ocarina error in Python API.

Actual procedure is:
procedure Exit_On_Error (Error : Boolean; Reason : String) is
begin
if Error then
Set_Standard_Error;
Write_Line (Reason);
OS_Exit (1);
end if;
end Exit_On_Error;

To make it work, in the Ellidiss fork, this code is changed to:
procedure Exit_On_Error (Error : Boolean; Reason : String) is
begin
if Error then
Set_Standard_Error;
-- Write_Line (Reason);
-- OS_Exit (1);
raise Ocarina_Error with Reason;
end if;
end Exit_On_Error;
And in error.ads the following line is added to define the error:
Ocarina_Error : exception;

long file names under cygwin

When using Ocarina under cygwin, I get an error when trying to use Ocarina when long file names.

See the example below
jdelange@RM-BLACKCHERRY /cygdrive/c/Users/jdelange/git/pok/examples/arinc653-blackboard
$ ocarina -aadlv2 -f -i model.aadl /cygdrive/c/Users/jdelange/git/pok/misc/aadl-library.aadl
Cannot find file /cygdrive/c/Users/jdelange/git/pok/misc/aadl-library.aadl

But if I copy the aadl-library.aadl file into the current directory and avoid the long path, it works.

Error when using component alias(renames)

Ocarina produces an error for models that have an alias declaration renaming a component type.

Error:

test_renames_a.aadl:5:39: test_renames_b::B (identifier) is not visible
Cannot analyze AADL specifications

test_renames_a.aadl:

package test_renames_a
public
with test_renames_b;

Test_B renames system test_renames_b::B; -- This is the line that causes the error

system A
end A;

system implementation A.impl
end A.impl;

end test_renames_a;

test_renames_b.aadl

package test_renames_b
public

system B
end B;

end test_renames_b;

[AADLv2.1] Subprogram Group Subcomponents inside of Subprogram Groups Implementations

I know the Ocarina has not been updated to support the changes in AADLv2.1. Ocarina currently does not support Subprogram Implementations containing Subprogram Group subcomponents. Test case below.

package test_spg
public

subprogram group spg_a
end spg_a;

subprogram group implementation spg_a.impl
end spg_a.impl;

subprogram group spg_b
end spg_b;

subprogram group implementation spg_b.impl
subcomponents
    spga1 : subprogram group spg_a.impl;
end spg_b.impl;

system test
end test;

system implementation test.impl
subcomponents
    spg_b1 : subprogram group spg_b.impl;
end test.impl;

end test_spg;

Python API: general improvements

This issue is to track request for improvements: which function should return something?

  • analyse() should return a boolean

others?

Fixing output file for cheddar generation does not work

By launching the following command:"ocarina -aadlv2 -o ./truc.xml -g cheddar ../../sandbox/examples/deployment.aadl ../../sandbox/examples/rma.aadl"
the following error is raised: "Message: directory "./truc.xml" does not exist"
whereas -o shall point to the file where Ocarina is to generate cheddar xml file.

Support for record properties

When trying to parse the following model https://github.com/osate/examples/blob/master/core-examples/arinc653-basic/onepart.aadl

I got an exception, see following.

/home/julien/local/bin/ocarina -aadlv2 -g polyorb_hi_c -r arincsystem.impl /home/julien/git/examples/core-examples/arinc653-basic/onepart.aadl /home/julien/wip/runtime-osate/Plugin_Resources/ARINC653.aadl
onepart.aadl:89:04: warning: part1mem references a component type
+========================== OCARINA BUG DETECTED =========================+
| Detected exception: STORAGE_ERROR |
| Error: s-intman.adb:139 explicit raise |
| Please refer to the User's Guide for more details. |
+=========================================================================+

Exception name: STORAGE_ERROR
Message: s-intman.adb:139 explicit raise

Schedule_Window_Record_Term_Array definition

The Get_Module_Schedule_Property returns a Schedule_Window_Record_Term_Array
which has the following definition

type Schedule_Window_Record_Term is record
Partition : Name_Id;
Duration : Time_Type;
Periodic_Processing_Start : Boolean;
end record;

However, the partition part should be a node id with a reference to the partition instead of a name_id. This is a semantic error and it is not possible to solely rely on the name: looking for a subcomponent with this name in the component hierarchy is confusing because several sub-components can have this name.

Thus, it would be better to put a Node_Id and reference the existing referenced component.

Support of C++ as implementation language for AADL subprograms

I created a simple AADL v2.1 Rate Monitonic Scheduling single a single thread calling one subprogram. The subprogram is written in C++ (I all so developed a C version of the same subprogram). When staring ocarina to generate code I receive the following error message from ocarina:

IDAeNetBusManagera.aadl:7:30 Backends: fatal error : This kind of subprogram is not supported SUBPROGRAM_UNKNOWN

AADL v2.1 specification:

subprogram BCMgr
properties
Source_Language => (CPP);
Source_Name => "bcmgr";
Source_Text => ("bcmgr.cpp");
end BCMgr;

My ocarina verion is dated 12-17-2012.

This is the C version in which ocaina will generate code and its generated and user created code (bcmgr.c) will compile and execute on the targeted machine.

subprogram BCMgr
properties
Source_Language => (C);
Source_Name => "bcmgr";
Source_Text => ("bcmgr.c");
end BCMgr;

Thanks,

Kenneth

Error Generation code for Ada

Dear all,

I try to generate code with OCARINA from my AADL model but but without success. The model seems correct to me but I get the following error that I can not fix :

polyorb_hi_generated-subprograms.adb:13:03: no visible subprogram matches the specification for "Send_Spg"
polyorb_hi_generated-subprograms.adb:13:13: expected type "Standard.Integer"
polyorb_hi_generated-subprograms.adb:13:13: found type "Integer" defined at polyorb_hi_generated-types.ads:12
polyorb_hi_generated-subprograms.adb:17:03: no visible subprogram matches the specification for "Send_2_Spg"
polyorb_hi_generated-subprograms.adb:22:03: no visible subprogram matches the specification for "Receive_Spg"
polyorb_hi_generated-subprograms.adb:27:03: no visible subprogram matches the specification for "Receive_2_Spg"
compilation abandoned due to previous error
gnatmake: "/home/smail/Bureau/RAVEN/rma_impl/proc_a/polyorb_hi_generated-subprograms.adb" compilation error

and my model (only subprograms):

subprogram Send_Spg
features
result : out parameter Integer;
properties
source_name => "user_code.Send_Spg";
source_language => ada;
end Send_Spg;

subprogram Receive_Spg
features
input : in parameter Integer;
input_2 : in parameter Integer;
properties
source_name => "user_code.Receive_Spg";
source_language => ada;
end Receive_Spg;

subprogram Send_2_Spg
features
result : out parameter Integer;
result_2 : out parameter Integer;
properties
source_name => "user_code.Send_2_Spg";
source_language => ada;
end Send_2_Spg;

subprogram Receive_2_Spg
features
input_3 : in parameter Integer;
properties
source_name => "user_code.Receive_2_Spg";
source_language => ada;
end Receive_2_Spg;

thanks for your feedback , Smail.

Assertion Failure

Hi

With POK, I ran the makefile:

BUILD = --models=pololu_motor.aadl --no-run
TESTS = compile-x86 compile-ppc compile-sparc

include $(POK_PATH)/misc/mk/examples.mk

and received this error:

Will execute ocarina -aadlv2 -f -g pok_c pololu_motor.aadl $POK_PATH/misc/aadl-library.aadl
+========================== OCARINA BUG DETECTED =========================+
| Detected exception: SYSTEM.ASSERTIONS.ASSERT_FAILURE |
| Error: ocarina-me_aadl-aadl_instances-nodes.adb:183 |
| Please refer to the User's Guide for more details. |
+=========================================================================+

Exception name: SYSTEM.ASSERTIONS.ASSERT_FAILURE
Message: ocarina-me_aadl-aadl_instances-nodes.adb:183

Code generation failed
make: *** [build] Error 1

This is my AADL model:

package pololu_motor
public

with Deployment, Data_Model, POK;


-- System --

system motor_system
end motor_system;

system implementation motor_system.impl
subcomponents
Control : process ctr.impl;
CPU1 : processor cpu.impl;
Mem1 : memory motor_memory.impl;
Motor : device mtr.impl;
USB : bus universal_serial_bus.impl;
connections
BC1 : bus access USB -> CPU1.BA1;
BC2 : bus access USB -> Mem1.BA2;
BC3 : bus access USB -> Motor.BA3;
Rotate_Conn : port Control.send_rotation -> Motor.rec_rotation;
properties
Actual_Processor_Binding => (reference (CPU1)) applies to Control;
Actual_Memory_Binding => (reference (Mem1)) applies to Control;
Actual_Connection_Binding => (reference (USB)) applies to Rotate_Conn;
end motor_system.impl;


--- Memory- ---

memory motor_memory
features
BA2 : requires bus access universal_serial_bus.impl;
end motor_memory;

memory implementation motor_memory.impl
end motor_memory.impl;


--- Devices ---

device mtr
features
BA3 : requires bus access universal_serial_bus.impl;
rec_rotation : in event data port dummy;
end mtr;

device implementation mtr.impl
end mtr.impl;


---- Buses ----

bus universal_serial_bus
end universal_serial_bus;

bus implementation universal_serial_bus.impl
properties
Deployment::Transport_API => BSD_Sockets;
end universal_serial_bus.impl;


-- Processor --

processor cpu
features
BA1 : requires bus access universal_serial_bus.impl;
properties
--Deployment::Execution_Platform => LINUX64;
POK::Architecture => x86;
POK::BSP => x86_qemu;
end cpu;

processor implementation cpu.impl
subcomponents
partition : virtual processor mypartition.impl;
properties
--Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol);
--Priority_Range => 1 .. 2;
POK::Major_Frame => 1000 ms;
POK::Scheduler => STATIC;
POK::Slots => (1000 ms);
POK::Slots_Allocation => (reference (partition));
end cpu.impl;


---Virtual Processor---

virtual processor mypartition
properties
POK::Scheduler => RR;
end mypartition;

virtual processor implementation mypartition.impl
end mypartition.impl;


-- Processes --

process ctr
features
send_rotation : out event data port dummy;
properties
POK::Needed_Memory_Size => 120 KByte;
end ctr;

process implementation ctr.impl
subcomponents
activity : thread task.impl;
connections
Rot_Conn: port activity.rotate_out -> send_rotation;
end ctr.impl;


-- Threads --

thread task
features
rotate_out : out event data port dummy;
end task;

thread implementation task.impl
calls
Mycalls: {
hello_code : subprogram Hello_Spg;
};
connections
Param_Conn : parameter hello_code.Param1 -> rotate_out;
properties
Dispatch_Protocol => Periodic;
Period => 1000 ms;
Recover_Execution_time => 10 ms .. 20 ms;
Deadline => 1000 ms;
Priority => 1;
end task.impl;


----- Data ------

data dummy
properties
Data_Model::Data_Representation => Float;
end dummy;


-- Subprograms --

subprogram Hello_Spg
features
Param1 : out parameter dummy;
properties
Source_Language => (C);
Source_Name => "simple";
POK::Source_Location => "../../../simple.o";
end Hello_Spg;

end pololu_motor;

Regards,
Peter

constraint error raised

When trying to generate code, I got the following error:

ocarina -aadlv2 -f -b -r producer_consumer::pc.flowimpl -g polyorb_hi_c producer-consumer.aadl
========================== OCARINA BUG DETECTED =========================+
| Detected exception: CONSTRAINT_ERROR |
| Error: g-table.adb:223 overflow check failed |
| Please refer to the User's Guide for more details. |
+=========================================================================+

Exception name: CONSTRAINT_ERROR
Message: g-table.adb:223 overflow check failed
Call stack traceback locations:
0x49725a 0x496f11 0x6e25e4 0x6e18cb 0x6112fc 0x60fada 0x60fa40 0x60fa73 0x60fa34 0x4962e3 0x493676 0x4d6299 0x406750 0x405acd 0x7f63b2fa7b43 0x4033bb 0xfffffffffffffffe

This is the model I am using is on https://gist.github.com/juli1/cc2bdef8ae9dd538084b

Instanciation of incomplete models

Ocarina does not support the instanciation of incomplete models, e.g.

memory implementation foo.i
subcomponents
ram : memory;
end foo.i;

This is required to support some models, e.g. ARINC653 examples

Code generation for multi-core patterns

When selecting to generate C code ocarina returns the following error:

/usr/local/ocarina/bin/ocarina -aadlv2 -g polyorb_hi_c -r AvionicsBusMgr.XPS8500 /home/stachelbeck/workspace/aadlwork/BusManagers/Plugin_Resources/deployment.aadl /home/stachelbeck/workspace/aadlwork/BusManagers/Plugin_Resources/bus_properties.aadl /home/stachelbeck/workspace/aadlwork/BusManagers/eNetManagers/MissionBus2.aadl /home/stachelbeck/workspace/aadlwork/BusManagers/Plugin_Resources/processor_properties.aadl /home/stachelbeck/workspace/aadlwork/BusManagers/eNetManagers/EWBus.aadl /home/stachelbeck/workspace/aadlwork/BusManagers/eNetManagers/AvionicsBusManagers.aadl /home/stachelbeck/workspace/aadlwork/BusManagers/eNetManagers/MissionBus1.aadl /home/stachelbeck/workspace/aadlwork/BusManagers/eNetManagers/Messages.aadl /home/stachelbeck/workspace/aadlwork/BusManagers/eNetManagers/MissionBus0.aadl
+========================== OCARINA BUG DETECTED =========================+
| Detected exception: SYSTEM.ASSERTIONS.ASSERT_FAILURE |
| Error: ocarina-backends-properties.adb:2452 |
| Please refer to the User's Guide for more details. |
+=========================================================================+

Exception name: SYSTEM.ASSERTIONS.ASSERT_FAILURE
Message: ocarina-backends-properties.adb:2452

What would be causing ocarina to abort with this kind of error?

Here is my main aadl file (AvionicsBusManagers.aadl):

package AvionicsBusManagers
public
with Deployment;
with Processor_Properties;
with Bus_Properties;

with EWBus;
with MissionBus0;
with MissionBus1;
with MissionBus2;

-- Hardware

virtual processor logical
end logical;

virtual processor implementation logical.core
properties
Deployment::Execution_Platform => LINUX64;
Priority_Range => 1 .. 255;
Scheduling_Protocol => (RMS);
end logical.core;

bus Ethernet
properties
Deployment::Transport_API => BSD_Sockets;
Bus_Properties::Available_Bandwidth => (10 MBytesps, 100 MBytesps, 1 GBytesps);
end Ethernet;

bus implementation Ethernet.XPS8500
end Ethernet.XPS8500;

processor Intel
features
ETH : requires bus access Ethernet;
end Intel;

processor implementation Intel.i7_3770
subcomponents
Cpu0 : virtual processor logical.core {Processor_Properties::Core_Id => 0;};
Cpu1 : virtual processor logical.core {Processor_Properties::Core_Id => 1;};
Cpu2 : virtual processor logical.core {Processor_Properties::Core_Id => 2;};
Cpu3 : virtual processor logical.core {Processor_Properties::Core_Id => 3;};
properties
Processor_Properties::Processor_Family => x86;
Processor_Properties::Endianess => Little_Endian;
Processor_Properties::Word_Length => 64 bits;
Processor_Properties::Processor_Frequency => 3400 MHz;
Deployment::Supported_Runtime => PolyORB_HI_C;
Deployment::Location => "127.0.0.1";
end Intel.i7_3770;

system AvionicsBusMgr
end AvionicsBusMgr;

system implementation AvionicsBusMgr.XPS8500
subcomponents
CPU : processor Intel.i7_3770;
EWBC : process EWBus::BusControllerMgr.impl {Deployment::Port_Number => 4000;};
M0RT : process MissionBus0::M0RemoteTerminalMgr.impl {Deployment::Port_Number => 4001;};
M1RT : process MissionBus1::M1RemoteTerminalMgr.impl {Deployment::Port_Number => 4002;};
M2RT : process MissionBus2::M2RemoteTerminalMgr.impl {Deployment::Port_Number => 4003;};
L0 : bus Ethernet.XPS8500;
connections
SC0 : bus access L0 <-> CPU.ETH;
SC1 : port M0RT.RTtoBCMsg -> EWBC.M0RTtoBCMsg {Actual_Connection_Binding => (reference(L0));};
properties
Actual_Processor_Binding => (reference(CPU.Cpu0)) applies to EWBC;
Actual_Processor_Binding => (reference(CPU.Cpu1)) applies to M0RT;
Actual_Processor_Binding => (reference(CPU.Cpu2)) applies to M1RT;
Actual_Processor_Binding => (reference(CPU.Cpu3)) applies to M2RT;
end AvionicsBusMgr.XPS8500;

end AvionicsBusManagers;

Feature group connection with Classifier_Matching_Rule

The following is accepted by OSATE but not by Ocarina. I believe it is legal according to the AADL specification.

package SubGroup
public

feature group Interface_1
features
    a: in data port;    
end Interface_1;

feature group Interface_2
features
    a: out data port;
    b: out data port;           
end Interface_2;    

process P1
features
    inGroup: feature group Interface_1;
end P1;

process P2
features
    outGroup: feature group Interface_2;
end P2; 

system Test
end Test;

system implementation Test.Imp
subcomponents
    p1 : process P1;
    p2 : process P2;
connections
    -- OSATE 2 says these are compatible types, Ocarina says they are not.
    feature group p2.outGroup -> p1.inGroup {Classifier_Matching_Rule => Subset;};
end Test.Imp;

end SubGroup;

APPLIES TO (System implementation) raises error when used

Lets have the following AADL declarations.

A AADL model.aadl:

PACKAGE client_server_Pkg
PUBLIC
WITH AI;

SYSTEM client_server
END client_server;

SYSTEM IMPLEMENTATION client_server.others
PROPERTIES
AI::root_system => "SELECTED";
END client_server.others;

END client_server_Pkg;

A property set p1.aadl:

PROPERTY SET ai IS

Root_System : AADLSTRING
APPLIES TO (SYSTEM);
END ai;

A property set p2.aadl:

PROPERTY SET ai IS

Root_System : AADLSTRING
APPLIES TO (SYSTEM IMPLEMENTATION);
END ai;

Instantiating model.aadl+p1.aadl in Ocarina works.
Instantiating model.aadl+p2.aadl in Ocarina raises the error: " AI root_system cannot apply to client_server.others".

Assertion failures in Petri Net backends on incomplete models

While trying to compile aadl v2 code into a petri net I run into the following error.

 ------------------------------------------
 ------ Ocarina Petri Nets Generator ------
 ------------------------------------------

 +========================== OCARINA BUG DETECTED =========================+
 | Detected exception: SYSTEM.ASSERTIONS.ASSERT_FAILURE                    |
 | Error: ocarina-backends-pn-nodes.adb:463                                |
 | Please refer to the User's Guide for more details.                      |
 +=========================================================================+

 Exception name: SYSTEM.ASSERTIONS.ASSERT_FAILURE
 Message: ocarina-backends-pn-nodes.adb:463

The aadl code is as follows:

package vehicle
    public

    data on_off
    end on_off;

    process control
    features
        command_data: out data port on_off;
        engage: out data port on_off;
        disengage: out data port on_off;
    end control;

    process implementation control.standard
    end control.standard;

    ------------------------------------------------------------------------------------------  

    feature group vehicle_cmd_in
    features
        speed_command: out data port on_off;
        position_command: out data port on_off;
        airbag_command: out data port on_off;
        direction_command: out data port on_off;
    end vehicle_cmd_in;

    system vehicle
    features
        vehicle_cmd_input: feature group vehicle_cmd_in;
    end vehicle;

    system implementation vehicle.standard
    subcomponents
        speed_controller: process control.standard;
        position_controller: process control.standard;
        airbag_controller: process control.standard;
        direction_controller: process control.standard;
    connections
        event_distribution1: port vehicle_cmd_input.speed_command -> speed_controller.command_data;
        event_distribution2: port vehicle_cmd_input.position_command -> position_controller.command_data;
        event_distribution3: port vehicle_cmd_input.airbag_command -> airbag_controller.command_data;
        event_distribution4: port vehicle_cmd_input.direction_command -> direction_controller.command_data;
    end vehicle.standard;

    system root
    end root;

    system implementation root.impl
    subcomponents
        vehicle: system vehicle.standard;
    end root.impl;

end vehicle;

The command used to launch ocarina is

ocarina -g pertri_nets -aadlv2 vehicle.aadl

Not sure if the error is on my end or if this is something wrong in ocarina. Thanks for any assistance that you are able to offer.

error when processing options

When procesing options, I got a different behavior if I use one or several files.

  1. Example, I am using /home/julien/local/bin/ocarina -k no-assert -k deos -f -aadlv2 -g pok_c -r node.impl /home/julien/git/examples/core-examples/arinc653-basic/model.aadl
    Then, ocarina work as expected
  2. If I specified more than one file: [julien@akira]/home/julien/wip/pok/examples/arinc653-threads#/home/julien/local/bin/ocarina -k no-assert -k deos -aadlv2 -g pok_c -r node.impl /home/julien/wip/runtime-osate/Plugin_Resources/ARINC653.aadl /home/julien/git/examples/core-examples/arinc653-basic/model.aadl /home/julien/wip/runtime-osate/Plugin_Resources/Data_Model.aadl
    Cannot find file deos

There is an error (see output)

New backend: generate accessors for property values

Proliferation of AADL property sets makes it painful to write manually accessors to get the value of some properties. This ticket is to track effort in implementing a backend that will generate such accessors.

Issue when parsing records

When trying to parse the adiru model using the OSATE/Ocarina bridge, I got the following errors (see below). Seems that records are not parsed correctly.

/home/julien/local/bin/ocarina -k no-assert -k deos -aadlv2 -g pok_c -r adiru.deos -o /home/julien/git/AADLib/examples/adiru /home/julien/git/AADLib/examples/adiru/subprograms.aadl /home/julien/git/AADLib/src/property_set/pok.aadl /home/julien/git/AADLib/examples/adiru/partitions.aadl /home/julien/git/AADLib/examples/adiru/threads.aadl /home/julien/git/AADLib/examples/adiru/adiru_processor.aadl /home/julien/git/AADLib/examples/adiru/shm_datatype.aadl /home/julien/wip/runtime-osate/Plugin_Resources/Data_Model.aadl /home/julien/git/AADLib/examples/adiru/adiru_memory.aadl /home/julien/git/AADLib/examples/adiru/model.aadl /home/julien/wip/runtime-osate/Plugin_Resources/ARINC653.aadl
adiru_processor.aadl:61:04: parsing Boolean_Or_Record_Term, unexpected token '['
adiru_processor.aadl:61:27: parsing Property_Association or Contained_Property_Association, token ';' is expected, found identifier 'Description'
adiru_processor.aadl:60:02: parsing Component_Implementation, unexpected identifier 'ARINC653'
Cannot parse AADL specifications

Python API: management of properties

This ticket is to discuss the management of properties in the Python API. For now, a first design has been implemented. The getPropertyValue returns a list of strings with the value of the property.

Like this:

    -> properties:
      ['source_stack_size', '13952 Bytes']
      ['deadline', '500 ms']
      ['compute_execution_time', '0 ms .. 3 ms']
      ['dispatch_offset', '100 ms']
      ['period', '500 ms']
      ['dispatch_protocol', 'periodic']

This basic design imposes another step of parsing on the user side to retrieve units, process ranges, etc.

A working example is in tests/visitor.py

This ticket is to discuss further enhancement to this initial design.

Compile/install error

When issuing make all install, I got the following error:

/usr/bin/install: cannot stat ‘../../../src/python/ocarina_me_aadl_aadl_instances_nodes.py’: No such file or directory
/usr/bin/install: cannot stat ‘../../../src/python/ocarina_me_aadl_aadl_tree_nodes.py’: No such file or directory

OCARINA should parse by default AADLv2 files

Nowadays, the active AADL version is 2.x and OCARINA should be aligned on it. It may be solved by a build configuration switch looking like:

./configure --aadlv[12] --aadlv[12]-by-default

or more simple, keep only the second argument:

./configure --aadlv2-by-default

and embedd systematically aadl v1 and aadl v2 parsers.

Source_Name should respect case for C Language

Source_Name => “bcmgr”;
Source_Name => “BCMgr”;
Source_Name => “BCMGR”;

are all generated by ocarina as “bcmgr” and if my code is anything but “bcmgr” I get a undefined symbol from subprograms.c.

Cannot parse list of list

As reported, the following declaration

   Supported_Classifier_Equivalence_Matches: constant list of list of classifier (data, bus, subprogram, subprogram group, feature group) => ();

is not parsed correctly by Ocarina

Cheddar backend: bug in naming conventions and mapping of resources

Two issues:

1/ In the pathfinder_system example (AADLib), in the xml file, a task (for example prs_PSC.data_distribution from aadl model) becomes prs_psc_data_distribution while the shared data (data_rw) is accessed by the (same) task <resource_user>data_distribution 1 1</resource_user>. Consequently, the same task in the AADL model has two different names in the cheddar configuration file.

2/ Plus, the resource is occupied by the task for 1 ms, while the case study said that any task gets the needed resource during it full execution time. Maybe it is possible to precise this last point through the aadl model (but it is not the case in the example).

REAL "Connection Instances" do not represent semantic connections?

It appears that REAL's connection instances do not represent semantic connections or Ocarina is instantiating models differently than I expect.

In the below model, I expected the constraint to fail with six connection instances(1 for each ultimate destination/source pair). According to the output there are only 2 connection instances.

Thoughts?

test_case.aadl

package Test
public

bus TestBus
end TestBus;

bus implementation TestBus.Impl
end TestBus.Impl;

system C
features
    ba1 : requires bus access TestBus.Impl;
end C;

system implementation C.Impl
subcomponents
    c1 : system C.Impl2;
    c2 : system C.Impl2;
    c3 : system C.Impl2;

connections
    con1_1 : bus access ba1 -> c1.ba1;
    con1_2 : bus access ba1 -> c2.ba1;
    con1_3 : bus access ba1 -> c3.ba1;
end C.Impl;


system implementation C.Impl2
end C.Impl2;

system A
end A;

system implementation A.impl
subcomponents
    b1 : bus TestBus.Impl;
    c1 : system C.Impl;
    c2 : system C.Impl;

connections
    con1_1 : bus access b1 -> c1.ba1;
    con1_2 : bus access b1 -> c2.ba1;

annex real_specification {**
    theorem constraints
    foreach b in Bus_Set do
        connections := {c in Connection_Set | Is_Accessed_By (b, c)};
        check(size(list(connections)) <= 2);
    end;
**};
end A.impl;

end Test;

Output:

 * Iterate for variable: a.impl_b1
Content of set connections (test-case.aadl:47:18) is 
  a.impl_con1_1: 172 connection instance test-case.aadl:41:02
  a.impl_con1_2: 183 connection instance test-case.aadl:42:02
 => Result: TRUE

POLYORB-HI-C

Hi

When using Ocarina to generate code from an AADL model, is it necessary to use the PolyORB-HI backend? I have managed to parsed and instantiated my AADL model. However, I could only generate code WITH the PolyORB backend, for e.g.:

/usr/local/bin/ocarina -f -aadlv2 -g polyorb_hi_c -r motor_system.impl pololu_motor.aadl

Are we able to just generate and build the code using -b?

In addition, if PolyORB is really necessary to generate code from an AADL model, what are the proepr ways to remove the po-hi header/object files thereafter?

Peter

ocarina fails to build with gcc-4.8

It fails with the following error:

gnatmake \
          -j4 -P ocarina-config.gpr -XBUILD=release -XLIBRARY_TYPE=static \
          -XABS_SRC_DIR="/home/adegroot/ocarina/src" \
          -XABS_BUILD_DIR="/home/adegroot/ocarina/src" \
          -aP../projects -aP../projects;
gcc-4.8 -c -gnatec=/home/adegroot/ocarina/src/../projects/restrictions.adc -O2 -fPIC -gnat12 -gnata -gnaty -gnatyu -gnatys -gnatpn -I- -gnatA /home/adegroot/ocarina/src/config/ocarina-configuration.adb
ocarina-configuration.adb:257:30: "Compilation_Date" not declared in "Source_Info"
ocarina-configuration.adb:258:27: "Compilation_Time" not declared in "Source_Info"
gnatmake: "/home/adegroot/ocarina/src/config/ocarina-configuration.adb" compilation error

From my basic ada understanding, GNAT.Source_Info from FSF only provides File, Line, Source_Location and Enclosing_Entity).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.