diff --git a/Demo_Directives/DeploymentView.aadl b/Demo_Directives/DeploymentView.aadl index 876e81eb293160f4fbf95c2a49abb272b2b567cd..fd4de21cdba902c7a83ac89cc41986c83b397e18 100644 --- a/Demo_Directives/DeploymentView.aadl +++ b/Demo_Directives/DeploymentView.aadl @@ -1,2305 +1,74 @@ -PACKAGE deploymentview::DV -PUBLIC -WITH Deployment; -WITH Taste; - -WITH interfaceview::IV; - -WITH ocarina_processors_x86; - --------------------------------------------------- --- TASTE Deployement View +-- AADL2.1 +-- TASTE type deploymentview +-- +-- generated code: do not edit --------------------------------------------------- - ---------------------- - -- ProcessorBoards -- - ---------------------- - - SYSTEM obj73_obj80 - END obj73_obj80; - - PROCESS obj93_obj102 - END obj93_obj102; - - PROCESS IMPLEMENTATION obj93_obj102.others - END obj93_obj102.others; - - MEMORY obj103_obj113 - END obj103_obj113; - - MEMORY IMPLEMENTATION obj103_obj113.others - END obj103_obj113.others; - - SYSTEM IMPLEMENTATION obj73_obj80.others - SUBCOMPONENTS - obj93_obj102 : PROCESS obj93_obj102.others - { Taste::Coordinates => "883 365 1689 850"; - Deployment::Port_Number => 0;}; - Function0_obj124 : SYSTEM interfaceview::IV::Function0 - { Taste::Coordinates => "1232 542 1529 800" ;}; - Function1_obj262 : SYSTEM interfaceview::IV::Function1 - { Taste::Coordinates => "896 412 1125 689" ;}; - obj83_obj91 : PROCESSOR ocarina_processors_x86::x86.linux - { Taste::Coordinates => "789 306 1725 895"; }; - obj103_obj113 : MEMORY obj103_obj113.others - { Taste::Coordinates => "1519 758 2455 1347"; }; - - PROPERTIES - -- Connexion des CPUs aux process/drivers - Actual_Processor_Binding => (reference (obj83_obj91)) applies to obj93_obj102; - Taste::APLC_Binding => (reference(obj93_obj102)) APPLIES TO Function0_obj124; - Taste::APLC_Binding => (reference(obj93_obj102)) APPLIES TO Function1_obj262; - Actual_Memory_Binding => (reference (obj103_obj113)) applies to obj93_obj102; - END obj73_obj80.others; - - -------------- - -- Devices-- - -------------- +PACKAGE deploymentview::DV::Node1 +PUBLIC - ----------- - -- Buses -- - ----------- +WITH Taste; +WITH Deployment; +WITH TASTE_DV_Properties; +PROCESS taste_directives +END taste_directives; - ----------------- - -- Root System -- - ----------------- +PROCESS IMPLEMENTATION taste_directives.others +END taste_directives.others; - SYSTEM deploymentview - END deploymentview; +END deploymentview::DV::Node1; - SYSTEM IMPLEMENTATION deploymentview.others - SUBCOMPONENTS - -- The processor boards - obj73_obj80 : SYSTEM obj73_obj80.others - { Taste::Coordinates => "602 188 2474 1366"; }; - -- The devices - -- The buses - -- The IV systems - interfaceview_obj181 : SYSTEM interfaceview::IV::interfaceview.others; - END deploymentview.others; +PACKAGE deploymentview::DV +PUBLIC +WITH interfaceview::IV::Function0; +WITH interfaceview::IV::Function1; +WITH ocarina_processors_x86; +WITH deploymentview::DV::Node1; +WITH Taste; +WITH Deployment; +WITH interfaceview::IV; +WITH TASTE_DV_Properties; +SYSTEM Node1 +END Node1; + +SYSTEM IMPLEMENTATION Node1.others +SUBCOMPONENTS + IV_Function0 : SYSTEM interfaceview::IV::Function0::Function0.others { + Taste::FunctionName => "Function0"; + }; + IV_Function1 : SYSTEM interfaceview::IV::Function1::Function1.others { + Taste::FunctionName => "Function1"; + }; + taste_directives : PROCESS deploymentview::DV::Node1::taste_directives.others { + Taste::coordinates => "101980 66951 144344 93625"; + Deployment::Port_Number => 0; + }; + x86_linux : PROCESSOR ocarina_processors_x86::x86.linux { + Taste::coordinates => "96684 59330 149640 97436"; + }; +PROPERTIES + Taste::APLC_Binding => (reference (taste_directives)) APPLIES TO IV_Function0; + Taste::APLC_Binding => (reference (taste_directives)) APPLIES TO IV_Function1; + Actual_Processor_Binding => (reference (x86_linux)) APPLIES TO taste_directives; +END Node1.others; + +SYSTEM deploymentview +END deploymentview; + +SYSTEM IMPLEMENTATION deploymentview.others +SUBCOMPONENTS + Node1 : SYSTEM Node1.others { + Taste::coordinates => "90064 48442 156260 102880"; + }; + interfaceview : SYSTEM interfaceview::IV::interfaceview.others; +END deploymentview.others; PROPERTIES - Taste::Coordinates => "0 0 2970 2100"; + Taste::coordinates => "0 0 297000 210000"; + Taste::version => "2.0"; Taste::interfaceView => "InterfaceView.aadl"; - + Taste::HWLibraries => ("../../../tool-inst/share/ocarina/AADLv2/ocarina_components.aadl"); END deploymentview::DV; - - - ---------------------------------------- --- copied aadl libraries --- TASTE requirement --- Do not edit below this line ---------------------------------------- - -package ocarina_buses - -public - -bus generic_bus -end generic_bus; - -bus implementation generic_bus.i -end generic_bus.i; - -bus dummy_bus -end dummy_bus; - -bus implementation dummy_bus.i -end dummy_bus.i; - -bus ip -end ip; - -bus implementation ip.pohic -end ip.pohic; - -bus implementation ip.i -subcomponents - asn : virtual bus asn1.i; - pohic : virtual bus pohi.c; - pohiada : virtual bus pohi.ada; -end ip.i; - -bus implementation ip.pohiada -end ip.pohiada; - -bus spacewire -end spacewire; - -bus implementation spacewire.generic -end spacewire.generic; - -bus serial -end serial; - -bus implementation serial.generic -end serial.generic; - - ----------------------- --- Virtual buses -- ----------------------- - -virtual bus raw -end raw; - -virtual bus implementation raw.i -end raw.i; - -virtual bus asn1 -end asn1; - -virtual bus implementation asn1.i -end asn1.i; - -virtual bus pohi -end pohi; - -virtual bus implementation pohi.c -end pohi.c; - -virtual bus implementation pohi.ada -end pohi.ada; - -end ocarina_buses; -package ocarina_drivers -public - - with deployment; - - with ocarina_buses; - - with Data_Model; - with Base_Types; - - with ocarina_drivers_leon_serial; - - with ocarina_drivers_rasta_1553; - with ocarina_drivers_rasta_serial; - with ocarina_drivers_rasta_spacewire; - with ocarina_drivers_rtems_ne2000; - - with ocarina_drivers_star_dundee_spacewire_brick; - - with ocarina_drivers_udp_exarm; - with ocarina_drivers_serial; - - with ocarina_drivers_ip_pohic; - - with ocarina_drivers_exarm_ni_6071e_analog; - with ocarina_drivers_exarm_ni_6071e_digital; - - with ocarina_drivers_generic_keyboard; - - with GRUART; - with GRSPW; - with Native_UART; - with TCP_IP_Protocol; - - ------------------------ - -- Configuration Type -- - ------------------------ - - data configuration_type_ip - properties - Type_Source_Name => "IP-Conf-T"; - Deployment::ASN1_Module_Name => "POHICDRIVER-IP"; - Source_Language => ASN1; - Source_Text => ("~/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/ip.asn" , "drivers/configuration/ip.h"); - end configuration_type_ip; - - data configuration_type_serial - properties - Type_Source_Name => "Serial-Conf-T"; - Deployment::ASN1_Module_Name => "POHICDRIVER-UART"; - Source_Language => ASN1; - Source_Text => ("~/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/serial.asn", "drivers/configuration/serial.h"); - end configuration_type_serial; - - data configuration_type_spacewire - properties - Type_Source_Name => "Spacewire-Conf-T"; - Deployment::ASN1_Module_Name => "POHICDRIVER-SPACEWIRE"; - Source_Language => ASN1; - Source_Text => ("~/tool-inst/include/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/spacewire.asn", "drivers/configuration/spacewire.h"); - end configuration_type_spacewire; - - -------------- - -- Keyboard -- - -------------- - - device generic_keyboard - features - key_pressed : out data port Base_Types::Character; - properties - Deployment::Driver_Name => "generic_keyboard"; - Device_Driver => classifier (ocarina_drivers_generic_keyboard::generic_keyboard_driver.i); - Initialize_Entrypoint => classifier (ocarina_drivers_generic_keyboard::spg_generic_keyboard_init); - end generic_keyboard; - - device implementation generic_keyboard.linux - end generic_keyboard.linux; - - - ------------------- - -- LEON ETHERNET -- - ------------------- - - device leon_ethernet - features - ethbus : requires bus access ocarina_buses::ip.i; - end leon_ethernet; - - device implementation leon_ethernet.raw - properties - Deployment::Driver_Name => "eth_leon"; - Device_Driver => classifier (ocarina_drivers_leon_eth::eth_driver.leon); - Initialize_Entrypoint => classifier (ocarina_drivers_leon_eth::spg_leon_eth_init); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c)); - end leon_ethernet.raw; - - - ------------------ - -- RASTA SERIAL -- - ------------------ - - device leon_serial - features - serialaccess : requires bus access ocarina_buses::serial.generic; - end leon_serial; - - device implementation leon_serial.raw - properties - Deployment::Driver_Name => "serial_leon"; - Device_Driver => classifier (ocarina_drivers_leon_serial::serial_driver.leon); - Initialize_Entrypoint => classifier (ocarina_drivers_leon_serial::spg_serial_init_leon); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::raw.i)); - end leon_serial.raw; - - device implementation leon_serial.raw_sender - properties - Deployment::Driver_Name => "serial_leon_sender"; - Device_Driver => classifier (ocarina_drivers_leon_serial::serial_driver.leon_sender); - Initialize_Entrypoint => classifier (ocarina_drivers_leon_serial::spg_serial_init_leon_sender); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::raw.i)); - end leon_serial.raw_sender; - - ---------------- - -- RASTA 1553 -- - ---------------- - - device rasta_1553 - end rasta_1553; - - device implementation rasta_1553.terminal - properties - Deployment::Driver_Name => "1553_rasta"; - Device_Driver => classifier (ocarina_drivers_rasta_1553::if1553_driver.rasta_terminal); - Initialize_Entrypoint => classifier (ocarina_drivers_rasta_1553::spg_1553_init_rasta_terminal); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c)); - end rasta_1553.terminal; - - device implementation rasta_1553.controller_sender_only - properties - Deployment::Driver_Name => "1553_rasta"; - Device_Driver => classifier (ocarina_drivers_rasta_1553::if1553_driver.rasta_controller_sender_only); - Initialize_Entrypoint => classifier (ocarina_drivers_rasta_1553::spg_1553_init_rasta_controller); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c)); - end rasta_1553.controller_sender_only; - - ------------------ - -- RASTA SERIAL -- - ------------------ - - device rasta_serial - features - serialaccess : requires bus access ocarina_buses::serial.generic; - end rasta_serial; - - device implementation rasta_serial.raw - properties - Deployment::Driver_Name => "serial_rasta"; - Device_Driver => classifier (ocarina_drivers_rasta_serial::serial_driver.rasta); - Initialize_Entrypoint => classifier (ocarina_drivers_rasta_serial::spg_serial_init_rasta); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::raw.i)); - end rasta_serial.raw; - - device implementation rasta_serial.pohiada - properties - Deployment::Driver_Name => "serial_rasta"; - Implemented_As => classifier (GRUART::Driver_GRUART_Protocol.impl); - Initialize_Entrypoint => classifier (GRUART::Initialize); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::raw.i)); - end rasta_serial.pohiada; - - -------------------------------------------------- - -- USB BRICK (STAR DUNDEE) DEVICE FOR SPACEWIRE -- - -------------------------------------------------- - - device usb_brick_spacewire - features - spwaccess : requires bus access ocarina_buses::spacewire.generic; - end usb_brick_spacewire; - - device implementation usb_brick_spacewire.pohic - properties - Deployment::Driver_Name => "spacewire_usb_brick"; - Device_Driver => classifier (ocarina_drivers_star_dundee_spacewire_brick::driver.usb_brick); - Initialize_Entrypoint => classifier (ocarina_drivers_star_dundee_spacewire_brick::spg_init); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c)); - end usb_brick_spacewire.pohic; - - --------------------- - -- RASTA SPACEWIRE -- - --------------------- - - device rasta_spacewire - features - spwaccess : requires bus access ocarina_buses::spacewire.generic; - end rasta_spacewire; - - device implementation rasta_spacewire.pohic - properties - Deployment::Driver_Name => "spacewire_rasta"; - Device_Driver => classifier (ocarina_drivers_rasta_spacewire::spacewire_driver.rasta); - Initialize_Entrypoint => classifier (ocarina_drivers_rasta_spacewire::spg_spacewire_init_rasta); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c)); - end rasta_spacewire.pohic; - - device implementation rasta_spacewire.pohiada - properties - Deployment::Driver_Name => "spacewire_rasta"; - Implemented_As => classifier (GRSPW::Driver_GRSPW_Protocol.impl); - Initialize_Entrypoint => classifier (GRSPW::Initialize); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c)); - end rasta_spacewire.pohiada; - - --------------------------- - -- Generic serial driver -- - --------------------------- - - device generic_serial - features - serialaccess : requires bus access ocarina_buses::serial.generic; - end generic_serial; - - device implementation generic_serial.raw - properties - Deployment::Driver_Name => "serial_linux"; - Device_Driver => classifier (ocarina_drivers_serial::serial_driver.linux); - Initialize_Entrypoint => classifier (ocarina_drivers_serial::spg_serial_init_linux); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::raw.i)); - end generic_serial.raw; - - device implementation generic_serial.pohiada - properties - Deployment::Driver_Name => "serial_linux"; - Implemented_As => - classifier (Native_UART::Driver_Native_UART_Protocol.impl); - Initialize_Entrypoint => classifier (Native_UART::Initialize); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::raw.i)); - end generic_serial.pohiada; - - device implementation generic_serial.raw_sender - properties - Deployment::Driver_Name => "serial_linux_sender"; - Device_Driver => classifier (ocarina_drivers_serial::serial_driver.linux_sender); - Initialize_Entrypoint => classifier (ocarina_drivers_serial::spg_serial_init_linux_sender); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::raw.i)); - end generic_serial.raw_sender; - - device implementation generic_serial.raw_receiver - properties - Deployment::Driver_Name => "serial_linux_receiver"; - Device_Driver => classifier (ocarina_drivers_serial::serial_driver.linux_receiver); - Initialize_Entrypoint => classifier (ocarina_drivers_serial::spg_serial_init_linux_receiver); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::raw.i)); - end generic_serial.raw_receiver; - - ------------------------------- - -- Generic sockets/ip driver -- - ------------------------------- - - device generic_sockets_ip - features - thebus : requires bus access ocarina_buses::ip.i; - end generic_sockets_ip; - - device implementation generic_sockets_ip.pohic - properties - Deployment::Driver_Name => "sockets"; - Device_Driver => classifier (ocarina_drivers_ip_pohic::sockets_impl.i); - Initialize_Entrypoint => classifier (ocarina_drivers_ip_pohic::spg_sockets_init); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c)); - end generic_sockets_ip.pohic; - - device implementation generic_sockets_ip.pohiada - properties - Deployment::Driver_Name => "socketsnew"; - Implemented_As => classifier (TCP_IP_Protocol::Driver_TCP_IP_Protocol.impl); - Initialize_Entrypoint => classifier (TCP_IP_Protocol::Initialize); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c)); - end generic_sockets_ip.pohiada; - - ------------------ - -- RTEMS NE2000 -- - ------------------ - - device rtems_ne2000 - features - thebus : requires bus access ocarina_buses::ip.i; - end rtems_ne2000; - - device implementation rtems_ne2000.ip_pohic - properties - Deployment::Driver_Name => "rtems_ne2000_sockets"; - Device_Driver => classifier (ocarina_drivers_rtems_ne2000::driver.i); - Initialize_Entrypoint => classifier (ocarina_drivers_rtems_ne2000::init); - Provided_Virtual_Bus_Class => (classifier (ocarina_buses::pohi.c)); - end rtems_ne2000.ip_pohic; - - ------------------------------------------ - -- Exarm UDP driver -- - ------------------------------------------ - -- This driver is used to communicate -- - -- with the exarm robot and also -- - -- the Matlab simulator. -- - ------------------------------------------ - - device exarm_ip - features - thebus : requires bus access ocarina_buses::ip.i; - end exarm_ip; - - device implementation exarm_ip.vr_udp - properties - Deployment::Driver_Name => "exarm"; - Device_Driver => classifier (ocarina_drivers_udp_exarm::driver.i); - Initialize_Entrypoint => classifier (ocarina_drivers_udp_exarm::init); - end exarm_ip.vr_udp; - - data exarm_protocol_data - end exarm_protocol_data; - - data implementation exarm_protocol_data.vr extends ocarina_drivers_udp_exarm::protocol.vr - properties - Data_Model::Data_Representation => Struct; - end exarm_protocol_data.vr; - - data implementation exarm_protocol_data.robot extends ocarina_drivers_udp_exarm::protocol.robot - properties - Data_Model::Data_Representation => Struct; - end exarm_protocol_data.robot; - - --------------------------------------- - -- Devices for the Exo skeleton -- - -- National Instruments PCI-6071E -- - --------------------------------------- - -- This device is used to make data -- - -- acquisition of the EXARM robot. -- - --------------------------------------- - - device exarm_ni_6071e_analog - features - data1 : out data port Base_Types::Float_64; - data2 : out data port Base_Types::Float_64; - data3 : out data port Base_Types::Float_64; - data4 : out data port Base_Types::Float_64; - data5 : out data port Base_Types::Float_64; - data6 : out data port Base_Types::Float_64; - data7 : out data port Base_Types::Float_64; - data8 : out data port Base_Types::Float_64; - data9 : out data port Base_Types::Float_64; - data10 : out data port Base_Types::Float_64; - data11 : out data port Base_Types::Float_64; - data12 : out data port Base_Types::Float_64; - data13 : out data port Base_Types::Float_64; - data14 : out data port Base_Types::Float_64; - data15 : out data port Base_Types::Float_64; - data16 : out data port Base_Types::Float_64; - end exarm_ni_6071e_analog; - - device implementation exarm_ni_6071e_analog.i - properties - Deployment::Driver_Name => "exarm_ni_6071e_analog"; - Device_Driver => classifier (ocarina_drivers_exarm_ni_6071e_analog::driver.i); - Initialize_Entrypoint => classifier (ocarina_drivers_exarm_ni_6071e_analog::spg_init); - end exarm_ni_6071e_analog.i; - - device exarm_ni_6071e_digital - features - data1 : out data port Base_Types::Unsigned_8; - data2 : out data port Base_Types::Unsigned_8; - end exarm_ni_6071e_digital; - - device implementation exarm_ni_6071e_digital.i - properties - Deployment::Driver_Name => "exarm_ni_6071e_digital"; - Device_Driver => classifier (ocarina_drivers_exarm_ni_6071e_digital::driver.i); - Initialize_Entrypoint => classifier (ocarina_drivers_exarm_ni_6071e_digital::spg_init); - end exarm_ni_6071e_digital.i; - -end ocarina_drivers; - -package ocarina_types - -public - -with Data_Model; - -data integer -end integer; - -data implementation integer.i -properties - Data_Model::Data_Representation => integer; -end integer.i; - -data float -end float; - -data implementation float.i -properties - Data_Model::Data_Representation => float; -end float.i; - -data boolean -end boolean; - -data implementation boolean.i -properties - Data_Model::Data_Representation => boolean; -end boolean.i; - -end ocarina_types; -package ocarina_drivers_exarm_ni_6071e_analog - -public - -with Base_Types; -with Deployment; - -subprogram spg_init -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_exarm_ni_6071e_analog_init"; -end spg_init; - - -subprogram spg_poller -features - data1 : out parameter Base_Types::Float_64; - data2 : out parameter Base_Types::Float_64; - data3 : out parameter Base_Types::Float_64; - data4 : out parameter Base_Types::Float_64; - data5 : out parameter Base_Types::Float_64; - data6 : out parameter Base_Types::Float_64; - data7 : out parameter Base_Types::Float_64; - data8 : out parameter Base_Types::Float_64; - data9 : out parameter Base_Types::Float_64; - data10 : out parameter Base_Types::Float_64; - data11 : out parameter Base_Types::Float_64; - data12 : out parameter Base_Types::Float_64; - data13 : out parameter Base_Types::Float_64; - data14 : out parameter Base_Types::Float_64; - data15 : out parameter Base_Types::Float_64; - data16 : out parameter Base_Types::Float_64; -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_exarm_ni_6071e_analog_poller"; -end spg_poller; - - -thread thr_poller -features - data1 : out data port Base_Types::Float_64; - data2 : out data port Base_Types::Float_64; - data3 : out data port Base_Types::Float_64; - data4 : out data port Base_Types::Float_64; - data5 : out data port Base_Types::Float_64; - data6 : out data port Base_Types::Float_64; - data7 : out data port Base_Types::Float_64; - data8 : out data port Base_Types::Float_64; - data9 : out data port Base_Types::Float_64; - data10 : out data port Base_Types::Float_64; - data11 : out data port Base_Types::Float_64; - data12 : out data port Base_Types::Float_64; - data13 : out data port Base_Types::Float_64; - data14 : out data port Base_Types::Float_64; - data15 : out data port Base_Types::Float_64; - data16 : out data port Base_Types::Float_64; -end thr_poller; - -thread implementation thr_poller.i -calls - mycall : { - pspg : subprogram spg_poller; - }; -connections - parameter pspg.data1 -> data1; - parameter pspg.data2 -> data2; - parameter pspg.data3 -> data3; - parameter pspg.data4 -> data4; - parameter pspg.data5 -> data5; - parameter pspg.data6 -> data6; - parameter pspg.data7 -> data7; - parameter pspg.data8 -> data8; - parameter pspg.data9 -> data9; - parameter pspg.data10 -> data10; - parameter pspg.data11 -> data11; - parameter pspg.data12 -> data12; - parameter pspg.data13 -> data13; - parameter pspg.data14 -> data14; - parameter pspg.data15 -> data15; - parameter pspg.data16 -> data16; -properties - Period => 100 ms; - Dispatch_Protocol => Periodic; -end thr_poller.i; - - -abstract driver -features - data1 : out data port Base_Types::Float_64; - data2 : out data port Base_Types::Float_64; - data3 : out data port Base_Types::Float_64; - data4 : out data port Base_Types::Float_64; - data5 : out data port Base_Types::Float_64; - data6 : out data port Base_Types::Float_64; - data7 : out data port Base_Types::Float_64; - data8 : out data port Base_Types::Float_64; - data9 : out data port Base_Types::Float_64; - data10 : out data port Base_Types::Float_64; - data11 : out data port Base_Types::Float_64; - data12 : out data port Base_Types::Float_64; - data13 : out data port Base_Types::Float_64; - data14 : out data port Base_Types::Float_64; - data15 : out data port Base_Types::Float_64; - data16 : out data port Base_Types::Float_64; -end driver; - -abstract implementation driver.i -subcomponents - ni6071e_analog_poller : thread thr_poller.i; -connections - port ni6071e_analog_poller.data1 -> data1; - port ni6071e_analog_poller.data2 -> data2; - port ni6071e_analog_poller.data3 -> data3; - port ni6071e_analog_poller.data4 -> data4; - port ni6071e_analog_poller.data5 -> data5; - port ni6071e_analog_poller.data6 -> data6; - port ni6071e_analog_poller.data7 -> data7; - port ni6071e_analog_poller.data8 -> data8; - port ni6071e_analog_poller.data9 -> data9; - port ni6071e_analog_poller.data10 -> data10; - port ni6071e_analog_poller.data11 -> data11; - port ni6071e_analog_poller.data12 -> data12; - port ni6071e_analog_poller.data13 -> data13; - port ni6071e_analog_poller.data14 -> data14; - port ni6071e_analog_poller.data15 -> data15; - port ni6071e_analog_poller.data16 -> data16; -end driver.i; - -end ocarina_drivers_exarm_ni_6071e_analog; -package ocarina_drivers_exarm_ni_6071e_digital - -public - -with Base_Types; -with Deployment; - -subprogram spg_init -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_exarm_ni_6071e_digital_init"; -end spg_init; - - -subprogram spg_poller -features - data1 : out parameter Base_Types::Unsigned_32; - data2 : out parameter Base_Types::Unsigned_32; -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_exarm_ni_6071e_digital_poller"; -end spg_poller; - - -thread thr_poller -features - data1 : out data port Base_Types::Unsigned_32; - data2 : out data port Base_Types::Unsigned_32; -end thr_poller; - -thread implementation thr_poller.i -calls - mycall : { - pspg : subprogram spg_poller; - }; -connections - parameter pspg.data1 -> data1; - parameter pspg.data2 -> data2; -properties - Period => 100 ms; - Dispatch_Protocol => Periodic; -end thr_poller.i; - - -abstract driver -features - data1 : out data port Base_Types::Unsigned_32; - data2 : out data port Base_Types::Unsigned_32; -properties - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; -end driver; - -abstract implementation driver.i -subcomponents - ni6071e_digital_poller : thread thr_poller.i; -connections - port ni6071e_digital_poller.data1 -> data1; - port ni6071e_digital_poller.data2 -> data2; -end driver.i; - -end ocarina_drivers_exarm_ni_6071e_digital; -package ocarina_drivers_generic_keyboard - -public - -with Base_Types; -with Deployment; - -subprogram spg_generic_keyboard_init -properties - Source_Language => C; - Source_Name => "__po_hi_driver_generic_keyboard_init"; -end spg_generic_keyboard_init; - - -thread keyboard_poller -features - key_pressed : out data port Base_Types::Integer; -end keyboard_poller; - -thread implementation keyboard_poller.i -calls - mycall : { - pspg : subprogram spg_generic_keyboard_poller; - }; -connections - parameter pspg.key_pressed -> key_pressed; -properties - Period => 100ms; - Dispatch_Protocol => Periodic; -end keyboard_poller.i; - - -subprogram spg_generic_keyboard_poller -features - key_pressed : out parameter Base_Types::Integer; -properties - Source_Language => C; - Source_Name => "__po_hi_driver_generic_keyboard_poller"; -end spg_generic_keyboard_poller; - -abstract generic_keyboard_driver -features - key_pressed : out data port Base_Types::Integer; -properties - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; -end generic_keyboard_driver; - - -abstract implementation generic_keyboard_driver.i -subcomponents - keyboard_receiver : thread keyboard_poller.i; -connections - port keyboard_receiver.key_pressed -> key_pressed; -end generic_keyboard_driver.i; - - -end ocarina_drivers_generic_keyboard; -package Generic_Bus -public - - --------- - -- BUS -- - --------- - - -- Generic bus to model connections between processors and - -- devices. It is not used by the code generation process, so it is - -- made fully generic. - - bus Generic_Bus - end Generic_Bus; - - bus implementation Generic_Bus.impl - end Generic_Bus.impl; - -end Generic_Bus; -package Generic_Native - --- This package models a generic native platform with one generic bus. --- --- Native platforms are GNU/Linux variants, MacOS X, Solaris, Windows, --- ... - -public - with Deployment; - with Generic_Bus; - - --------------- - -- PROCESSOR -- - --------------- - - -- Generic_Processor is the basic description of a processor with - -- one bus to connect an ethernet adapter. This ethernet adapter is - -- used through the TCP_IP_Device defined in TCP_IP_Protocol - -- package. - - processor Generic_Processor - features - eth0_tcp_ip : requires bus access Generic_Bus::Generic_Bus.impl; - -- One ethernet card, connected to the processor. It is assumed - -- later that it is used through a TCP/IP stack - - end Generic_Processor; - - processor implementation Generic_Processor.impl - properties - Deployment::Execution_Platform => Native; - Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); - Priority_Range => 0 .. 255; - end Generic_Processor.impl; - - ------------ - -- MEMORY -- - ------------ - - memory Memory_Segment - end Memory_Segment; - - memory implementation Memory_Segment.impl - end Memory_Segment.impl; - -end Generic_Native; -package GR_CPCI_X4CV - --- This package models the GR-Rasta GR-CPCI-XC4V LEON Compact-PCI --- Development board by AEROFlex Gaisler. - -public - with Deployment; - with Generic_Bus; - - --------------- - -- PROCESSOR -- - --------------- - - -- The Rasta board has one LEON2 processor, 3 SpW cores and several - -- UARTS. - -- - -- SpaceWire cores and UARTS are connected to separate bus, of type - -- Generic_Bus.impl. - - processor LEON2 - features - spw_core_1 : requires bus access Generic_Bus::Generic_Bus.impl; - spw_core_2 : requires bus access Generic_Bus::Generic_Bus.impl; - spw_core_3 : requires bus access Generic_Bus::Generic_Bus.impl; - -- Three SpaceWire cores - - -- XXX Add UARTS - end LEON2; - - processor implementation LEON2.impl - properties - Deployment::Execution_Platform => LEON_ORK; -- for using GNATforLEON - - -- Information on the scheduler used by GNATforLEON - - Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); - Priority_Range => 0 .. 255; - end LEON2.impl; - - ------------ - -- MEMORY -- - ------------ - - memory Memory_Segment - end Memory_Segment; - - memory implementation Memory_Segment.impl - end Memory_Segment.impl; - -end GR_CPCI_X4CV; -package GRSPW - --- This package models a SpaceWire-based protocol layer for the --- PolyORB-HI/Ada AADL runtime, based on the GRSPW chipset from --- AEROFlex Gaisler. It defines the subprograms and threads to be --- integrated with the runtime low level interface. --- --- To configure this interface, you should use the --- Deployment::Configuration property with the following format: --- "spacewire Sender_Core_id Receiver_Core_Id" --- --- e.g. --- --- spw : device GRSPW::GRSPW_Device --- {Deployment::Configuration => "spacewire 1 2"}; --- - -public - - with Deployment; - with GR_CPCI_X4CV; - with Generic_Bus; - - ------------ - -- DEVICE -- - ------------ - - -- The main entrypoint for this package is this device, it relies - -- on the 'Implement_As' feature that defines its full - -- specification. - - device GRSPW_Device - features - LVDS_Wire : requires bus access Generic_Bus::Generic_Bus.impl; - -- Connection to the remote node - - end GRSPW_Device; - - device implementation GRSPW_Device.impl - properties - Implemented_As => - classifier (GRSPW::Driver_GRSPW_Protocol.impl); - Initialize_Entrypoint => classifier (GRSPW::Initialize); - end GRSPW_Device.impl; - - ------------ - -- DRIVER -- - ------------ - - -- In AADLv2, we can model the actual implementation of a driver - -- using an abstract component. - - abstract Driver_GRSPW_Protocol - properties - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; - Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_spacewire); - end Driver_GRSPW_Protocol; - - abstract implementation Driver_GRSPW_Protocol.impl - subcomponents - receiver : thread Driver_GRSPW_Protocol_thread_receiver.impl; - sender : subprogram Send; - end Driver_GRSPW_Protocol.impl; - - ------------- - -- THREADS -- - ------------- - - -- This thread handles the execution logic of the protocol - -- stack. It relies on the previous subprograms to receive - -- messages. - - thread Driver_GRSPW_Protocol_thread_receiver - - -- This thread is dispatched when an event is detected on the - -- real hardware. It then calls receive to handle the incoming - -- event. - - properties - Dispatch_Protocol => Background; - Priority => 12; - end Driver_GRSPW_Protocol_thread_receiver; - - thread implementation Driver_GRSPW_Protocol_thread_receiver.impl - calls - call1 : { pspg : subprogram receive; }; - end Driver_GRSPW_Protocol_thread_receiver.impl; - - ----------------- - -- SUBPROGRAMS -- - ----------------- - - -- These subprograms model the high-level view of the SpaceWire - -- protocol stack. They define an API used by the stack to send and - -- receive data, and perform node's initialisation. - - subprogram Initialize - - -- Initialize the different internal resources for managing - -- connections on a node. This subprogram has no formal visible - -- parameters, but relies on well-known data structures and - -- variables to configure the stack. - - properties - Source_Name => "PolyORB_HI_Drivers_GRSPW.Initialize"; - Source_Language => Ada; - end Initialize; - - ------------- - - subprogram Receive - - -- Receive data and dispatch them to the receiving entity. This - -- program and its sibling (send) share a common protocol, not - -- defined in the AADL model. - - properties - Source_Name => "PolyORB_HI_Drivers_GRSPW.Receive"; - Source_Language => Ada; - end Receive; - - ------------- - - subprogram Send - - -- Send data to a remote node. This program and its sibling - -- (receive) share a common protocol, not defined in the AADL - -- model. - - properties - Source_Name => "PolyORB_HI_Drivers_GRSPW.Send"; - Source_Language => Ada; - end Send; - -end GRSPW; -package GRUART - --- This package models a UART-based protocol layer for the --- PolyORB-HI/Ada AADL runtime, based on the GRUART chipset from --- AEROFlex Gaisler. It defines the subprograms and threads to be --- integrated with the runtime low level interface. --- --- To configure this interface, you should use the --- Deployment::Configuration property with the following format: --- "serial DEVICE BAUDS DATA_BITS PARITY STOP_BIT" --- --- e.g. --- --- uart : device GRUART::GRUART_Device --- {Deployment::Configuration => "serial /dev/ttyS0 9600 8 N 1" --- - -public - - with Deployment; - with GR_CPCI_X4CV; - with Generic_Bus; - - ------------ - -- DEVICE -- - ------------ - - -- The main entrypoint for this package is this device, it relies - -- on the 'Implement_As' feature that defines its full - -- specification. - - device GRUART_Device - features - DB9_Wire : requires bus access Generic_Bus::Generic_Bus.impl; - -- Connection to the remote node - - end GRUART_Device; - - device implementation GRUART_Device.impl - properties - Implemented_As => - classifier (GRUART::Driver_GRUART_Protocol.impl); - Initialize_Entrypoint => classifier (GRUART::Initialize); - end GRUART_Device.impl; - - ------------ - -- DRIVER -- - ------------ - - -- In AADLv2, we can model the actual implementation of a driver - -- using an abstract component. - - abstract Driver_GRUART_Protocol - properties - Deployment::Configuration_Type - => classifier (ocarina_drivers::configuration_type_serial); - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; - end Driver_GRUART_Protocol; - - abstract implementation Driver_GRUART_Protocol.impl - subcomponents - receiver : thread Driver_GRUART_Protocol_thread_receiver.impl; - sender : subprogram Send; - end Driver_GRUART_Protocol.impl; - - ------------- - -- THREADS -- - ------------- - - -- This thread handles the execution logic of the protocol - -- stack. It relies on the previous subprograms to receive - -- messages. - - thread Driver_GRUART_Protocol_thread_receiver - - -- This thread is dispatched when an event is detected on the - -- real hardware. It then calls receive to handle the incoming - -- event. - - properties - Dispatch_Protocol => Background; - Priority => 10; - source_stack_size => 200 KByte; - end Driver_GRUART_Protocol_thread_receiver; - - thread implementation Driver_GRUART_Protocol_thread_receiver.impl - calls - call1 : { pspg : subprogram receive; }; - end Driver_GRUART_Protocol_thread_receiver.impl; - - ----------------- - -- SUBPROGRAMS -- - ----------------- - - -- These subprograms model the high-level view of the SpaceWire - -- protocol stack. They define an API used by the stack to send and - -- receive data, and perform node's initialisation. - - subprogram Initialize - - -- Initialize the different internal resources for managing - -- connections on a node. This subprogram has no formal visible - -- parameters, but relies on well-known data structures and - -- variables to configure the stack. - - properties - Source_Name => "PolyORB_HI_Drivers_GRUART.Initialize"; - Source_Language => Ada; - end Initialize; - - ------------- - - subprogram Receive - - -- Receive data and dispatch them to the receiving entity. This - -- program and its sibling (send) share a common protocol, not - -- defined in the AADL model. - - properties - Source_Name => "PolyORB_HI_Drivers_GRUART.Receive"; - Source_Language => Ada; - end Receive; - - ------------- - - subprogram Send - - -- Send data to a remote node. This program and its sibling - -- (receive) share a common protocol, not defined in the AADL - -- model. - - properties - Source_Name => "PolyORB_HI_Drivers_GRUART.Send"; - Source_Language => Ada; - end Send; - -end GRUART; -package ocarina_drivers_leon_eth - -public - -with Deployment; -with ocarina_buses; -with ocarina_drivers; - -subprogram spg_leon_eth_poller -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_eth_leon_poller"; -end spg_leon_eth_poller; - - -subprogram spg_leon_eth_sender -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_eth_leon_sender"; -end spg_leon_eth_sender; - -subprogram spg_leon_eth_init -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_eth_leon_init"; -end spg_leon_eth_init; - -thread thr_poller -end thr_poller; - - -thread implementation thr_poller.i -calls - mycall : { - pspg : subprogram spg_leon_eth_poller; - }; -properties - Period => 1000ms; - Dispatch_Protocol => Periodic; -end thr_poller.i; - -abstract eth_driver -properties - Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_ip); - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; -end eth_driver; - -abstract implementation eth_driver.leon -subcomponents - sender : subprogram spg_leon_eth_sender; -end eth_driver.leon; - -abstract implementation eth_driver.leon_sender -subcomponents - sender : subprogram spg_leon_eth_sender; -end eth_driver.leon_sender; - - -end ocarina_drivers_leon_eth; -package ocarina_drivers_leon_serial - -public - -with Deployment; -with ocarina_buses; -with ocarina_drivers; - -subprogram spg_serial_poller_leon -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_leon_poller"; -end spg_serial_poller_leon; - - -subprogram spg_serial_sender_leon -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_leon_sender"; -end spg_serial_sender_leon; - -subprogram spg_serial_init_leon -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_leon_init"; -end spg_serial_init_leon; - -subprogram spg_serial_init_leon_sender -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_leon_init_sender"; -end spg_serial_init_leon_sender; - -thread serial_poller -end serial_poller; - - -thread implementation serial_poller.leon -calls - mycall : { - pspg : subprogram spg_serial_poller_leon; - }; -properties - Period => 1000ms; - Dispatch_Protocol => Periodic; -end serial_poller.leon; - -abstract serial_driver -properties - Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_serial); - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; -end serial_driver; - -abstract implementation serial_driver.leon -subcomponents - receiver_leon_serial : thread serial_poller.leon; - sender : subprogram spg_serial_sender_leon; -end serial_driver.leon; - -abstract implementation serial_driver.leon_sender -subcomponents - sender : subprogram spg_serial_sender_leon; -end serial_driver.leon_sender; - - -end ocarina_drivers_leon_serial; -package Native_UART - --- This package models a UART protocol layer for the PolyORB-HI/Ada --- AADL runtime. It defines the subprograms and threads to be --- integrated with the runtime low level interface. --- --- To configure this interface, you should use the --- Deployment::Configuration property with the following format: --- "serial DEVICE BAUDS DATA_BITS PARITY STOP_BIT" --- --- e.g. --- --- uart : device GRUART::GRUART_Device --- {Deployment::Configuration => "serial /dev/ttyS0 9600 8 N 1" --- - -public - - with Deployment; - with Generic_Bus; - - ------------ - -- DEVICE -- - ------------ - - -- The main entrypoint for this package is this device, it relies - -- on the 'Implement_As' feature that defines its full - -- specification. - - device Native_UART_Device - features - DB9_Wire : requires bus access Generic_Bus::Generic_Bus.impl; - -- Connection to the remote node - - end Native_UART_Device; - - device implementation Native_UART_Device.impl - properties - Implemented_As => - classifier (Native_UART::Driver_Native_UART_Protocol.impl); - Initialize_Entrypoint => classifier (Native_UART::Initialize); - end Native_UART_Device.impl; - - ------------ - -- DRIVER -- - ------------ - - -- In AADLv2, we can model the actual implementation of a driver - -- using an abstract component. - - abstract Driver_Native_UART_Protocol - properties - Deployment::Configuration_Type - => classifier (ocarina_drivers::configuration_type_serial); - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; - end Driver_Native_UART_Protocol; - - abstract implementation Driver_Native_UART_Protocol.impl - subcomponents - receiver : thread Driver_Native_UART_Protocol_thread_receiver.impl; - sender : subprogram Send; - end Driver_Native_UART_Protocol.impl; - - ------------- - -- THREADS -- - ------------- - - -- This thread handles the execution logic of the protocol - -- stack. It relies on the previous subprograms to receive - -- messages. - - thread Driver_Native_UART_Protocol_thread_receiver - - -- This thread is dispatched when an event is detected on the - -- real hardware. It then calls receive to handle the incoming - -- event. - - properties - Dispatch_Protocol => Background; - Priority => 10; - source_stack_size => 200 KByte; - end Driver_Native_UART_Protocol_thread_receiver; - - thread implementation Driver_Native_UART_Protocol_thread_receiver.impl - calls - call1 : { pspg : subprogram receive; }; - end Driver_Native_UART_Protocol_thread_receiver.impl; - - ----------------- - -- SUBPROGRAMS -- - ----------------- - - -- These subprograms model the high-level view of the SpaceWire - -- protocol stack. They define an API used by the stack to send and - -- receive data, and perform node's initialisation. - - subprogram Initialize - - -- Initialize the different internal resources for managing - -- connections on a node. This subprogram has no formal visible - -- parameters, but relies on well-known data structures and - -- variables to configure the stack. - - properties - Source_Name => "PolyORB_HI_Drivers_Native_UART.Initialize"; - Source_Language => Ada; - end Initialize; - - ------------- - - subprogram Receive - - -- Receive data and dispatch them to the receiving entity. This - -- program and its sibling (send) share a common protocol, not - -- defined in the AADL model. - - properties - Source_Name => "PolyORB_HI_Drivers_Native_UART.Receive"; - Source_Language => Ada; - end Receive; - - ------------- - - subprogram Send - - -- Send data to a remote node. This program and its sibling - -- (receive) share a common protocol, not defined in the AADL - -- model. - - properties - Source_Name => "PolyORB_HI_Drivers_Native_UART.Send"; - Source_Language => Ada; - end Send; - -end Native_UART; -package ocarina_drivers_rasta_1553 - -public -with Deployment; - -subprogram spg_1553_controller_rasta -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_1553_rasta_controller"; -end spg_1553_controller_rasta; - -subprogram spg_1553_poller_rasta_terminal -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_1553_rasta_terminal_poller"; -end spg_1553_poller_rasta_terminal; - -subprogram spg_1553_sender_rasta_controller -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_1553_rasta_sender_controller"; -end spg_1553_sender_rasta_controller; - -subprogram spg_1553_sender_rasta_terminal -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_1553_rasta_sender_terminal"; -end spg_1553_sender_rasta_terminal; - - -subprogram spg_1553_init_rasta_controller -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_1553_rasta_init_controller"; -end spg_1553_init_rasta_controller; - - -subprogram spg_1553_init_rasta_terminal -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_1553_rasta_init_terminal"; -end spg_1553_init_rasta_terminal; - - - -thread if1553_poller -end if1553_poller; - -thread implementation if1553_poller.rasta_terminal -calls - mycall : { - pspg : subprogram spg_1553_poller_rasta_terminal; - }; -properties - Period => 2000ms; - Dispatch_Protocol => Periodic; -end if1553_poller.rasta_terminal; - -thread if1553_controller -end if1553_controller; - -thread implementation if1553_controller.rasta -calls - mycall : { - pspg : subprogram spg_1553_controller_rasta; - }; -properties - Period => 4000ms; - Dispatch_Protocol => Periodic; -end if1553_controller.rasta; - - - -abstract if1553_driver -properties - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; -end if1553_driver; - -abstract implementation if1553_driver.rasta_terminal -subcomponents - receiver_rasta_1553 : thread if1553_poller.rasta_terminal; - sender : subprogram spg_1553_sender_rasta_terminal; -end if1553_driver.rasta_terminal; - -abstract implementation if1553_driver.rasta_controller_sender_only -subcomponents --- controller : thread if1553_controller.rasta; --- This thread (controller) should be a poller thread that --- gives orders to the terminal nodes to send/receive data. --- It should also specify the communication policy (when a terminal --- is authorized to send/receive data). - --- We don't specify poller and receiver since this controller --- is just a node that sends data to a single other node. - - sender : subprogram spg_1553_sender_rasta_controller; -end if1553_driver.rasta_controller_sender_only; - - -end ocarina_drivers_rasta_1553; -package ocarina_drivers_rasta_serial - -public - -with Deployment; -with ocarina_buses; -with ocarina_drivers; - -subprogram spg_serial_poller_rasta -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_rasta_poller"; -end spg_serial_poller_rasta; - - -subprogram spg_serial_sender_rasta -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_rasta_sender"; -end spg_serial_sender_rasta; - - - - -subprogram spg_serial_init_rasta -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_rasta_init"; -end spg_serial_init_rasta; - - -thread serial_poller -end serial_poller; - - -thread implementation serial_poller.rasta -calls - mycall : { - pspg : subprogram spg_serial_poller_rasta; - }; -properties - Period => 1000ms; - Dispatch_Protocol => Periodic; -end serial_poller.rasta; - -abstract serial_driver -properties - Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_serial); - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; -end serial_driver; - -abstract implementation serial_driver.rasta -subcomponents - receiver_rasta_serial : thread serial_poller.rasta; - sender : subprogram spg_serial_sender_rasta; -end serial_driver.rasta; - -end ocarina_drivers_rasta_serial; -package ocarina_drivers_rasta_spacewire - -public - -with ocarina_buses; -with Deployment; - -subprogram spg_spacewire_poller_rasta -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_spacewire_rasta_poller"; -end spg_spacewire_poller_rasta; - -subprogram spg_spacewire_sender_rasta -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_spacewire_rasta_sender"; -end spg_spacewire_sender_rasta; - -subprogram spg_spacewire_init_rasta -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_spacewire_rasta_init"; -end spg_spacewire_init_rasta; - - -thread spacewire_poller -end spacewire_poller; - -thread implementation spacewire_poller.rasta -calls - mycall : { - pspg : subprogram spg_spacewire_poller_rasta; - }; -properties - Period => 1000ms; - Dispatch_Protocol => Periodic; -end spacewire_poller.rasta; - - -abstract spacewire_driver -properties - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; - Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_spacewire); -end spacewire_driver; - -abstract implementation spacewire_driver.rasta -subcomponents - receiver_rasta_spacewire : thread spacewire_poller.rasta; - sender : subprogram spg_spacewire_sender_rasta; -end spacewire_driver.rasta; - -end ocarina_drivers_rasta_spacewire; -package ocarina_drivers_star_dundee_spacewire_brick -public - -with ocarina_buses; -with Deployment; - -subprogram spg_poller -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_spw_usb_brick_poller"; -end spg_poller; - -subprogram spg_sender -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_spw_usb_brick_sender"; -end spg_sender; - -subprogram spg_init -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_spw_usb_brick_init"; -end spg_init; - - -thread thr_poller -end thr_poller; - -thread implementation thr_poller.i -calls - mycall : { - pspg : subprogram spg_poller; - }; -properties - Period => 1000ms; - Dispatch_Protocol => Periodic; -end thr_poller.i; - - -abstract driver -properties - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; - Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_spacewire); -end driver; - -abstract implementation driver.usb_brick -subcomponents - receiver_rasta_spacewire : thread thr_poller.i; - sender : subprogram spg_sender; -end driver.usb_brick; - -end ocarina_drivers_star_dundee_spacewire_brick; -package ocarina_drivers_serial - -public - -with Deployment; -with ocarina_drivers; - -subprogram spg_serial_poller_linux -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_linux_poller"; -end spg_serial_poller_linux; - - -subprogram spg_serial_sender_linux -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_linux_sender"; -end spg_serial_sender_linux; - - -subprogram spg_serial_init_linux -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_linux_init"; -end spg_serial_init_linux; - -subprogram spg_serial_init_linux_sender -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_linux_init_sender"; -end spg_serial_init_linux_sender; - -subprogram spg_serial_init_linux_receiver -properties - Source_Language => C; - Source_Name => "__po_hi_c_driver_serial_linux_init_receiver"; -end spg_serial_init_linux_receiver; - -thread serial_poller -end serial_poller; - -thread implementation serial_poller.linux -calls - mycall : { - pspg : subprogram spg_serial_poller_linux; - }; -properties - Period => 1000ms; - Dispatch_Protocol => Periodic; -end serial_poller.linux; - - -abstract serial_driver -properties - Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_serial); - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; -end serial_driver; - -abstract implementation serial_driver.linux -subcomponents - serial_linux_receiver : thread serial_poller.linux; - sender : subprogram spg_serial_sender_linux; -end serial_driver.linux; - -abstract implementation serial_driver.linux_sender -subcomponents - sender : subprogram spg_serial_sender_linux; -end serial_driver.linux_sender; - - -abstract implementation serial_driver.linux_receiver -subcomponents - serial_linux_receiver : thread serial_poller.linux; -end serial_driver.linux_receiver; - -end ocarina_drivers_serial; -package ocarina_drivers_ip_pohic - -public -with Deployment; -with ocarina_drivers; - -subprogram spg_sockets_init -properties - Source_Language => C; - Source_Name => "__po_hi_driver_sockets_init"; -end spg_sockets_init; - - -subprogram spg_eth_linux_sender -properties - Source_Language => C; - Source_Name => "__po_hi_driver_sockets_send"; -end spg_eth_linux_sender; - -subprogram implementation spg_eth_linux_sender.i -end spg_eth_linux_sender.i; - -abstract sockets_impl -properties - Deployment::Configuration_Type => classifier (ocarina_drivers::configuration_type_ip); - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; -end sockets_impl; - -abstract implementation sockets_impl.i -subcomponents - sender : subprogram spg_eth_linux_sender.i; -end sockets_impl.i; - -end ocarina_drivers_ip_pohic; -package ocarina_drivers_rtems_ne2000 - -public - -with Deployment; - -subprogram init -properties - Source_Language => C; - Source_Name => "__po_hi_driver_rtems_ne2000_init"; -end init; - -thread poller -end poller; - -thread implementation poller.i -calls - mycall : { - pspg : subprogram spg_poller; - }; -properties - Period => 1000ms; - Dispatch_Protocol => Periodic; -end poller.i; - - -subprogram spg_poller -properties - Source_Language => C; - Source_Name => "__po_hi_driver_rtems_ne2000_poller"; -end spg_poller; - - -subprogram spg_sender -properties - Source_Language => C; - Source_Name => "__po_hi_driver_sockets_send"; -end spg_sender; - - -abstract driver -properties - Deployment::Version => "0.1beta"; - Deployment::Help => "Write your ASN.1 configuration here"; -end driver; - - -abstract implementation driver.i -subcomponents --- receiver : thread eth_sockets_ne2000_rtems_poller.i; - sender : subprogram spg_sender; -end driver.i; - -end ocarina_drivers_rtems_ne2000; -package TCP_IP_Protocol - --- This package models a TCP/IP based protocol layer for the --- PolyORB-HI/Ada AADL runtime. It defines the subprograms and threads --- to be integrated with the runtime low level interface. --- --- To configure this interface, you should use the --- Deployment::Configuration property with the following format: --- "ip " --- --- e.g. --- --- netif : device TCP_IP_Protocol::TCP_IP_Device --- {Deployment::Configuration => "ip 192.168.0.10 45678";}: - -public - - with Generic_Bus; - - ------------ - -- DEVICE -- - ------------ - - -- The main entrypoint for this package is this device, it relies - -- on the 'Implement_As' feature that defines its full - -- specification. - - device TCP_IP_Device - features - Ethernet_Wire : requires bus access Generic_Bus::Generic_Bus.impl; - -- Connection to the remote node - - end TCP_IP_Device; - - device implementation TCP_IP_Device.impl - properties - Implemented_As => - classifier (TCP_IP_Protocol::Driver_TCP_IP_Protocol.impl); - Initialize_Entrypoint => classifier (TCP_IP_Protocol::Initialize); - end TCP_IP_Device.impl; - - ------------ - -- DRIVER -- - ------------ - - -- In AADLv2, we can model the actual implementation of a driver - -- using an abstract component. - - abstract Driver_TCP_IP_Protocol - end Driver_TCP_IP_Protocol; - - abstract implementation Driver_TCP_IP_Protocol.impl - subcomponents - receiver : thread Driver_TCP_IP_Protocol_thread_receiver.impl; - sender : subprogram Send; - end Driver_TCP_IP_Protocol.impl; - - ------------- - -- THREADS -- - ------------- - - -- This thread handles the execution logic of the protocol - -- stack. It relies on the previous subprograms to receive - -- messages. - - thread Driver_TCP_IP_Protocol_thread_receiver - - -- This thread is dispatched when an event is detected on the - -- real hardware. It then calls receive to handle the incoming - -- event. - - properties - -- Initialize_Entrypoint - -- => classifier (TCP_IP_Protocol::Initialize_Receiver); - Dispatch_Protocol => Background; - end Driver_TCP_IP_Protocol_thread_receiver; - - thread implementation Driver_TCP_IP_Protocol_thread_receiver.impl - calls - call1 : { pspg : subprogram receive; }; - end Driver_TCP_IP_Protocol_thread_receiver.impl; - - ----------------- - -- SUBPROGRAMS -- - ----------------- - - -- These subprograms model the high-level view of the TCP/IP - -- protocol stack. They define an API used by the stack to send and - -- receive data, and perform node's initialisation. - - subprogram Initialize - - -- Initialize the different internal resources for managing - -- connections on a node. This subprogram has no formal visible - -- parameters, but relies on well-known data structures and - -- variables to configure the stack. - - properties - Source_Name => "POlyORB_HI_Drivers_Native_TCP_IP.Initialize"; - Source_Language => Ada; - end Initialize; - - ------------- - - subprogram Initialize_Receiver - - -- Initialize the receiver thread - - properties - Source_Name => "POlyORB_HI_Drivers_Native_TCP_IP.Initialize_Receiver"; - Source_Language => Ada; - end Initialize_Receiver; - - ------------- - - subprogram Receive - - -- Receive data and dispatch them to the receiving entity. This - -- program and its sibling (send) share a common protocol, not - -- defined in the AADL model. - - properties - Source_Name => "POlyORB_HI_Drivers_Native_TCP_IP.Receive"; - Source_Language => Ada; - end Receive; - - ------------- - - subprogram Send - - -- Send data to a remote node. This program and its sibling - -- (receive) share a common protocol, not defined in the AADL - -- model. - - properties - Source_Name => "POlyORB_HI_Drivers_Native_TCP_IP.Send"; - Source_Language => Ada; - end Send; - -end TCP_IP_Protocol; -package ocarina_drivers_udp_exarm - -public - -with Data_Model; -with Base_Types; - -data protocol -properties - Data_Model::Data_Representation => Struct; -end protocol; - -data implementation protocol.robot -subcomponents - cmd : data Base_Types::Unsigned_32; - pktid : data Base_Types::Unsigned_32; - X1 : data Base_Types::Float_32; - X2 : data Base_Types::Float_32; - X3 : data Base_Types::Float_32; - Y1 : data Base_Types::Float_32; - Y2 : data Base_Types::Float_32; - Y3 : data Base_Types::Float_32; - Z1 : data Base_Types::Float_32; - Z2 : data Base_Types::Float_32; - Z3 : data Base_Types::Float_32; - P1 : data Base_Types::Float_32; - P2 : data Base_Types::Float_32; - P3 : data Base_Types::Float_32; - J1 : data Base_Types::Float_32; - J2 : data Base_Types::Float_32; - J3 : data Base_Types::Float_32; - J4 : data Base_Types::Float_32; - J5 : data Base_Types::Float_32; - J6 : data Base_Types::Float_32; - J7 : data Base_Types::Float_32; - Elbow : data Base_Types::Float_32; -end protocol.robot; - - -data implementation protocol.vr -subcomponents - J1 : data Base_Types::Float_64; - J2 : data Base_Types::Float_64; - J3 : data Base_Types::Float_64; - J4 : data Base_Types::Float_64; - J5 : data Base_Types::Float_64; - J6 : data Base_Types::Float_64; - J7 : data Base_Types::Float_64; - J8 : data Base_Types::Float_64; - J9 : data Base_Types::Float_64; - J10 : data Base_Types::Float_64; - J11 : data Base_Types::Float_64; - J12 : data Base_Types::Float_64; - J13 : data Base_Types::Float_64; - J14 : data Base_Types::Float_64; - J15 : data Base_Types::Float_64; - J16 : data Base_Types::Float_64; - P1 : data Base_Types::Float_64; - P2 : data Base_Types::Float_64; - P3 : data Base_Types::Float_64; - X1 : data Base_Types::Float_64; - X2 : data Base_Types::Float_64; - X3 : data Base_Types::Float_64; - Y1 : data Base_Types::Float_64; - Y2 : data Base_Types::Float_64; - Y3 : data Base_Types::Float_64; - Z1 : data Base_Types::Float_64; - Z2 : data Base_Types::Float_64; - Z3 : data Base_Types::Float_64; -end protocol.vr; - - -subprogram init -properties - Source_Language => C; - Source_Name => "__po_hi_driver_exarm_init"; -end init; - -subprogram spg_sender -properties - Source_Language => C; - Source_Name => "__po_hi_driver_exarm_send"; -end spg_sender; - -abstract driver -end driver; - -abstract implementation driver.i -subcomponents - sender : subprogram spg_sender; -end driver.i; - -end ocarina_drivers_udp_exarm; -package ocarina_processors_arm - -public - -with Deployment; -with Cheddar_Properties; - -processor arm -end arm; - -processor nds extends arm -end nds; - -processor implementation nds.rtems -properties - Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); - Priority_Range => 0 .. 255; - Cheddar_Properties::Scheduler_Quantum => 0 Ms; - Cheddar_Properties::Preemptive_Scheduler => true; - Deployment::Execution_Platform => NDS_RTEMS; -end nds.rtems; - - -processor gumstix extends arm -end gumstix; - -processor implementation gumstix.rtems -properties - Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); - Priority_Range => 0 .. 255; - Cheddar_Properties::Scheduler_Quantum => 0 Ms; - Cheddar_Properties::Preemptive_Scheduler => true; - Deployment::Execution_Platform => GUMSTIX_RTEMS; -end gumstix.rtems; - -end ocarina_processors_arm; -package ocarina_processors_leon - -public - -with Deployment; -with ARINC653; -with Cheddar_Properties; - -processor leon -end leon; - -processor implementation leon.rtems -properties - Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); - Priority_Range => 0 .. 255; - Cheddar_Properties::Scheduler_Quantum => 0 Ms; - Cheddar_Properties::Preemptive_Scheduler => true; - Deployment::Execution_Platform => LEON_RTEMS; -end leon.rtems; - -processor implementation leon.rtems_posix -properties - Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); - Priority_Range => 0 .. 255; - Cheddar_Properties::Scheduler_Quantum => 0 Ms; - Cheddar_Properties::Preemptive_Scheduler => true; - Deployment::Execution_Platform => LEON_RTEMS_POSIX; -end leon.rtems_posix; - - -processor implementation leon.ork -properties - Deployment::Execution_Platform => LEON_ORK; -end leon.ork; - -processor leon3 -end leon3; - -virtual processor xtratum_partition -end xtratum_partition; - -virtual processor implementation xtratum_partition.generic -end xtratum_partition.generic; - -processor implementation leon3.xtratum -properties - Deployment::Execution_Platform => LEON3_XTRATUM; -end leon3.xtratum; - -processor implementation leon3.xtratum_2partitions extends leon3.xtratum -subcomponents - part1 : virtual processor xtratum_partition.generic - { Deployment::Execution_Platform => LEON3_XM3;}; - part2 : virtual processor xtratum_partition.generic - { Deployment::Execution_Platform => LEON3_XM3;}; -properties - ARINC653::Partition_Slots => (500ms, 500ms); - ARINC653::Slots_Allocation => (reference (part1), reference (part2)); - ARINC653::Module_Major_Frame => 1000ms; -end leon3.xtratum_2partitions; - -end ocarina_processors_leon; -package ocarina_processors_x86 - -public - -with Deployment; - -processor x86 -properties - Scheduling_Protocol => (RATE_MONOTONIC_PROTOCOL); - Deployment::Execution_Platform => Native; -end x86; - -processor implementation x86.linux -properties - Deployment::Execution_Platform => Native; -end x86.linux; - -processor implementation x86.linux_bench -properties - Scheduling_Protocol => (RATE_MONOTONIC_PROTOCOL); - Deployment::Execution_Platform => bench; -end x86.linux_bench; - -processor implementation x86.native -properties - Deployment::Execution_Platform => Linux32; -end x86.native; - -processor implementation x86.linux64 -properties - Deployment::Execution_Platform => Linux64; -end x86.linux64; - -processor implementation x86.native -properties - Deployment::Execution_Platform => Native; -end x86.native; - -processor implementation x86.native_compcert -properties - Deployment::Execution_Platform => Native_Compcert; -end x86.native_compcert; - -processor implementation x86.rtems -properties - Deployment::Execution_Platform => X86_RTEMS; -end x86.rtems; - -processor implementation x86.rtems_posix -properties - Deployment::Execution_Platform => X86_RTEMS_POSIX; -end x86.rtems_posix; - -processor implementation x86.xenomai_posix -properties - Deployment::Execution_Platform => linux32_xenomai_posix; -end x86.xenomai_posix; - -processor implementation x86.xenomai_native -properties - Deployment::Execution_Platform => linux32_xenomai_native; -end x86.xenomai_native; -end ocarina_processors_x86; diff --git a/Demo_Directives/InterfaceView.aadl b/Demo_Directives/InterfaceView.aadl index 3abe597db0a5d57c93fdf3ed04644dc127189f43..8fb53083f4ba8a9a74a8e5ff8c4eefe37f8342ec 100644 --- a/Demo_Directives/InterfaceView.aadl +++ b/Demo_Directives/InterfaceView.aadl @@ -1,133 +1,149 @@ -PACKAGE interfaceview::IV -PUBLIC -WITH DataView; -WITH interfaceview::FV; -WITH Taste; - --------------------------------------------------- --- TASTE Interface View +-- AADL2.1 +-- TASTE type interfaceview +-- +-- generated code: do not edit --------------------------------------------------- - SYSTEM interfaceview - END interfaceview; - - SYSTEM IMPLEMENTATION interfaceview.others - SUBCOMPONENTS - Function0: SYSTEM interfaceview::IV::Function0.others - { Taste::Coordinates => "841 257 2165 1411"; }; - Function1: SYSTEM interfaceview::IV::Function1.others - { Taste::Coordinates => "1166 1665 1986 2018"; }; - CONNECTIONS - obj356 : SUBPROGRAM ACCESS Function0.pop_obj87 -> Function1.obj243_obj120 - { Taste::Coordinates => "1280 1665 1280 1488.9 708.6 1488.9 708.6 997 841 997"; }; - END interfaceview.others; - - --------------------------------------------------- - -- TASTE Function: interfaceview::IV::Function0 - --------------------------------------------------- - - SYSTEM Function0 - FEATURES - plou_obj76 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::plou_obj76.others - { Taste::Coordinates => "841 468"; - Taste::RCMoperationKind => cyclic; - Taste::RCMperiod => 100 ms; - Taste::Deadline => 0 ms; - Taste::Importance => MEDIUM ;}; - pop_obj87 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::pop_obj87.others - { Taste::Coordinates => "841 997"; - Taste::RCMoperationKind => sporadic; - Taste::RCMperiod => 0 ms; - Taste::Deadline => 0 ms; - Taste::Importance => MEDIUM ;}; - PROPERTIES - Source_Language => C; - Taste::Instance_Name => "Function0"; - END Function0; - - SYSTEM IMPLEMENTATION Function0.others - SUBCOMPONENTS - hello_obj65 : DATA DataView::Taste_directive - { Taste::FS_Default_Value => "simulink-script:{filename ""world""}"; }; - plou_obj76_impl : SUBPROGRAM interfaceview::FV::plou_obj76.others - { Compute_Execution_Time => 0ms..0ms ;}; - pop_obj87_impl : SUBPROGRAM interfaceview::FV::pop_obj87.others - { Compute_Execution_Time => 0ms..0ms ;}; - CONNECTIONS - DATA ACCESS hello_obj65 -> plou_obj76_impl.hello_obj65; - SUBPROGRAM ACCESS plou_obj76_impl -> plou_obj76; - DATA ACCESS hello_obj65 -> pop_obj87_impl.hello_obj65; - SUBPROGRAM ACCESS pop_obj87_impl -> pop_obj87; - END Function0.others; - - --------------------------------------------------- - -- TASTE Function: interfaceview::IV::Function1 - --------------------------------------------------- - - SYSTEM Function1 - FEATURES - kok_obj109 : PROVIDES SUBPROGRAM ACCESS interfaceview::FV::kok_obj109.others - { Taste::Coordinates => "1986 1888"; - Taste::RCMoperationKind => cyclic; - Taste::RCMperiod => 0 ms; - Taste::Deadline => 0 ms; - Taste::Importance => MEDIUM ;}; - obj243_obj120 : REQUIRES SUBPROGRAM ACCESS interfaceview::FV::pop_obj87.others - { Taste::Coordinates => "1280 1665"; - Taste::RCMoperationKind => sporadic;}; - PROPERTIES - Source_Language => C; - Taste::Instance_Name => "Function0"; - END Function1; - - SYSTEM IMPLEMENTATION Function1.others - SUBCOMPONENTS - kok_obj109_impl : SUBPROGRAM interfaceview::FV::kok_obj109.others - { Compute_Execution_Time => 0ms..0ms ;}; - CONNECTIONS - SUBPROGRAM ACCESS kok_obj109_impl -> kok_obj109; - END Function1.others; +PACKAGE interfaceview::IV::Function0 +PUBLIC +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SUBPROGRAM PI_plou +PROPERTIES + Taste::Associated_Queue_Size => 1; +END PI_plou; +SUBPROGRAM IMPLEMENTATION PI_plou.others +PROPERTIES + Compute_Execution_Time => 0 ms .. 0 ms; +END PI_plou.others; + +SUBPROGRAM PI_pop +FEATURES + ddf : IN PARAMETER DataView::MyInteger { + Taste::encoding => NATIVE; + }; +PROPERTIES + Taste::Associated_Queue_Size => 1; +END PI_pop; +SUBPROGRAM IMPLEMENTATION PI_pop.others PROPERTIES - Taste::Coordinates => "0 0 2970 2100"; - Taste::dataView => ("DataView","DataView"); - Taste::dataViewPath => ("DataView.aadl"); + Compute_Execution_Time => 0 ms .. 0 ms; +END PI_pop.others; + +SYSTEM Function0 +FEATURES + PI_plou : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function0::PI_plou.others { + Taste::coordinates => "841 468"; + Taste::RCMoperationKind => cyclic; + Taste::RCMperiod => 100 ms; + Taste::Deadline => 0 ms; + Taste::InterfaceName => "plou"; + }; + PI_pop : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function0::PI_pop.others { + Taste::coordinates => "841 997"; + Taste::RCMoperationKind => sporadic; + Taste::RCMperiod => 0 ms; + Taste::Deadline => 0 ms; + Taste::InterfaceName => "pop"; + }; +PROPERTIES + Source_Language => (C); + Taste::Active_Interfaces => enabled; +END Function0; -END interfaceview::IV; +SYSTEM IMPLEMENTATION Function0.others +SUBCOMPONENTS + hello : DATA DataView::Taste_directive { + Taste::FS_Default_Value => "simulink-script:{filename ""world""}"; + }; +END Function0.others; + +END interfaceview::IV::Function0; -PACKAGE interfaceview::FV +PACKAGE interfaceview::IV::Function1 PUBLIC +WITH interfaceview::IV::Function0; +WITH Taste; WITH DataView; -WITH TASTE; - - SUBPROGRAM plou_obj76 - FEATURES - hello_obj65 : REQUIRES DATA ACCESS DataView::Taste_directive; - END plou_obj76; +WITH TASTE_IV_Properties; +SUBPROGRAM PI_kok +END PI_kok; - SUBPROGRAM IMPLEMENTATION plou_obj76.others - END plou_obj76.others; +SUBPROGRAM IMPLEMENTATION PI_kok.others +PROPERTIES + Compute_Execution_Time => 0 ms .. 0 ms; +END PI_kok.others; + +SUBPROGRAM RI_pop +FEATURES + ddf : IN PARAMETER DataView::MyInteger { + Taste::encoding => NATIVE; + }; +END RI_pop; + +SUBPROGRAM IMPLEMENTATION RI_pop.others +END RI_pop.others; + +SYSTEM Function1 +FEATURES + PI_kok : PROVIDES SUBPROGRAM ACCESS interfaceview::IV::Function1::PI_kok.others { + Taste::coordinates => "1986 1888"; + Taste::RCMoperationKind => cyclic; + Taste::RCMperiod => 200 ms; + Taste::Deadline => 0 ms; + Taste::InterfaceName => "kok"; + }; + RI_pop : REQUIRES SUBPROGRAM ACCESS interfaceview::IV::Function0::PI_pop.others { + Taste::coordinates => "1280 1665"; + Taste::RCMoperationKind => sporadic; + Taste::InterfaceName => "pop"; + Taste::labelInheritance => "true"; + }; +PROPERTIES + Source_Language => (C); + Taste::Active_Interfaces => enabled; +END Function1; - SUBPROGRAM pop_obj87 - FEATURES - ddf : in PARAMETER DataView::MyInteger - { Taste::encoding => NATIVE; }; - hello_obj65 : REQUIRES DATA ACCESS DataView::Taste_directive; - PROPERTIES - Taste::Associated_Queue_Size => 1; - END pop_obj87; +SYSTEM IMPLEMENTATION Function1.others +END Function1.others; - SUBPROGRAM IMPLEMENTATION pop_obj87.others - END pop_obj87.others; +END interfaceview::IV::Function1; - SUBPROGRAM kok_obj109 - END kok_obj109; +PACKAGE interfaceview::IV +PUBLIC - SUBPROGRAM IMPLEMENTATION kok_obj109.others - END kok_obj109.others; +WITH interfaceview::IV::Function0; +WITH interfaceview::IV::Function1; +WITH Taste; +WITH DataView; +WITH TASTE_IV_Properties; +SYSTEM interfaceview +END interfaceview; + +SYSTEM IMPLEMENTATION interfaceview.others +SUBCOMPONENTS + Function0 : SYSTEM interfaceview::IV::Function0::Function0.others { + Taste::coordinates => "841 257 2165 1411"; + }; + Function1 : SYSTEM interfaceview::IV::Function1::Function1.others { + Taste::coordinates => "1166 1665 1986 2018"; + }; +CONNECTIONS + Function0_PI_pop_Function1_RI_pop : SUBPROGRAM ACCESS Function0.PI_pop -> Function1.RI_pop { + Taste::coordinates => "1280 1665 1280 1488.9 708.6 1488.9 708.6 997 841 997"; + }; +END interfaceview.others; -END interfaceview::FV; +PROPERTIES + Taste::dataView => ("DataView"); + Taste::dataViewPath => ("DataView.aadl"); + Taste::coordinates => "0 0 2970 2100"; + Taste::version => "2.0"; +END interfaceview::IV; diff --git a/Demo_Directives/build-script.sh b/Demo_Directives/build-script.sh index 670b965723b606c8fd94cdb0cf0af14badb65add..2a972cec70d3f29efbf760526b5e47e163de0c82 100755 --- a/Demo_Directives/build-script.sh +++ b/Demo_Directives/build-script.sh @@ -1,34 +1,117 @@ -#!/bin/bash +#!/bin/bash -e # This script will build your TASTE system. -# You must check it before running it: it may need to be adapted to your context: -# 1) You may need to fix some paths and filenames (path to interface/deployment views) -# 2) You may need to specify additional paths for the compiler to find .h file -# (e.g. "export C_INCLUDE_PATH=/usr/include/xenomai/analogy/:$C_INCLUDE_PATH") -# 3) You may need to link with pre-built libraries, using the -l option -# (e.g. -l /usr/lib/libanalogy.a,/usr/lib/librtdm.a) -# 4) You may need to change the runtime (add -p flag to select PolyORB-HI-C) -# etc. - -# Note: TASTE will not overwrite your changes - if you need to update some parts -# you will have to merge the changes with the newly-created "build-script.new.sh" file. - -taste-update-data-view || exit 1 - -rm -f function0.zip -zip function0 function0/* -rm -f function1.zip -zip function1 function1/* -[ ! -z "$CLEANUP" ] && rm -rf binary - -echo Building the system with the Ada runtime -assert-builder-ocarina.py \ - -f \ +# You should not change this file as it was automatically generated. + +# If you need additional preprocessing, there are three hook files +# that you can provide and that are called dring the build: +# user_init_pre.sh, user_init_post.sh and user_init_last.sh +# These files will never get overwritten by TASTE.' + +# Inside these files you may set some environment variables: +# C_INCLUDE_PATH=/usr/include/xenomai/analogy/:${C_INCLUDE_PATH} +# unset USE_POHIC + +CWD=$(pwd) + +if [ -t 1 ] ; then + COLORON="\e[1m\e[32m" + COLOROFF="\e[0m" +else + COLORON="" + COLOROFF="" +fi +INFO="${COLORON}[INFO]${COLOROFF}" + +if [ -f user_init_pre.sh ] +then + echo -e "${INFO} Executing user-defined init script" + source user_init_pre.sh +fi + +# Use PolyORB-HI-C runtime +USE_POHIC=1 + +# Set Debug mode by default +DEBUG_MODE=--debug + +# Detect models from Ellidiss tools v2, and convert them to 1.3 +INTERFACEVIEW=InterfaceView.aadl +grep "version => \"2" InterfaceView.aadl >/dev/null && { + echo -e "${INFO} Converting interface view from V2 to V1.3" + TASTE --load-interface-view InterfaceView.aadl --export-interface-view-to-1_3 __iv_1_3.aadl + INTERFACEVIEW=__iv_1_3.aadl +}; + +if [ -z "$DEPLOYMENTVIEW" ] +then + DEPLOYMENTVIEW=DeploymentView.aadl +fi + +# Detect models from Ellidiss tools v2, and convert them to 1.3 +grep "version => \"2" "$DEPLOYMENTVIEW" >/dev/null && { + echo -e "${INFO} Converting deployment view from V2 to V1.3" + TASTE --load-deployment-view "$DEPLOYMENTVIEW" --export-deployment-view-to-1_3 __dv_1_3.aadl + DEPLOYMENTVIEW=__dv_1_3.aadl +}; + +SKELS="./" + +# Check if Dataview references existing files +mono $(which taste-extract-asn-from-design.exe) -i "$INTERFACEVIEW" -j /tmp/dv.asn + +cd "$SKELS" && rm -f function0.zip && zip function0 function0/* && cd $OLDPWD + +cd "$SKELS" && rm -f function1.zip && zip function1 function1/* && cd $OLDPWD + +[ ! -z "$CLEANUP" ] && rm -rf binary* + +if [ -f ConcurrencyView.pro ] +then + ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView.pro " +elif [ -f ConcurrencyView_Properties.aadl ] +then + ORCHESTRATOR_OPTIONS+=" -w ConcurrencyView_Properties.aadl " +fi + +if [ -f user_init_post.sh ] +then + echo -e "${INFO} Executing user-defined post-init script" + source user_init_post.sh +fi + +if [ -f additionalCommands.sh ] +then + source additionalCommands.sh +fi + +if [ ! -z "$USE_POHIC" ] +then + OUTPUTDIR=binary.c + ORCHESTRATOR_OPTIONS+=" -p " +elif [ ! -z "$USE_POHIADA" ] +then + OUTPUTDIR=binary.ada +else + OUTPUTDIR=binary +fi + +cd "$CWD" && assert-builder-ocarina.py \ + --fast \ + $DEBUG_MODE \ --aadlv2 \ --keep-case \ - --interfaceView InterfaceView.aadl \ - --deploymentView DeploymentView.aadl \ - -o binary \ - --subC function0:function0.zip \ - --subC function1:function1.zip + --interfaceView "$INTERFACEVIEW" \ + --deploymentView "$DEPLOYMENTVIEW" \ + -o "$OUTPUTDIR" \ + --subC function0:"$SKELS"/function0.zip \ + --subC function1:"$SKELS"/function1.zip \ + $ORCHESTRATOR_OPTIONS + +if [ -f user_init_last.sh ] +then + echo -e "${INFO} Executing user-defined post-build script" + source user_init_last.sh +fi + diff --git a/Demo_Directives/function0/function0.c b/Demo_Directives/function0/function0.c index 5c9d3dfcaf3ce08827d6be5931b8cbc1cc50cd90..a09803e994faa23779533120da092f717b19971c 100644 --- a/Demo_Directives/function0/function0.c +++ b/Demo_Directives/function0/function0.c @@ -1,20 +1,22 @@ /* Functions to be filled by the user (never overwritten by buildsupport tool) */ #include "function0.h" - +#include void function0_startup() { + printf("Function0 startup\n"); /* Write your initialization code here, but do not make any call to a required interface!! */ } void function0_PI_plou() { + printf("Function0 periodic\n"); /* Write your code here! */ } void function0_PI_pop(const asn1SccMyInteger *IN_ddf) { - /* Write your code here! */ + printf("Function0 got value from function1 : %lld\n", *IN_ddf); } diff --git a/Demo_Directives/function0/function0.h b/Demo_Directives/function0/function0.h index 372e7a22d729dd51ed8caacf5806441fc81fd33b..80a8acaf67e11bb3916243b991860f326d3eb5f6 100644 --- a/Demo_Directives/function0/function0.h +++ b/Demo_Directives/function0/function0.h @@ -7,11 +7,19 @@ #include "C_ASN1_Types.h" +#ifdef __cplusplus +extern "C" { +#endif + void function0_startup(); void function0_PI_plou(); void function0_PI_pop(const asn1SccMyInteger *); +#ifdef __cplusplus +} +#endif + #endif diff --git a/Demo_Directives/function1/dataview/asn1crt.h b/Demo_Directives/function1/dataview/asn1crt.h index cf05bd76440fb8f6b49a03bd586bfcf6b7417edd..1d7975f971f61bc01c70e763c10ec73398454123 100644 --- a/Demo_Directives/function1/dataview/asn1crt.h +++ b/Demo_Directives/function1/dataview/asn1crt.h @@ -1,6 +1,15 @@ -#ifndef _INC_PER_UTIL_H -#define _INC_PER_UTIL_H +#ifndef ASN1SCC_ASN1CRT_H_ +#define ASN1SCC_ASN1CRT_H_ +#if (!defined(_MSC_VER) || _MSC_VER >= 1800) +# ifndef SWIG +# include +# endif +#else +typedef unsigned char bool; +#define true 1 +#define false 0 +#endif #ifdef __cplusplus extern "C" { @@ -10,34 +19,45 @@ extern "C" { #define NULL 0 #endif -#define TRUE 1 -#define FALSE 0 - +#ifndef TRUE +#define TRUE true +#endif +#ifndef FALSE +#define FALSE false +#endif #ifndef WORD_SIZE #define WORD_SIZE 8 #endif -typedef long asn1SccSint32; -typedef unsigned long asn1SccUint32; -typedef unsigned char byte; +typedef int asn1SccSint32; +typedef unsigned int asn1SccUint32; +typedef unsigned char byte; -#if WORD_SIZE==8 typedef long long asn1SccSint64; typedef unsigned long long asn1SccUint64; + +#if WORD_SIZE==8 typedef asn1SccUint64 asn1SccUint; typedef asn1SccSint64 asn1SccSint; #else typedef asn1SccUint32 asn1SccUint; typedef asn1SccSint32 asn1SccSint; - #endif +#ifdef _MSC_VER +# ifndef INFINITY +# define INFINITY (DBL_MAX+DBL_MAX) +# endif +# ifndef NAN +# define NAN (INFINITY-INFINITY) +# endif +#endif -typedef int flag; +typedef bool flag; typedef char NullType; @@ -53,6 +73,7 @@ typedef struct { byte* buf; long count; long currentByte; + flag EncodeWhiteSpace; } ByteStream; typedef struct { @@ -74,6 +95,7 @@ typedef struct { #define ERR_INSUFFICIENT_DATA 101 #define ERR_INCORRECT_PER_STREAM 102 #define ERR_INVALID_CHOICE_ALTERNATIVE 103 +#define ERR_INVALID_ENUM_VALUE 104 #define ERR_INVALID_XML_FILE 200 #define ERR_INVALID_BER_FILE 201 #define ERR_BER_LENGTH_MISMATCH 202 @@ -104,12 +126,15 @@ flag BitStream_ReadByte(BitStream* pBitStrm, byte* v); void BitStream_EncodeUnConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint v); void BitStream_EncodeSemiConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint v, asn1SccSint min); +void BitStream_EncodeSemiConstraintPosWholeNumber(BitStream* pBitStrm, asn1SccUint v, asn1SccUint min); void BitStream_EncodeConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint v, asn1SccSint min, asn1SccSint max); +void BitStream_EncodeConstraintPosWholeNumber(BitStream* pBitStrm, asn1SccUint v, asn1SccUint min, asn1SccUint max); flag BitStream_DecodeUnConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint* v); flag BitStream_DecodeSemiConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint* v, asn1SccSint min); +flag BitStream_DecodeSemiConstraintPosWholeNumber(BitStream* pBitStrm, asn1SccUint* v, asn1SccUint min); flag BitStream_DecodeConstraintWholeNumber(BitStream* pBitStrm, asn1SccSint* v, asn1SccSint min, asn1SccSint max); - +flag BitStream_DecodeConstraintPosWholeNumber(BitStream* pBitStrm, asn1SccUint* v, asn1SccUint min, asn1SccUint max); @@ -120,7 +145,7 @@ flag BitStream_DecodeReal(BitStream* pBitStrm, double* v); -void CalculateMantissaAndExponent(double d, int* exp, asn1SccUint* mantissa); +void CalculateMantissaAndExponent(double d, int* exp, asn1SccUint64* mantissa); double GetDoubleByMantissaAndExp(asn1SccUint mantissa, int exp); int GetNumberOfBitsForNonNegativeInteger(asn1SccUint v); @@ -145,15 +170,15 @@ void Acn_AlignToNextWord(BitStream* pBitStrm); void Acn_AlignToNextDWord(BitStream* pBitStrm); /*ACN Integer functions*/ -void Acn_Enc_Int_PositiveInteger_ConstSize(BitStream* pBitStrm, asn1SccSint intVal, int encodedSizeInBits); -void Acn_Enc_Int_PositiveInteger_ConstSize_8(BitStream* pBitStrm, asn1SccSint intVal); -void Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_16(BitStream* pBitStrm, asn1SccSint intVal); -void Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_32(BitStream* pBitStrm, asn1SccSint intVal); -void Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_64(BitStream* pBitStrm, asn1SccSint intVal); -void Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_16(BitStream* pBitStrm, asn1SccSint intVal); -void Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_32(BitStream* pBitStrm, asn1SccSint intVal); -void Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_64(BitStream* pBitStrm, asn1SccSint intVal); -void Acn_Enc_Int_PositiveInteger_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint intVal); +void Acn_Enc_Int_PositiveInteger_ConstSize(BitStream* pBitStrm, asn1SccUint intVal, int encodedSizeInBits); +void Acn_Enc_Int_PositiveInteger_ConstSize_8(BitStream* pBitStrm, asn1SccUint intVal); +void Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_16(BitStream* pBitStrm, asn1SccUint intVal); +void Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_32(BitStream* pBitStrm, asn1SccUint intVal); +void Acn_Enc_Int_PositiveInteger_ConstSize_big_endian_64(BitStream* pBitStrm, asn1SccUint intVal); +void Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_16(BitStream* pBitStrm, asn1SccUint intVal); +void Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_32(BitStream* pBitStrm, asn1SccUint intVal); +void Acn_Enc_Int_PositiveInteger_ConstSize_little_endian_64(BitStream* pBitStrm, asn1SccUint intVal); +void Acn_Enc_Int_PositiveInteger_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint intVal); void Acn_Enc_Int_TwosComplement_ConstSize(BitStream* pBitStrm, asn1SccSint intVal, int encodedSizeInBits); void Acn_Enc_Int_TwosComplement_ConstSize_8(BitStream* pBitStrm, asn1SccSint intVal); @@ -165,26 +190,29 @@ void Acn_Enc_Int_TwosComplement_ConstSize_little_endian_32(BitStream* pBitStrm, void Acn_Enc_Int_TwosComplement_ConstSize_little_endian_64(BitStream* pBitStrm, asn1SccSint intVal); void Acn_Enc_Int_TwosComplement_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint intVal); -void Acn_Enc_Int_BCD_ConstSize(BitStream* pBitStrm, asn1SccSint intVal, int encodedSizeInNibbles); -void Acn_Enc_Int_BCD_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint intVal); -void Acn_Enc_Int_BCD_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccSint intVal); //encoding ends when 'F' is reached +void Acn_Enc_Int_BCD_ConstSize(BitStream* pBitStrm, asn1SccUint intVal, int encodedSizeInNibbles); +void Acn_Enc_Int_BCD_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint intVal); +void Acn_Enc_Int_BCD_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccUint intVal); /*encoding ends when 'F' is reached*/ -void Acn_Enc_Int_ASCII_ConstSize(BitStream* pBitStrm, asn1SccSint intVal, int encodedSizeInBytes); -void Acn_Enc_Int_ASCII_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint intVal); -void Acn_Enc_Int_ASCII_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccSint intVal); //encoding ends when 0x0 is reached +void Acn_Enc_SInt_ASCII_ConstSize(BitStream* pBitStrm, asn1SccSint intVal, int encodedSizeInBytes); +void Acn_Enc_SInt_ASCII_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint intVal); +void Acn_Enc_SInt_ASCII_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccSint intVal); /*encoding ends when 0x0 is reached*/ +void Acn_Enc_UInt_ASCII_ConstSize(BitStream* pBitStrm, asn1SccUint intVal, int encodedSizeInBytes); +void Acn_Enc_UInt_ASCII_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint intVal); +void Acn_Enc_UInt_ASCII_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccUint intVal); /*encoding ends when 0x0 is reached*/ /*ACN Decode Integer functions*/ -flag Acn_Dec_Int_PositiveInteger_ConstSize(BitStream* pBitStrm, asn1SccSint* pIntVal, int encodedSizeInBits); -flag Acn_Dec_Int_PositiveInteger_ConstSize_8(BitStream* pBitStrm, asn1SccSint* pIntVal); -flag Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_16(BitStream* pBitStrm, asn1SccSint* pIntVal); -flag Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_32(BitStream* pBitStrm, asn1SccSint* pIntVal); -flag Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_64(BitStream* pBitStrm, asn1SccSint* pIntVal); -flag Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_16(BitStream* pBitStrm, asn1SccSint* pIntVal); -flag Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_32(BitStream* pBitStrm, asn1SccSint* pIntVal); -flag Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_64(BitStream* pBitStrm, asn1SccSint* pIntVal); -flag Acn_Dec_Int_PositiveInteger_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint* pIntVal); +flag Acn_Dec_Int_PositiveInteger_ConstSize(BitStream* pBitStrm, asn1SccUint* pIntVal, int encodedSizeInBits); +flag Acn_Dec_Int_PositiveInteger_ConstSize_8(BitStream* pBitStrm, asn1SccUint* pIntVal); +flag Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_16(BitStream* pBitStrm, asn1SccUint* pIntVal); +flag Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_32(BitStream* pBitStrm, asn1SccUint* pIntVal); +flag Acn_Dec_Int_PositiveInteger_ConstSize_big_endian_64(BitStream* pBitStrm, asn1SccUint* pIntVal); +flag Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_16(BitStream* pBitStrm, asn1SccUint* pIntVal); +flag Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_32(BitStream* pBitStrm, asn1SccUint* pIntVal); +flag Acn_Dec_Int_PositiveInteger_ConstSize_little_endian_64(BitStream* pBitStrm, asn1SccUint* pIntVal); +flag Acn_Dec_Int_PositiveInteger_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint* pIntVal); flag Acn_Dec_Int_TwosComplement_ConstSize(BitStream* pBitStrm, asn1SccSint* pIntVal, int encodedSizeInBits); flag Acn_Dec_Int_TwosComplement_ConstSize_8(BitStream* pBitStrm, asn1SccSint* pIntVal); @@ -196,15 +224,20 @@ flag Acn_Dec_Int_TwosComplement_ConstSize_little_endian_32(BitStream* pBitStrm, flag Acn_Dec_Int_TwosComplement_ConstSize_little_endian_64(BitStream* pBitStrm, asn1SccSint* pIntVal); flag Acn_Dec_Int_TwosComplement_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint* pIntVal); -flag Acn_Dec_Int_BCD_ConstSize(BitStream* pBitStrm, asn1SccSint* pIntVal, int encodedSizeInNibbles); -flag Acn_Dec_Int_BCD_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint* pIntVal); -//encoding ends when 'F' is reached -flag Acn_Dec_Int_BCD_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccSint* pIntVal); +flag Acn_Dec_Int_BCD_ConstSize(BitStream* pBitStrm, asn1SccUint* pIntVal, int encodedSizeInNibbles); +flag Acn_Dec_Int_BCD_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint* pIntVal); +/*encoding ends when 'F' is reached*/ +flag Acn_Dec_Int_BCD_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccUint* pIntVal); + +flag Acn_Dec_SInt_ASCII_ConstSize(BitStream* pBitStrm, asn1SccSint* pIntVal, int encodedSizeInBytes); +flag Acn_Dec_SInt_ASCII_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint* pIntVal); +flag Acn_Dec_SInt_ASCII_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccSint* pIntVal); -flag Acn_Dec_Int_ASCII_ConstSize(BitStream* pBitStrm, asn1SccSint* pIntVal, int encodedSizeInBytes); -flag Acn_Dec_Int_ASCII_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccSint* pIntVal); -flag Acn_Dec_Int_ASCII_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccSint* pIntVal); -//flag Acn_Dec_Int_ASCII_NullTerminated_FormattedInteger(BitStream* pBitStrm, const char* format, asn1SccSint* pIntVal); +flag Acn_Dec_UInt_ASCII_ConstSize(BitStream* pBitStrm, asn1SccUint* pIntVal, int encodedSizeInBytes); +flag Acn_Dec_UInt_ASCII_VarSize_LengthEmbedded(BitStream* pBitStrm, asn1SccUint* pIntVal); +flag Acn_Dec_UInt_ASCII_VarSize_NullTerminated(BitStream* pBitStrm, asn1SccUint* pIntVal); + +/*flag Acn_Dec_Int_ASCII_NullTerminated_FormattedInteger(BitStream* pBitStrm, const char* format, asn1SccSint* pIntVal);*/ /* Boolean Decode */ @@ -222,11 +255,30 @@ flag Acn_Dec_Real_IEEE754_64_big_endian(BitStream* pBitStrm, double* pRealValue) flag Acn_Dec_Real_IEEE754_32_little_endian(BitStream* pBitStrm, double* pRealValue); flag Acn_Dec_Real_IEEE754_64_little_endian(BitStream* pBitStrm, double* pRealValue); +/*String functions*/ +void Acn_Enc_String_Ascii_FixSize (BitStream* pBitStrm, asn1SccSint max, const char* strVal); +void Acn_Enc_String_Ascii_Null_Teminated (BitStream* pBitStrm, asn1SccSint max, char null_character, const char* strVal); +void Acn_Enc_String_Ascii_External_Field_Determinant (BitStream* pBitStrm, asn1SccSint max, const char* strVal); +void Acn_Enc_String_Ascii_Internal_Field_Determinant (BitStream* pBitStrm, asn1SccSint max, asn1SccSint min, const char* strVal); +void Acn_Enc_String_CharIndex_FixSize (BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, const char* strVal); +void Acn_Enc_String_CharIndex_External_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, const char* strVal); +void Acn_Enc_String_CharIndex_Internal_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, asn1SccSint min, const char* strVal); + +flag Acn_Dec_String_Ascii_FixSize (BitStream* pBitStrm, asn1SccSint max, char* strVal); +flag Acn_Dec_String_Ascii_Null_Teminated (BitStream* pBitStrm, asn1SccSint max, char null_character, char* strVal); +flag Acn_Dec_String_Ascii_External_Field_Determinant (BitStream* pBitStrm, asn1SccSint max, asn1SccSint extSizeDeterminatFld, char* strVal); +flag Acn_Dec_String_Ascii_Internal_Field_Determinant (BitStream* pBitStrm, asn1SccSint max, asn1SccSint min, char* strVal); +flag Acn_Dec_String_CharIndex_FixSize (BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, char* strVal); +flag Acn_Dec_String_CharIndex_External_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, asn1SccSint extSizeDeterminatFld, char* strVal); +flag Acn_Dec_String_CharIndex_Internal_Field_Determinant(BitStream* pBitStrm, asn1SccSint max, byte allowedCharSet[], int charSetSize, asn1SccSint min, char* strVal); + + + /* Length Determinant functions*/ -void Acn_Enc_Length(BitStream* pBitStrm, asn1SccSint lengthValue, int lengthSizeInBits); +void Acn_Enc_Length(BitStream* pBitStrm, asn1SccUint lengthValue, int lengthSizeInBits); -flag Acn_Dec_Length(BitStream* pBitStrm, asn1SccSint* pLengthValue, int lengthSizeInBits); +flag Acn_Dec_Length(BitStream* pBitStrm, asn1SccUint* pLengthValue, int lengthSizeInBits); @@ -239,6 +291,9 @@ flag BitStream_ReadPartialByte(BitStream* pBitStrm, byte *v, byte nbits); void BitStream_AppendPartialByte(BitStream* pBitStrm, byte v, byte nbits, flag negate); + + + void Xer_EncodeXmlHeader(ByteStream* pByteStrm, const char* xmlHeader); flag Xer_EncodeComment(ByteStream* pByteStrm, const char* comment, int *pErrCode); @@ -266,6 +321,7 @@ flag Xer_DecodeComplexElementEnd(ByteStream* pByteStrm, const char* elementTag, flag Xer_NextEndElementIs(ByteStream* pByteStrm, const char* elementTag); flag Xer_NextStartElementIs(ByteStream* pByteStrm, const char* elementTag); flag Xer_LA_NextElementTag(ByteStream* pByteStrm, char* elementTag); +flag LoadXmlFile(const char* fileName, ByteStream* pStrm, int* nBytesLoaded); @@ -312,8 +368,19 @@ flag NextTagMatches(ByteStream* pByteStrm, BerTag tag); int GetStrmPos(ByteStream* pByteStrm); flag LA_Next_Two_Bytes_00(ByteStream* pByteStrm); +asn1SccSint milbus_encode(asn1SccSint val); +asn1SccSint milbus_decode(asn1SccSint val); + +#if WORD_SIZE==8 +extern const asn1SccUint64 ber_aux[]; +#else +extern const asn1SccUint32 ber_aux[]; +#endif +asn1SccUint int2uint(asn1SccSint v); +asn1SccSint uint2int(asn1SccUint v, int uintSizeInBytes); + #define CHECK_BIT_STREAM(pBitStrm) assert((pBitStrm)->currentByte*8+(pBitStrm)->currentBit<=(pBitStrm)->count*8) @@ -329,5 +396,3 @@ flag LA_Next_Two_Bytes_00(ByteStream* pByteStrm); #endif - - diff --git a/Demo_Directives/function1/dataview/dataview-uniq.h b/Demo_Directives/function1/dataview/dataview-uniq.h index a320f1b24fd285ba7d2540b44c34c2272390d318..7f53d68e5446cbb119ffeb9f6581d9a11d262aa4 100644 --- a/Demo_Directives/function1/dataview/dataview-uniq.h +++ b/Demo_Directives/function1/dataview/dataview-uniq.h @@ -1,11 +1,8 @@ -#ifndef _INC_DATAVIEW_UNIQ_H -#define _INC_DATAVIEW_UNIQ_H +#ifndef GENERATED_ASN1SCC_DATAVIEW_UNIQ_H +#define GENERATED_ASN1SCC_DATAVIEW_UNIQ_H /* Code automatically generated by asn1scc tool -Date was: 09/07/2011 -Time was: 09:13:21 */ - #include "asn1crt.h" #ifdef __cplusplus @@ -14,108 +11,33 @@ extern "C" { -typedef struct { - char filename[201]; - asn1SccSint col; - asn1SccSint line; -} asn1SccSimulink_Initializer_Excel_T; - -#define asn1SccSimulink_Initializer_Excel_T_REQUIRED_BYTES_FOR_ENCODING 178 -#define asn1SccSimulink_Initializer_Excel_T_REQUIRED_BITS_FOR_ENCODING 1424 -#define asn1SccSimulink_Initializer_Excel_T_REQUIRED_BYTES_FOR_ACN_ENCODING 203 -#define asn1SccSimulink_Initializer_Excel_T_REQUIRED_BITS_FOR_ACN_ENCODING 1624 - -#ifndef ERR_asn1SccSimulink_Initializer_Excel_T_filename -#define ERR_asn1SccSimulink_Initializer_Excel_T_filename 1000 /* (SIZE (1..200)) */ -#endif -#ifndef ERR_asn1SccSimulink_Initializer_Excel_T_col -#define ERR_asn1SccSimulink_Initializer_Excel_T_col 1001 /* (0..200) */ -#endif -#ifndef ERR_asn1SccSimulink_Initializer_Excel_T_line -#define ERR_asn1SccSimulink_Initializer_Excel_T_line 1002 /* (0..200) */ -#endif - -void asn1SccSimulink_Initializer_Excel_T_Initialize(asn1SccSimulink_Initializer_Excel_T* pVal); -flag asn1SccSimulink_Initializer_Excel_T_IsConstraintValid(const asn1SccSimulink_Initializer_Excel_T* val, int* pErrCode); -flag asn1SccSimulink_Initializer_Excel_T_Encode(const asn1SccSimulink_Initializer_Excel_T* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); -flag asn1SccSimulink_Initializer_Excel_T_Decode(asn1SccSimulink_Initializer_Excel_T* pVal, BitStream* pBitStrm, int* pErrCode); - -typedef struct { - char filename[201]; -} asn1SccSimulink_Script_T; - -#define asn1SccSimulink_Script_T_REQUIRED_BYTES_FOR_ENCODING 176 -#define asn1SccSimulink_Script_T_REQUIRED_BITS_FOR_ENCODING 1408 -#define asn1SccSimulink_Script_T_REQUIRED_BYTES_FOR_ACN_ENCODING 201 -#define asn1SccSimulink_Script_T_REQUIRED_BITS_FOR_ACN_ENCODING 1608 - -#ifndef ERR_asn1SccSimulink_Script_T_filename -#define ERR_asn1SccSimulink_Script_T_filename 1003 /* (SIZE (1..200)) */ -#endif - -void asn1SccSimulink_Script_T_Initialize(asn1SccSimulink_Script_T* pVal); -flag asn1SccSimulink_Script_T_IsConstraintValid(const asn1SccSimulink_Script_T* val, int* pErrCode); -flag asn1SccSimulink_Script_T_Encode(const asn1SccSimulink_Script_T* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); -flag asn1SccSimulink_Script_T_Decode(asn1SccSimulink_Script_T* pVal, BitStream* pBitStrm, int* pErrCode); - -typedef struct { - enum { - Taste_directive_NONE, - simulink_initializer_excel_PRESENT, - simulink_script_PRESENT - } kind; - union { - asn1SccSimulink_Initializer_Excel_T simulink_initializer_excel; - asn1SccSimulink_Script_T simulink_script; - } u; -} asn1SccTaste_directive; - -#define asn1SccTaste_directive_REQUIRED_BYTES_FOR_ENCODING 179 -#define asn1SccTaste_directive_REQUIRED_BITS_FOR_ENCODING 1425 -#define asn1SccTaste_directive_REQUIRED_BYTES_FOR_ACN_ENCODING 204 -#define asn1SccTaste_directive_REQUIRED_BITS_FOR_ACN_ENCODING 1625 - -#ifndef ERR_asn1SccTaste_directive_unknown_choice_index -#define ERR_asn1SccTaste_directive_unknown_choice_index 1004 /* */ -#endif - -void asn1SccTaste_directive_Initialize(asn1SccTaste_directive* pVal); -flag asn1SccTaste_directive_IsConstraintValid(const asn1SccTaste_directive* val, int* pErrCode); -flag asn1SccTaste_directive_Encode(const asn1SccTaste_directive* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); -flag asn1SccTaste_directive_Decode(asn1SccTaste_directive* pVal, BitStream* pBitStrm, int* pErrCode); - -/*A few simple types to start with ASN.1*/ -typedef asn1SccSint asn1SccMyInteger; +typedef asn1SccUint asn1SccMyInteger; -#define asn1SccMyInteger_REQUIRED_BYTES_FOR_ENCODING 1 +#define asn1SccMyInteger_REQUIRED_BYTES_FOR_ENCODING 1 #define asn1SccMyInteger_REQUIRED_BITS_FOR_ENCODING 8 -#define asn1SccMyInteger_REQUIRED_BYTES_FOR_ACN_ENCODING 1 -#define asn1SccMyInteger_REQUIRED_BITS_FOR_ACN_ENCODING 8 - -#ifndef ERR_asn1SccMyInteger -#define ERR_asn1SccMyInteger 1005 /* (0..255) */ -#endif +#define asn1SccMyInteger_REQUIRED_BYTES_FOR_ACN_ENCODING 1 +#define asn1SccMyInteger_REQUIRED_BITS_FOR_ACN_ENCODING 8 +#define asn1SccMyInteger_REQUIRED_BYTES_FOR_XER_ENCODING 43 void asn1SccMyInteger_Initialize(asn1SccMyInteger* pVal); flag asn1SccMyInteger_IsConstraintValid(const asn1SccMyInteger* val, int* pErrCode); -flag asn1SccMyInteger_Encode(const asn1SccMyInteger* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); -flag asn1SccMyInteger_Decode(asn1SccMyInteger* pVal, BitStream* pBitStrm, int* pErrCode); +#ifndef ERR_asn1SccMyInteger +#define ERR_asn1SccMyInteger 1001 /*(0 .. 255)*/ +#endif typedef double asn1SccMyReal; -#define asn1SccMyReal_REQUIRED_BYTES_FOR_ENCODING 13 +#define asn1SccMyReal_REQUIRED_BYTES_FOR_ENCODING 13 #define asn1SccMyReal_REQUIRED_BITS_FOR_ENCODING 104 -#define asn1SccMyReal_REQUIRED_BYTES_FOR_ACN_ENCODING 8 -#define asn1SccMyReal_REQUIRED_BITS_FOR_ACN_ENCODING 64 - -#ifndef ERR_asn1SccMyReal -#define ERR_asn1SccMyReal 1006 /* (0..1000) */ -#endif +#define asn1SccMyReal_REQUIRED_BYTES_FOR_ACN_ENCODING 13 +#define asn1SccMyReal_REQUIRED_BITS_FOR_ACN_ENCODING 104 +#define asn1SccMyReal_REQUIRED_BYTES_FOR_XER_ENCODING 67 void asn1SccMyReal_Initialize(asn1SccMyReal* pVal); flag asn1SccMyReal_IsConstraintValid(const asn1SccMyReal* val, int* pErrCode); -flag asn1SccMyReal_Encode(const asn1SccMyReal* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); -flag asn1SccMyReal_Decode(asn1SccMyReal* pVal, BitStream* pBitStrm, int* pErrCode); +#ifndef ERR_asn1SccMyReal +#define ERR_asn1SccMyReal 1002 /*(0.00000000000000000000E+000 .. 1.00000000000000000000E+003)*/ +#endif typedef enum { asn1Scchello = 0, @@ -123,42 +45,88 @@ typedef enum { asn1Scchowareyou = 2 } asn1SccMyEnum; -#define asn1SccMyEnum_REQUIRED_BYTES_FOR_ENCODING 1 +#define asn1SccMyEnum_REQUIRED_BYTES_FOR_ENCODING 1 #define asn1SccMyEnum_REQUIRED_BITS_FOR_ENCODING 2 -#define asn1SccMyEnum_REQUIRED_BYTES_FOR_ACN_ENCODING 1 -#define asn1SccMyEnum_REQUIRED_BITS_FOR_ACN_ENCODING 2 +#define asn1SccMyEnum_REQUIRED_BYTES_FOR_ACN_ENCODING 1 +#define asn1SccMyEnum_REQUIRED_BITS_FOR_ACN_ENCODING 2 +#define asn1SccMyEnum_REQUIRED_BYTES_FOR_XER_ENCODING 30 +void asn1SccMyEnum_Initialize(asn1SccMyEnum* pVal); +flag asn1SccMyEnum_IsConstraintValid(const asn1SccMyEnum* val, int* pErrCode); #ifndef ERR_asn1SccMyEnum_unknown_enumeration_value -#define ERR_asn1SccMyEnum_unknown_enumeration_value 1007 /* invalid enumeration value */ +#define ERR_asn1SccMyEnum_unknown_enumeration_value 1004 /**/ +#endif +#ifndef ERR_asn1SccMyEnum +#define ERR_asn1SccMyEnum 1003 /**/ #endif -void asn1SccMyEnum_Initialize(asn1SccMyEnum* pVal); -flag asn1SccMyEnum_IsConstraintValid(const asn1SccMyEnum* val, int* pErrCode); -flag asn1SccMyEnum_Encode(const asn1SccMyEnum* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); -flag asn1SccMyEnum_Decode(asn1SccMyEnum* pVal, BitStream* pBitStrm, int* pErrCode); +typedef struct { + asn1SccMyEnum arr[2]; +} asn1SccMySeqOf; + +#define asn1SccMySeqOf_REQUIRED_BYTES_FOR_ENCODING 1 +#define asn1SccMySeqOf_REQUIRED_BITS_FOR_ENCODING 4 +#define asn1SccMySeqOf_REQUIRED_BYTES_FOR_ACN_ENCODING 1 +#define asn1SccMySeqOf_REQUIRED_BITS_FOR_ACN_ENCODING 4 +#define asn1SccMySeqOf_REQUIRED_BYTES_FOR_XER_ENCODING 55 + +void asn1SccMySeqOf_Initialize(asn1SccMySeqOf* pVal); +flag asn1SccMySeqOf_IsConstraintValid(const asn1SccMySeqOf* val, int* pErrCode); +#ifndef ERR_asn1SccMySeqOf +#define ERR_asn1SccMySeqOf 1005 /*(SIZE(2))*/ +#endif + +typedef struct { + byte arr[3]; +} asn1SccMyOctStr; + +#define asn1SccMyOctStr_REQUIRED_BYTES_FOR_ENCODING 3 +#define asn1SccMyOctStr_REQUIRED_BITS_FOR_ENCODING 24 +#define asn1SccMyOctStr_REQUIRED_BYTES_FOR_ACN_ENCODING 3 +#define asn1SccMyOctStr_REQUIRED_BITS_FOR_ACN_ENCODING 24 +#define asn1SccMyOctStr_REQUIRED_BYTES_FOR_XER_ENCODING 27 + +void asn1SccMyOctStr_Initialize(asn1SccMyOctStr* pVal); +flag asn1SccMyOctStr_IsConstraintValid(const asn1SccMyOctStr* val, int* pErrCode); +#ifndef ERR_asn1SccMyOctStr +#define ERR_asn1SccMyOctStr 1006 /*(SIZE(3))*/ +#endif + +typedef enum { + asn1Scctaste = 1, + asn1Sccwelcomes = 2, + asn1Sccyou = 3 +} asn1SccMySeq_b; + +#define asn1SccMySeq_b_REQUIRED_BYTES_FOR_ENCODING 1 +#define asn1SccMySeq_b_REQUIRED_BITS_FOR_ENCODING 2 +#define asn1SccMySeq_b_REQUIRED_BYTES_FOR_ACN_ENCODING 1 +#define asn1SccMySeq_b_REQUIRED_BITS_FOR_ACN_ENCODING 2 +#define asn1SccMySeq_b_REQUIRED_BYTES_FOR_XER_ENCODING 28 + +void asn1SccMySeq_b_Initialize(asn1SccMySeq_b* pVal); +flag asn1SccMySeq_b_IsConstraintValid(const asn1SccMySeq_b* val, int* pErrCode); +#ifndef ERR_asn1SccMySeq_b_unknown_enumeration_value +#define ERR_asn1SccMySeq_b_unknown_enumeration_value 1008 /**/ +#endif +#ifndef ERR_asn1SccMySeq_b +#define ERR_asn1SccMySeq_b 1007 /**/ +#endif typedef struct { asn1SccMyInteger a; - enum { - asn1Scctaste = 1, - asn1Sccwelcomes = 2, - asn1Sccyou = 3 - } b; + asn1SccMySeq_b b; } asn1SccMySeq; -#define asn1SccMySeq_REQUIRED_BYTES_FOR_ENCODING 2 +#define asn1SccMySeq_REQUIRED_BYTES_FOR_ENCODING 2 #define asn1SccMySeq_REQUIRED_BITS_FOR_ENCODING 10 -#define asn1SccMySeq_REQUIRED_BYTES_FOR_ACN_ENCODING 2 -#define asn1SccMySeq_REQUIRED_BITS_FOR_ACN_ENCODING 10 - -#ifndef ERR_asn1SccMySeq_b_unknown_enumeration_value -#define ERR_asn1SccMySeq_b_unknown_enumeration_value 1008 /* invalid enumeration value */ -#endif +#define asn1SccMySeq_REQUIRED_BYTES_FOR_ACN_ENCODING 2 +#define asn1SccMySeq_REQUIRED_BITS_FOR_ACN_ENCODING 10 +#define asn1SccMySeq_REQUIRED_BYTES_FOR_XER_ENCODING 58 void asn1SccMySeq_Initialize(asn1SccMySeq* pVal); flag asn1SccMySeq_IsConstraintValid(const asn1SccMySeq* val, int* pErrCode); -flag asn1SccMySeq_Encode(const asn1SccMySeq* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); -flag asn1SccMySeq_Decode(asn1SccMySeq* pVal, BitStream* pBitStrm, int* pErrCode); + typedef struct { enum { @@ -172,73 +140,55 @@ typedef struct { } u; } asn1SccMyChoice; -#define asn1SccMyChoice_REQUIRED_BYTES_FOR_ENCODING 2 -#define asn1SccMyChoice_REQUIRED_BITS_FOR_ENCODING 11 -#define asn1SccMyChoice_REQUIRED_BYTES_FOR_ACN_ENCODING 2 -#define asn1SccMyChoice_REQUIRED_BITS_FOR_ACN_ENCODING 11 - -#ifndef ERR_asn1SccMyChoice_unknown_choice_index -#define ERR_asn1SccMyChoice_unknown_choice_index 1009 /* */ -#endif +#define asn1SccMyChoice_REQUIRED_BYTES_FOR_ENCODING 2 +#define asn1SccMyChoice_REQUIRED_BITS_FOR_ENCODING 12 +#define asn1SccMyChoice_REQUIRED_BYTES_FOR_ACN_ENCODING 2 +#define asn1SccMyChoice_REQUIRED_BITS_FOR_ACN_ENCODING 12 +#define asn1SccMyChoice_REQUIRED_BYTES_FOR_XER_ENCODING 71 void asn1SccMyChoice_Initialize(asn1SccMyChoice* pVal); flag asn1SccMyChoice_IsConstraintValid(const asn1SccMyChoice* val, int* pErrCode); -flag asn1SccMyChoice_Encode(const asn1SccMyChoice* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); -flag asn1SccMyChoice_Decode(asn1SccMyChoice* pVal, BitStream* pBitStrm, int* pErrCode); - -typedef struct { - - asn1SccMyEnum arr[2]; -} asn1SccMySeqOf; +#ifndef ERR_asn1SccMyChoice_unknown_choice_index +#define ERR_asn1SccMyChoice_unknown_choice_index 1009 /**/ +#endif -#define asn1SccMySeqOf_REQUIRED_BYTES_FOR_ENCODING 1 -#define asn1SccMySeqOf_REQUIRED_BITS_FOR_ENCODING 4 -#define asn1SccMySeqOf_REQUIRED_BYTES_FOR_ACN_ENCODING 1 -#define asn1SccMySeqOf_REQUIRED_BITS_FOR_ACN_ENCODING 4 +extern const asn1SccMySeqOf myVar; +extern const asn1SccMyChoice myVar2; -#ifndef ERR_asn1SccMySeqOf -#define ERR_asn1SccMySeqOf 1010 /* (SIZE (2)) */ -#endif +/* ================= Encoding/Decoding function prototypes ================= + * These functions are placed at the end of the file to make sure all types + * have been declared first, in case of parameterized ACN encodings + * ========================================================================= */ -void asn1SccMySeqOf_Initialize(asn1SccMySeqOf* pVal); -flag asn1SccMySeqOf_IsConstraintValid(const asn1SccMySeqOf* val, int* pErrCode); +flag asn1SccMyInteger_Encode(const asn1SccMyInteger* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); +flag asn1SccMyInteger_Decode(asn1SccMyInteger* pVal, BitStream* pBitStrm, int* pErrCode); +flag asn1SccMyReal_Encode(const asn1SccMyReal* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); +flag asn1SccMyReal_Decode(asn1SccMyReal* pVal, BitStream* pBitStrm, int* pErrCode); +flag asn1SccMyEnum_Encode(const asn1SccMyEnum* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); +flag asn1SccMyEnum_Decode(asn1SccMyEnum* pVal, BitStream* pBitStrm, int* pErrCode); flag asn1SccMySeqOf_Encode(const asn1SccMySeqOf* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); flag asn1SccMySeqOf_Decode(asn1SccMySeqOf* pVal, BitStream* pBitStrm, int* pErrCode); - -typedef struct { - - byte arr[3]; -} asn1SccMyOctStr; - -#define asn1SccMyOctStr_REQUIRED_BYTES_FOR_ENCODING 3 -#define asn1SccMyOctStr_REQUIRED_BITS_FOR_ENCODING 24 -#define asn1SccMyOctStr_REQUIRED_BYTES_FOR_ACN_ENCODING 3 -#define asn1SccMyOctStr_REQUIRED_BITS_FOR_ACN_ENCODING 24 - -#ifndef ERR_asn1SccMyOctStr -#define ERR_asn1SccMyOctStr 1011 /* (SIZE (3)) */ -#endif - -void asn1SccMyOctStr_Initialize(asn1SccMyOctStr* pVal); -flag asn1SccMyOctStr_IsConstraintValid(const asn1SccMyOctStr* val, int* pErrCode); flag asn1SccMyOctStr_Encode(const asn1SccMyOctStr* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); flag asn1SccMyOctStr_Decode(asn1SccMyOctStr* pVal, BitStream* pBitStrm, int* pErrCode); +flag asn1SccMySeq_b_Encode(const asn1SccMySeq_b* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); +flag asn1SccMySeq_b_Decode(asn1SccMySeq_b* pVal, BitStream* pBitStrm, int* pErrCode); +flag asn1SccMySeq_Encode(const asn1SccMySeq* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); +flag asn1SccMySeq_Decode(asn1SccMySeq* pVal, BitStream* pBitStrm, int* pErrCode); +flag asn1SccMyChoice_Encode(const asn1SccMyChoice* val, BitStream* pBitStrm, int* pErrCode, flag bCheckConstraints); +flag asn1SccMyChoice_Decode(asn1SccMyChoice* pVal, BitStream* pBitStrm, int* pErrCode); -extern asn1SccMySeqOf myVar; -extern asn1SccMyChoice myVar2; #ifdef __cplusplus } #define ENUM_asn1Scchello asn1Scchello #define ENUM_asn1Sccworld asn1Sccworld #define ENUM_asn1Scchowareyou asn1Scchowareyou -#define ENUM_asn1Scctaste asn1SccMySeq::asn1Scctaste -#define ENUM_asn1Sccwelcomes asn1SccMySeq::asn1Sccwelcomes -#define ENUM_asn1Sccyou asn1SccMySeq::asn1Sccyou -#define CHOICE_simulink_initializer_excel_PRESENT asn1SccTaste_directive::simulink_initializer_excel_PRESENT -#define CHOICE_simulink_script_PRESENT asn1SccTaste_directive::simulink_script_PRESENT +#define ENUM_asn1Scctaste asn1Scctaste +#define ENUM_asn1Sccwelcomes asn1Sccwelcomes +#define ENUM_asn1Sccyou asn1Sccyou #define CHOICE_a_PRESENT asn1SccMyChoice::a_PRESENT #define CHOICE_b_PRESENT asn1SccMyChoice::b_PRESENT + #endif #endif diff --git a/Demo_Directives/function1/function1.c b/Demo_Directives/function1/function1.c index 080abcc07a134de8b75a9a4fae647ccdd4a6d39b..c595678c45abdfa6a16e00f400119e7560708c31 100644 --- a/Demo_Directives/function1/function1.c +++ b/Demo_Directives/function1/function1.c @@ -1,15 +1,18 @@ /* Functions to be filled by the user (never overwritten by buildsupport tool) */ #include "function1.h" - +#include void function1_startup() { - /* Write your initialization code here, - but do not make any call to a required interface!! */ + printf("Function 1 startup\n"); } void function1_PI_kok() { + static asn1SccMyInteger hello = 0; + printf("Function 1 periodic\n"); + function1_RI_pop(&hello); + hello ++; /* Write your code here! */ } diff --git a/Demo_Directives/function1/function1.h b/Demo_Directives/function1/function1.h index f90ef7eb22df5077f8d0d02e9c9ce5f12ea5c26e..f8147c377f966bd9b9518786df8324050ef57372 100644 --- a/Demo_Directives/function1/function1.h +++ b/Demo_Directives/function1/function1.h @@ -7,11 +7,19 @@ #include "C_ASN1_Types.h" +#ifdef __cplusplus +extern "C" { +#endif + void function1_startup(); void function1_PI_kok(); extern void function1_RI_pop(const asn1SccMyInteger *); +#ifdef __cplusplus +} +#endif + #endif