├── NEWS ├── examples ├── ardupilot │ ├── userdefined.mk │ ├── Makefile.am │ ├── gps.c │ ├── yaw.c │ ├── throttle.c │ └── ardupilot_platform.aadl ├── arinc653_annex │ ├── Makefile.am │ ├── example_2 │ │ └── Makefile.am │ └── example_1 │ │ └── Makefile.am ├── tetris │ ├── tetris.aadl │ ├── Makefile │ ├── arrival.ads │ ├── screen.ads │ ├── bricks.ads │ ├── screen.adb │ └── wall.ads ├── stm32discovery_ada │ ├── blink.ads │ ├── Makefile.am │ ├── blink.adb │ └── stm32discovery_ada.aadl ├── mjpeg │ ├── .aadlsettings │ ├── COLOR_METRICS.h │ ├── .project │ ├── BLOCK_METRICS.h │ ├── Makefile.am │ ├── LIBU.h │ ├── IQZZ.h │ ├── mjpeg-platform.aadl │ ├── DEMUX.h │ └── COLOR_METRICS.cpp ├── ahrs_discovery │ ├── LinkerScript.ld │ ├── imgs │ │ ├── image1.jpeg │ │ ├── image10.png │ │ ├── image11.png │ │ ├── image12.png │ │ ├── image2.png │ │ ├── image3.png │ │ ├── image4.png │ │ ├── image5.png │ │ ├── image6.png │ │ ├── image7.png │ │ ├── image8.png │ │ └── image9.jpeg │ ├── openocd-usb.cfg │ ├── stm32f4discovery.cfg │ ├── src │ │ ├── hardware.h │ │ └── stm32_mavlink.h │ ├── include │ │ ├── eigen_math.h │ │ └── AttitudeEKF.h │ ├── Makefile.am │ ├── stlink-v2.cfg │ ├── ahrs-data_types.aadl │ ├── ahrs-systems.aadl │ └── ahrs.aadl ├── line_follower │ ├── robot.c │ ├── Makefile.am │ └── software_lf.aadl ├── ping_spark │ ├── msgs.ads │ ├── ping.ads │ ├── pinged.ads │ ├── README.md │ ├── pinged.adb │ ├── ping.adb │ ├── msgs.adb │ ├── Makefile.am │ └── ping-local.aadl ├── air │ ├── ping │ │ ├── ping.h │ │ ├── Makefile.am │ │ ├── ping.c │ │ └── air_polling.c │ ├── Makefile.am │ ├── hello │ │ ├── hello.c │ │ └── Makefile.am │ ├── smp01 │ │ ├── hello.c │ │ └── Makefile.am │ ├── hello_2partitions │ │ ├── hello.c │ │ └── Makefile.am │ └── README.md ├── minepump │ ├── userdefined.mk │ ├── Makefile.am │ └── simu.h ├── rosace │ ├── userdefined.mk │ ├── common │ │ ├── README │ │ ├── io.h │ │ └── app3_code.c │ ├── rosace.aadl │ ├── app3_aadl.c │ ├── app2_aadl.c │ ├── app_aadl.c │ ├── log.c │ ├── rosace-rtems.aadl │ └── rosace-hardware.aadl ├── paparazzi │ ├── paparazzi_hard.aadl │ ├── Makefile.am │ └── paparazzi_subprograms.aadl ├── asl │ ├── asl.aadl │ └── Makefile.am ├── mixin │ └── Makefile.am ├── rap │ └── Makefile.am ├── uxv │ ├── Makefile.am │ ├── minirocket │ │ └── Makefile.am │ ├── traxsterv3 │ │ └── Makefile.am │ ├── quadrirotorv1 │ │ └── Makefile.am │ ├── quadrirotorv0 │ │ └── Makefile.am │ └── emaxxv2 │ │ └── Makefile.am ├── adiru │ ├── notes.txt │ ├── Makefile.am │ ├── receive.c │ ├── shm_datatype.aadl │ ├── adiru_errlibrary.aadl │ ├── adiru_memory.aadl │ └── adiru_devices.aadl ├── data_modeling_annex │ └── Makefile.am ├── fcs │ └── Makefile.am ├── voter │ ├── Makefile.am │ └── voter.aadl ├── redundancy │ └── Makefile.am ├── mosart │ └── Makefile.am ├── round_robin │ ├── Makefile.am │ └── round_robin.aadl ├── isr │ └── Makefile.am ├── robot │ └── Makefile.am ├── robot_ba │ └── Makefile.am ├── doors │ └── Makefile.am ├── pacemaker │ └── Makefile.am ├── units │ ├── Makefile.am │ └── test_units.aadl ├── rma │ ├── hello.c │ └── Makefile.am ├── flow_analysis │ └── Makefile.am ├── aocs │ └── Makefile.am ├── producer_consumer │ ├── producer_consumer.ads │ ├── Makefile.am │ └── producer_consumer.adb ├── minepump_ba │ ├── Makefile.am │ └── simu.h ├── producer_consumer_ba │ ├── Makefile.am │ ├── devicesconf.c │ └── producer_consumer.c ├── time_triggered │ ├── Makefile.am │ ├── tt.ads │ └── tt.adb ├── behavior_annex │ ├── Makefile.am │ ├── ba_example4.aadl │ ├── ba_example2.aadl │ ├── ba_example1.aadl │ ├── ba_example5.aadl │ └── ba_example3.aadl ├── producer_consumer_ba2 │ ├── devicesconf.c │ ├── Makefile.am │ └── producer_consumer.c ├── producer_consumer_ba_many_transitions │ ├── Makefile.am │ ├── devicesconf.c │ └── producer_consumer.c ├── satellite │ ├── Makefile.am │ ├── satellite_hardware.aadl │ └── satellite_system.aadl ├── producer_consumer_ba_4ports_manyDispatchTriggers │ ├── devicesconf.c │ ├── Makefile.am │ └── producer_consumer.c ├── radar │ ├── Makefile.am │ ├── radar.ads │ └── radar_types.aadl ├── pathfinder_system │ └── Makefile.am ├── car │ └── Makefile.am ├── perseus │ ├── Makefile.am │ └── perseus.aadl ├── multicore │ ├── messages.aadl │ ├── devicesconf.c │ ├── Makefile.am │ ├── M1RTMgr.c │ ├── M2RTMgr.c │ ├── BCMgr.c │ ├── M0RTMgr.c │ └── MsgType.h ├── fms │ ├── Makefile.am │ ├── afdx_properties.aadl │ ├── datatype.aadl │ └── m3_software.aadl ├── ravenscar │ └── Makefile.am ├── Makefile.am ├── aram │ ├── data_types.aadl │ ├── mission_properties.aadl │ ├── aram_properties.aadl │ └── gaia.aadl ├── memory │ ├── Makefile.am │ ├── vxworks.real │ └── vxworks_platform.aadl └── rap_code │ └── Makefile.am ├── src ├── Makefile.am ├── real │ ├── aadl_theorems.real │ ├── Makefile.am │ ├── deployment.real │ ├── perseus_lib.real │ ├── flow_latency.real │ ├── code_gen.real │ ├── bare_board_theorems.real │ ├── edf_theorems.real │ └── rma_theorems.real ├── aadl │ ├── devices │ │ ├── devices-resistances.aadl │ │ ├── devices-afdx.aadl │ │ ├── devices-mpxv7002dp.aadl │ │ ├── devices-spi.aadl │ │ ├── devices-xyz_ir.aadl │ │ ├── devices-ly530alh.aadl │ │ ├── devices-thermistors.aadl │ │ ├── devices-thermopiles.aadl │ │ ├── devices-lpr530al.aadl │ │ ├── devices-battery_14v_4ah.aadl │ │ ├── devices-battery_7v2_4a5h.aadl │ │ ├── devices-regulator_reg113_33.aadl │ │ ├── devices-regulator_tsi10n.aadl │ │ ├── devices-regulator_ten40_4812.aadl │ │ ├── devices-bmp085.aadl │ │ ├── devices-qre1113.aadl │ │ ├── devices-hmc5843.aadl │ │ ├── devices-sn74ls157d.aadl │ │ ├── devices-motor_bl2824.aadl │ │ ├── devices-em406a.aadl │ │ ├── devices-router_wifi_refxx.aadl │ │ ├── devices-router_wifi_wndr3300.aadl │ │ └── devices-adxl.aadl │ ├── buses │ │ ├── buses-dma.aadl │ │ ├── buses-spi.aadl │ │ ├── buses-obdh.aadl │ │ ├── buses-mil1553.aadl │ │ ├── buses-arinc_429.aadl │ │ ├── buses-can.aadl │ │ ├── buses-afdx.aadl │ │ ├── buses-usb.aadl │ │ ├── protocols.aadl │ │ ├── buses-pci.aadl │ │ ├── buses-i2c.aadl │ │ ├── buses-spacewire.aadl │ │ ├── buses-vme.aadl │ │ ├── buses-ethernet.aadl │ │ ├── buses-uart.aadl │ │ └── buses-misc.aadl │ ├── shields.aadl │ ├── unit.aadl │ ├── processors │ │ ├── processors-x86.aadl │ │ └── processors-attiny.aadl │ ├── shields-xbee.aadl │ ├── Makefile.am │ ├── shields-ardupilot.aadl │ ├── shields-ardumoto.aadl │ ├── boards │ │ ├── boards-cpiom.aadl │ │ ├── boards-gr_cpci_x4cv.aadl │ │ ├── boards-verdex_xm4.aadl │ │ ├── boards-sbc8349e.aadl │ │ ├── boards-arduimu.aadl │ │ ├── boards-sbcp4080.aadl │ │ └── boards-gr_xc3s_1500.aadl │ ├── memories.aadl │ ├── drivers │ │ └── asn1_configuration.aadl │ ├── systems.aadl │ └── os.aadl └── property_set │ ├── os_properties.aadl │ ├── memory_segment_properties.aadl │ ├── arinc653_extended.aadl │ ├── Makefile.am │ ├── data_sheet.aadl │ ├── transformations.aadl │ ├── bus_properties.aadl │ ├── processor_properties.aadl │ └── physical_properties.aadl ├── .aadlsettings ├── .gitignore ├── support ├── reconfig └── gnu_make.m4 ├── AUTHORS ├── Makefile.am ├── share ├── emacs │ └── README └── vim │ └── README ├── .github └── workflows │ └── main.yml ├── README.md ├── INSTALL └── LICENSE /NEWS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/ardupilot/userdefined.mk: -------------------------------------------------------------------------------- 1 | USER_LDFLAGS=-lm 2 | -------------------------------------------------------------------------------- /examples/arinc653_annex/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = example_1 example_2 2 | -------------------------------------------------------------------------------- /examples/tetris/tetris.aadl: -------------------------------------------------------------------------------- 1 | package Tetris 2 | public 3 | 4 | 5 | 6 | end Tetris; 7 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = aadl property_set real 2 | 3 | clean-local: 4 | -rm -f *~ 5 | -------------------------------------------------------------------------------- /examples/tetris/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | gnatmake tetris.adb 3 | 4 | clean: 5 | -rm -f *~ 6 | 7 | -------------------------------------------------------------------------------- /.aadlsettings: -------------------------------------------------------------------------------- 1 | #Sun Aug 12 14:51:17 CEST 2012 2 | source.directory=/aadl 3 | model.directory=/aaxl 4 | -------------------------------------------------------------------------------- /examples/stm32discovery_ada/blink.ads: -------------------------------------------------------------------------------- 1 | package Blink is 2 | 3 | procedure Do_Blink; 4 | 5 | end Blink; 6 | -------------------------------------------------------------------------------- /examples/mjpeg/.aadlsettings: -------------------------------------------------------------------------------- 1 | #Tue Jun 09 16:17:50 EDT 2015 2 | source.directory=/aadl 3 | model.directory=/aaxl 4 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/LinkerScript.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/LinkerScript.ld -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image1.jpeg -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image10.png -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image11.png -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image12.png -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image2.png -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image3.png -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image4.png -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image5.png -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image6.png -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image7.png -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image8.png -------------------------------------------------------------------------------- /examples/ahrs_discovery/imgs/image9.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenAADL/AADLib/HEAD/examples/ahrs_discovery/imgs/image9.jpeg -------------------------------------------------------------------------------- /examples/line_follower/robot.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void robot_main (void) 4 | { 5 | printf ("Hello Arduino!\n"); 6 | } 7 | -------------------------------------------------------------------------------- /examples/ping_spark/msgs.ads: -------------------------------------------------------------------------------- 1 | package Msgs is 2 | 3 | procedure Welcome_Pinger; 4 | 5 | procedure Recover; 6 | 7 | end Msgs; 8 | -------------------------------------------------------------------------------- /examples/air/ping/ping.h: -------------------------------------------------------------------------------- 1 | #ifndef __PING_H_ 2 | #define __PING_H_ 3 | #include 4 | 5 | typedef int64_t custom_int; 6 | #endif 7 | -------------------------------------------------------------------------------- /examples/air/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS= hello hello_2partitions ping smp01 2 | 3 | EXTRA_DIST=$(srcdir)/README.md 4 | 5 | clean-local: 6 | -rm -rf *~ 7 | -------------------------------------------------------------------------------- /examples/minepump/userdefined.mk: -------------------------------------------------------------------------------- 1 | USER_OBJS += simu.o 2 | 3 | simu.o: ../../simu.c ../../simu.h 4 | $(CC) -c $(INCLUDE) $(CFLAGS) ../../simu.c -o simu.o 5 | -------------------------------------------------------------------------------- /src/real/aadl_theorems.real: -------------------------------------------------------------------------------- 1 | theorem check_aadl 2 | foreach s in system_set do 3 | requires (check_data_model_annex); 4 | check (1=1); 5 | end check_aadl; 6 | -------------------------------------------------------------------------------- /examples/rosace/userdefined.mk: -------------------------------------------------------------------------------- 1 | USER_CFLAGS=-I$(srcdir)./../../common/ 2 | USER_LDFLAGS=-lm -g 3 | 4 | ifeq ($(RTEMS_API),4.11) 5 | USER_CFLAGS += -msoft-float 6 | endif 7 | -------------------------------------------------------------------------------- /examples/paparazzi/paparazzi_hard.aadl: -------------------------------------------------------------------------------- 1 | package paparazzi_hard 2 | public 3 | 4 | -- bus to link the subsystems 5 | bus SPI 6 | end SPI; 7 | 8 | end paparazzi_hard; 9 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-resistances.aadl: -------------------------------------------------------------------------------- 1 | package devices::resistances 2 | public 3 | 4 | device Generic_Resistance 5 | end Generic_Resistance; 6 | 7 | end devices::resistances; -------------------------------------------------------------------------------- /src/aadl/buses/buses-dma.aadl: -------------------------------------------------------------------------------- 1 | -- Modeling Direct memory access buses 2 | package buses::DMA 3 | public 4 | 5 | bus DMA 6 | -- Empty, to define 7 | end DMA; 8 | 9 | end buses::DMA; -------------------------------------------------------------------------------- /src/aadl/buses/buses-spi.aadl: -------------------------------------------------------------------------------- 1 | package Buses::SPI 2 | public 3 | 4 | bus SPI 5 | end SPI; 6 | 7 | bus implementation SPI.impl 8 | end SPI.impl; 9 | 10 | end Buses::SPI; 11 | -------------------------------------------------------------------------------- /examples/asl/asl.aadl: -------------------------------------------------------------------------------- 1 | package ASL 2 | public 3 | 4 | system a_system 5 | end a_system; 6 | 7 | system implementation a_system.impl 8 | end a_system.impl; 9 | 10 | end ASL; 11 | -------------------------------------------------------------------------------- /examples/mixin/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/mixin.aadl 2 | AADL_ROOT = 3 | 4 | OTHER_FILES = 5 | 6 | include $(srcdir)/../Makefile.common 7 | 8 | AVAILABLE_TARGETS= parse-aadl 9 | 10 | -------------------------------------------------------------------------------- /examples/ping_spark/ping.ads: -------------------------------------------------------------------------------- 1 | with PolyORB_HI_Generated.Types; use PolyORB_HI_Generated.Types; 2 | 3 | package Ping is 4 | 5 | procedure Do_Ping_Spg (Data_Source : out Simple_Type); 6 | 7 | end Ping; 8 | -------------------------------------------------------------------------------- /examples/ping_spark/pinged.ads: -------------------------------------------------------------------------------- 1 | with PolyORB_HI_Generated.Types; use PolyORB_HI_Generated.Types; 2 | 3 | package Pinged is 4 | 5 | procedure Ping_Spg (Data_Sink : Simple_Type); 6 | 7 | end Pinged; 8 | -------------------------------------------------------------------------------- /examples/rap/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/rap.aadl 2 | AADL_ROOT = rap.native 3 | 4 | CLEANDIRS = 5 | 6 | include $(srcdir)/../Makefile.common 7 | 8 | AVAILABLE_TARGETS= parse-aadl 9 | 10 | -------------------------------------------------------------------------------- /examples/air/hello/hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void user_hello_spg_1 (void) 4 | { 5 | printf ("FIRST TASK\n"); 6 | } 7 | 8 | void user_hello_spg_2 (void) 9 | { 10 | printf ("SECOND TASK\n"); 11 | } 12 | -------------------------------------------------------------------------------- /examples/air/smp01/hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void user_hello_spg_1 (void) 4 | { 5 | printf ("FIRST TASK\n"); 6 | } 7 | 8 | void user_hello_spg_2 (void) 9 | { 10 | printf ("SECOND TASK\n"); 11 | } 12 | -------------------------------------------------------------------------------- /examples/uxv/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = emaxxv2 \ 2 | minirocket \ 3 | quadrirotorv0 \ 4 | quadrirotorv1 \ 5 | traxsterv3 6 | 7 | include $(srcdir)/../Makefile.common 8 | 9 | OTHER_FILES= 10 | 11 | -------------------------------------------------------------------------------- /examples/adiru/notes.txt: -------------------------------------------------------------------------------- 1 | TODO 2 | ==== 3 | 1. uint32_t -> unsigned int 4 | 2. memory configuration 5 | 3. schedule configuration 6 | 4. => "subprograms.h" 7 | 5. check page size 8 | 6. add macro for target -------------------------------------------------------------------------------- /examples/data_modeling_annex/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/base_types-example_types.aadl 2 | AADL_ROOT = line_follower_robot.i 3 | 4 | include $(srcdir)/../Makefile.common 5 | 6 | AVAILABLE_TARGETS= parse-aadl 7 | -------------------------------------------------------------------------------- /examples/fcs/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/fcs.aadl 2 | AADL_ROOT = fcs.impl 3 | 4 | include $(srcdir)/../Makefile.common 5 | 6 | CLEANDIRS = fcs_impl 7 | 8 | AVAILABLE_TARGETS= parse-aadl real cheddar stats lnt 9 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-obdh.aadl: -------------------------------------------------------------------------------- 1 | -- On-Board Data Handling bus modeling package 2 | 3 | package buses::OBDH 4 | Public 5 | 6 | bus OBDH 7 | -- Empty component, to define 8 | end OBDH; 9 | 10 | 11 | end buses::OBDH; -------------------------------------------------------------------------------- /examples/voter/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/voter.aadl 2 | AADL_ROOT = 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | 8 | include $(srcdir)/../Makefile.common 9 | 10 | AVAILABLE_TARGETS= parse-aadl 11 | -------------------------------------------------------------------------------- /examples/air/hello_2partitions/hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void user_hello_spg_1 (void) 4 | { 5 | printf ("FIRST TASK\n"); 6 | } 7 | 8 | void user_hello_spg_2 (void) 9 | { 10 | printf ("SECOND TASK\n"); 11 | } 12 | -------------------------------------------------------------------------------- /examples/redundancy/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/redundancy.aadl 2 | AADL_ROOT = rma.impl 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | 8 | include $(srcdir)/../Makefile.common 9 | 10 | AVAILABLE_TARGETS= parse-aadl 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | Makefile 3 | Makefile.in 4 | autom4te.cache/ 5 | config.log 6 | config.status 7 | configure 8 | *cheddar.xml 9 | aclocal.m4 10 | ocarina_out 11 | private 12 | aadlib-* 13 | generated-code 14 | imv 15 | instances 16 | support/compile 17 | -------------------------------------------------------------------------------- /examples/mosart/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/modevva.aadl 2 | AADL_ROOT = modevva.impl 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | 8 | include $(srcdir)/../Makefile.common 9 | 10 | AVAILABLE_TARGETS= parse-aadl real cheddar mast aadl_xml 11 | -------------------------------------------------------------------------------- /src/aadl/shields.aadl: -------------------------------------------------------------------------------- 1 | -- This package is the root device of all Arduino shields, "plug-in" 2 | -- on top of the Arduino platforms. 3 | 4 | package Shields 5 | public 6 | 7 | device Empty_Shield 8 | 9 | end Empty_Shield; 10 | 11 | end Shields; 12 | -------------------------------------------------------------------------------- /examples/round_robin/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/round_robin.aadl 2 | AADL_ROOT = rr.impl_nopreempt 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | 8 | include $(srcdir)/../Makefile.common 9 | 10 | AVAILABLE_TARGETS= parse-aadl real cheddar 11 | -------------------------------------------------------------------------------- /src/real/Makefile.am: -------------------------------------------------------------------------------- 1 | # Retrieve all source files 2 | 3 | BRUTE_REAL=${shell find . $(srcdir) -name '*.real' | grep -v 'b~' 2> /dev/null} 4 | REAL_SOURCES = ${sort $(srcdir) $(BRUTE_REAL)} 5 | 6 | EXTRA_DIST= $(REAL_SOURCES) 7 | 8 | clean-local: 9 | -rm *~ 10 | -------------------------------------------------------------------------------- /examples/arinc653_annex/example_2/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/arincexample2.aadl 2 | AADL_ROOT = arinc653system.impl 3 | 4 | CLEANDIRS = generated-code 5 | 6 | include $(srcdir)/../../Makefile.common 7 | 8 | AVAILABLE_TARGETS= #parse-aadl real arinc653_conf 9 | -------------------------------------------------------------------------------- /examples/isr/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/isr.aadl 2 | AADL_ROOT = ticker_system.impl 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | CLEANFILES = 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl 12 | # build_ada 13 | -------------------------------------------------------------------------------- /examples/robot/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/robot.aadl 2 | AADL_ROOT = robot.i 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | CLEANFILES = model.cami model.nd 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl petri 12 | -------------------------------------------------------------------------------- /examples/robot_ba/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/robot_ba.aadl 2 | AADL_ROOT = robot.i 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | CLEANFILES = *.lnt demo.svl 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl lnt 12 | -------------------------------------------------------------------------------- /examples/air/smp01/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/smp01.aadl 2 | AADL_ROOT = smp01.impl 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = smp01_impl 7 | CLEANFILES = 8 | 9 | include $(srcdir)/../../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl air_conf 12 | -------------------------------------------------------------------------------- /examples/doors/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/dms.aadl 2 | AADL_ROOT = door_management.imp 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | CLEANFILES = *.lnt demo.svl 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl lnt 12 | -------------------------------------------------------------------------------- /support/reconfig: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | rm -f aclocal.m4 support/libtool.m4 configure 4 | 5 | echo "Running aclocal" 6 | aclocal -I support 7 | 8 | echo "Running autoconf" 9 | autoconf 10 | 11 | echo "Running automake" 12 | automake --add-missing --copy -Wno-syntax 13 | -------------------------------------------------------------------------------- /examples/arinc653_annex/example_1/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/partitionedsystemexample.aadl 2 | AADL_ROOT = arincsystem.impl 3 | 4 | CLEANDIRS = generated-code 5 | 6 | include $(srcdir)/../../Makefile.common 7 | 8 | AVAILABLE_TARGETS= #parse-aadl real arinc653_conf 9 | -------------------------------------------------------------------------------- /examples/pacemaker/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/pacemaker.aadl 2 | AADL_ROOT = DeviceControllerMonitor.others 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | CLEANFILES = 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl lnt 12 | -------------------------------------------------------------------------------- /examples/units/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/test_units.aadl 2 | AADL_ROOT = 3 | 4 | OTHER_FILES = \ 5 | $(srcdir)/unit_ps.aadl 6 | 7 | CLEANDIRS = 8 | CLEANFILES = 9 | 10 | include $(srcdir)/../Makefile.common 11 | 12 | AVAILABLE_TARGETS= #parse-aadl 13 | -------------------------------------------------------------------------------- /examples/air/hello/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/hello_world.aadl 2 | AADL_ROOT = hello.impl 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = hello_impl 7 | CLEANFILES = 8 | 9 | include $(srcdir)/../../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl air_conf c 12 | -------------------------------------------------------------------------------- /examples/rma/hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void user_hello_spg_1 (void) 4 | { 5 | printf ("FIRST TASK\n"); 6 | fflush (stdout); 7 | } 8 | 9 | void user_hello_spg_2 (void) 10 | { 11 | printf ("SECOND TASK\n"); 12 | fflush (stdout); 13 | } 14 | -------------------------------------------------------------------------------- /examples/flow_analysis/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/flowlatencysampleddata.aadl 2 | AADL_ROOT = topsystem.allperiodicsampled 3 | 4 | OTHER_FILES = 5 | CLEANDIRS = rma_impl 6 | 7 | include $(srcdir)/../Makefile.common 8 | 9 | AVAILABLE_TARGETS= parse-aadl real 10 | 11 | -------------------------------------------------------------------------------- /examples/air/hello_2partitions/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/hello_world.aadl 2 | AADL_ROOT = hello.impl 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = hello_impl 7 | CLEANFILES = 8 | 9 | include $(srcdir)/../../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl air_conf c 12 | -------------------------------------------------------------------------------- /examples/uxv/minirocket/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/minirocket_system.aadl 2 | AADL_ROOT = 3 | 4 | AADL_LIB = -I$(srcdir)/../common 5 | 6 | include $(srcdir)/../../Makefile.common 7 | 8 | AVAILABLE_TARGETS= parse-aadl 9 | 10 | OTHER_FILES = $(srcdir)/minirocket_sw.aadl 11 | -------------------------------------------------------------------------------- /examples/uxv/traxsterv3/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/traxsterv3_system.aadl 2 | AADL_ROOT = 3 | 4 | AADL_LIB = -I$(srcdir)/../common 5 | 6 | include $(srcdir)/../../Makefile.common 7 | 8 | AVAILABLE_TARGETS= parse-aadl 9 | 10 | OTHER_FILES = $(srcdir)/traxsterv3_sw.aadl 11 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-mil1553.aadl: -------------------------------------------------------------------------------- 1 | -- This package models MIL1553 bus 2 | 3 | package Buses::MIL1553 4 | public 5 | with Bus_Properties; 6 | 7 | bus MIL1553 8 | properties 9 | Bus_Properties::Available_Bandwidth => (125 KBytesps); 10 | end MIL1553; 11 | 12 | end Buses::MIL1553; 13 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/openocd-usb.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # Hubert Hoegl's USB to JTAG 3 | # 4 | # http://www.hs-augsburg.de/~hhoegl/proj/usbjtag/usbjtag.html 5 | # 6 | 7 | interface ft2232 8 | ft2232_vid_pid 0x0403 0x6010 9 | ft2232_device_desc "Dual RS232" 10 | ft2232_layout "oocdlink" 11 | ft2232_latency 2 12 | -------------------------------------------------------------------------------- /examples/uxv/quadrirotorv1/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/quadrirotorv1_system.aadl 2 | AADL_ROOT = 3 | 4 | AADL_LIB = -I$(srcdir)/../common 5 | 6 | include $(srcdir)/../../Makefile.common 7 | 8 | AVAILABLE_TARGETS= parse-aadl 9 | 10 | OTHER_FILES = $(srcdir)/quadrirotorv1_sw.aadl 11 | -------------------------------------------------------------------------------- /examples/aocs/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/aocs.aadl 2 | AADL_ROOT = aocs_subsystem.impl 3 | 4 | OTHER_FILES = $(srcdir)/dataaocs.aadl $(srcdir)/hardware_aocs.aadl \ 5 | $(srcdir)/software_aocs.aadl 6 | 7 | include $(srcdir)/../Makefile.common 8 | 9 | AVAILABLE_TARGETS= parse-aadl 10 | 11 | -------------------------------------------------------------------------------- /examples/uxv/quadrirotorv0/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/quadrirotorv0_system.aadl 2 | AADL_ROOT = 3 | 4 | AADL_LIB = -I$(srcdir)/../common 5 | 6 | include $(srcdir)/../../Makefile.common 7 | 8 | AVAILABLE_TARGETS= parse-aadl 9 | 10 | OTHER_FILES = $(srcdir)/quadrirotorv0_sw.aadl 11 | 12 | -------------------------------------------------------------------------------- /examples/ping_spark/README.md: -------------------------------------------------------------------------------- 1 | # ping_spark 2 | 3 | This example shows how to generate SPARK2014 compliant code using 4 | Ocarina, and how to prove it. 5 | 6 | An extra target `prove` is provided by this example to invoke 7 | GNATProve on the generate code. 8 | 9 | Note: this example has been tested using GNATProve CE2020. -------------------------------------------------------------------------------- /examples/producer_consumer/producer_consumer.ads: -------------------------------------------------------------------------------- 1 | with PolyORB_HI_Generated.Types; use PolyORB_HI_Generated.Types; 2 | 3 | package Producer_Consumer is 4 | 5 | procedure Produce_Spg (Data_Source : out Alpha_Type); 6 | 7 | procedure Consume_Spg (Data_Sink : Alpha_Type); 8 | 9 | end Producer_Consumer; 10 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-arinc_429.aadl: -------------------------------------------------------------------------------- 1 | -- This package models ARINC 429 bus 2 | 3 | package Buses::ARINC_429 4 | public 5 | with Bus_Properties; 6 | 7 | bus ARINC_429 8 | properties 9 | Bus_Properties::Available_Bandwidth => (12 KBytesps, 1562 KBytesps); 10 | end ARINC_429; 11 | 12 | end Buses::ARINC_429; 13 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-can.aadl: -------------------------------------------------------------------------------- 1 | -- This package models CAN bus 2 | 3 | package Buses::CAN 4 | public 5 | with Bus_Properties; 6 | 7 | bus CAN 8 | properties 9 | Bus_Properties::Available_Bandwidth => 10 | (20 KBytesps, 100 KBytesps, 500 KBytesps, 1 MBytesps); 11 | end CAN; 12 | 13 | end Buses::CAN; 14 | -------------------------------------------------------------------------------- /examples/minepump_ba/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/minepump_ba.aadl 2 | AADL_ROOT = minepump.impl 3 | 4 | OTHER_FILES = $(srcdir)/simu.c $(srcdir)/simu.h 5 | 6 | CLEANDIRS = minepump_impl 7 | CLEANFILES = *.lnt demo.svl 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl c 12 | -------------------------------------------------------------------------------- /examples/producer_consumer_ba/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/producer_consumer_ba.aadl 2 | AADL_ROOT = pc_simple.native 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = pc_simple_native 7 | CLEANFILES = *.lnt demo.svl 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl build_c 12 | 13 | -------------------------------------------------------------------------------- /examples/stm32discovery_ada/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/stm32discovery_ada.aadl 2 | AADL_ROOT = blinky.impl 3 | 4 | OTHER_FILES = $(srcdir)/blink.ads $(srcdir)/blink.adb 5 | 6 | CLEANDIRS = blinky_impl 7 | CLEANFILES = 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl ada 12 | -------------------------------------------------------------------------------- /examples/time_triggered/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/time_triggered.aadl 2 | AADL_ROOT = tt.impl 3 | 4 | OTHER_FILES = \ 5 | $(srcdir)/tt.adb \ 6 | $(srcdir)/tt.ads 7 | 8 | CLEANDIRS = tt_impl 9 | 10 | include $(srcdir)/../Makefile.common 11 | 12 | AVAILABLE_TARGETS= parse-aadl real cheddar build_ada 13 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-afdx.aadl: -------------------------------------------------------------------------------- 1 | -- This package models AFDX bus 2 | 3 | package Buses::AFDX 4 | public 5 | with Buses::Ethernet; 6 | 7 | bus AFDX extends Buses::Ethernet::Ethernet 8 | properties 9 | Transmission_Time => [ Fixed => 0 ms .. 10ms; PerByte => 0 ms .. 10 ms; ]; 10 | end AFDX; 11 | 12 | end Buses::AFDX; 13 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/stm32f4discovery.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32F4 discovery board with a single STM32F407VGT6 chip. 2 | # http://www.st.com/internet/evalboard/product/252419.jsp 3 | 4 | source [find interface/stlink-v2.cfg] 5 | 6 | transport select hla_swd 7 | 8 | source [find target/stm32f4x.cfg] 9 | 10 | reset_config srst_only 11 | -------------------------------------------------------------------------------- /src/real/deployment.real: -------------------------------------------------------------------------------- 1 | theorem check_deployment 2 | foreach d in Device_Set do 3 | CPU = { p in Processor_Set | Is_Bound_To (p, d) }; 4 | -- Processors d is bound-to 5 | 6 | check (Is_In (property (d, "Supported_Execution_Platform"), 7 | property (CPU, "Execution_Platform"))); 8 | 9 | end check_deployment; -------------------------------------------------------------------------------- /examples/ahrs_discovery/src/hardware.h: -------------------------------------------------------------------------------- 1 | #ifndef STM32_HARDWARE_H_ 2 | #define STM32_HARDWARE_H_ 3 | 4 | void SystemClock_Config(void); 5 | void MX_GPIO_Init(void); 6 | void MX_I2C1_Init(void); 7 | void MX_SPI1_Init(void); 8 | void MX_USART2_UART_Init(void); 9 | 10 | void init_hardware(void); 11 | 12 | #endif /* STM32_HARDWARE_H_ */ 13 | -------------------------------------------------------------------------------- /examples/behavior_annex/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES= $(srcdir)/ba_example1.aadl $(srcdir)/ba_example2.aadl \ 2 | $(srcdir)/ba_example3.aadl $(srcdir)/ba_example4.aadl \ 3 | $(srcdir)/ba_example5.aadl $(srcdir)/ba_example6.aadl \ 4 | $(srcdir)/ba_example7.aadl 5 | 6 | include $(srcdir)/../Makefile.common 7 | 8 | AVAILABLE_TARGETS= parse-aadl 9 | -------------------------------------------------------------------------------- /examples/minepump/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/minepump.aadl 2 | AADL_ROOT = minepump.impl 3 | 4 | OTHER_FILES = $(srcdir)/minepump.c $(srcdir)/simu.c $(srcdir)/simu.h 5 | 6 | CLEANDIRS = minepump_impl 7 | CLEANFILES = *.lnt demo.svl 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl c 12 | -------------------------------------------------------------------------------- /examples/producer_consumer_ba/devicesconf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __po_hi_c_ip_conf_t pohidrv_device_a = { .devname = "eth0", .address = "127.0.0.1", .version = __po_hi_c_ipv4, .port = 1234}; 4 | __po_hi_c_ip_conf_t pohidrv_device_b = { .devname = "eth0", .address = "127.0.0.1", .version = __po_hi_c_ipv4, .port = 1235}; 5 | -------------------------------------------------------------------------------- /examples/producer_consumer_ba2/devicesconf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __po_hi_c_ip_conf_t pohidrv_device_a = { .devname = "eth0", .address = "127.0.0.1", .version = __po_hi_c_ipv4, .port = 1234}; 4 | __po_hi_c_ip_conf_t pohidrv_device_b = { .devname = "eth0", .address = "127.0.0.1", .version = __po_hi_c_ipv4, .port = 1235}; 5 | -------------------------------------------------------------------------------- /examples/producer_consumer_ba_many_transitions/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/producer_consumer_ba_v3.aadl 2 | AADL_ROOT = pc_simple.native 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = pc_simple_native 7 | CLEANFILES = *.lnt demo.svl 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl build_c 12 | 13 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-usb.aadl: -------------------------------------------------------------------------------- 1 | -- This package models USB bus 2 | 3 | package Buses::USB 4 | public 5 | with Bus_Properties; 6 | 7 | bus USB 8 | properties 9 | Bus_Properties::Available_Bandwidth => 10 | (1_500 KBytesps); 11 | end USB; 12 | 13 | bus implementation USB.impl 14 | end USB.impl; 15 | 16 | end Buses::USB; 17 | -------------------------------------------------------------------------------- /examples/air/ping/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/ping-air.aadl 2 | AADL_ROOT = ping.ima 3 | 4 | OTHER_FILES = $(srcdir)/air_polling.c $(srcdir)/ping.c $(srcdir)/ping.h $(srcdir)/software.aadl 5 | 6 | CLEANDIRS = ping_ima 7 | CLEANFILES = 8 | 9 | include $(srcdir)/../../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl air_conf c 12 | -------------------------------------------------------------------------------- /examples/satellite/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/satellite_system.aadl 2 | AADL_ROOT = obmu.impl 3 | 4 | OTHER_FILES = $(srcdir)/satellite_software.aadl \ 5 | $(srcdir)/satellite_hardware.aadl 6 | 7 | CLEANDIRS = 8 | CLEANFILES = 9 | 10 | include $(srcdir)/../Makefile.common 11 | 12 | AVAILABLE_TARGETS= parse-aadl cheddar mast stats 13 | -------------------------------------------------------------------------------- /examples/producer_consumer_ba_many_transitions/devicesconf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __po_hi_c_ip_conf_t pohidrv_device_a = { .devname = "eth0", .address = "127.0.0.1", .version = __po_hi_c_ipv4, .port = 1234}; 4 | __po_hi_c_ip_conf_t pohidrv_device_b = { .devname = "eth0", .address = "127.0.0.1", .version = __po_hi_c_ipv4, .port = 1235}; 5 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/include/eigen_math.h: -------------------------------------------------------------------------------- 1 | /* 2 | * eigen_math.h 3 | * 4 | * Created on: Aug 25, 2014 5 | * Author: roman 6 | */ 7 | 8 | #ifndef EIGEN_MATH_H_ 9 | #define EIGEN_MATH_H_ 10 | 11 | 12 | struct eigen_matrix_instance { 13 | int numRows; 14 | int numCols; 15 | float *pData; 16 | }; 17 | 18 | 19 | #endif /* EIGEN_MATH_H_ */ 20 | -------------------------------------------------------------------------------- /examples/line_follower/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/robot_lf.aadl 2 | AADL_ROOT = line_follower_robot.i 3 | 4 | OTHER_FILES = \ 5 | $(srcdir)/robot.c \ 6 | $(srcdir)/software_lf.aadl 7 | 8 | include $(srcdir)/../Makefile.common 9 | 10 | AVAILABLE_TARGETS= parse-aadl real 11 | 12 | distclean-local: 13 | -rm -rf line_follower_robot_i 14 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | AADLib started as a Master project done by 2 | 3 | Abaouz Hamouche 4 | 5 | and is coordinated by 6 | 7 | Jerome Hugues 8 | 9 | Contributions from various people who contributed examples and 10 | components for the library are acknowledged in the corresponding AADL 11 | examples and packages. -------------------------------------------------------------------------------- /examples/producer_consumer_ba_4ports_manyDispatchTriggers/devicesconf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __po_hi_c_ip_conf_t pohidrv_device_a = { .devname = "eth0", .address = "127.0.0.1", .version = __po_hi_c_ipv4, .port = 1234}; 4 | __po_hi_c_ip_conf_t pohidrv_device_b = { .devname = "eth0", .address = "127.0.0.1", .version = __po_hi_c_ipv4, .port = 1235}; 5 | -------------------------------------------------------------------------------- /examples/radar/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/radar.aadl 2 | AADL_ROOT = radar.simple 3 | 4 | OTHER_FILES = \ 5 | $(srcdir)/radar_types.aadl \ 6 | $(srcdir)/radar.ads \ 7 | $(srcdir)/radar.adb 8 | 9 | CLEANDIRS = radar_simple 10 | 11 | include $(srcdir)/../Makefile.common 12 | 13 | AVAILABLE_TARGETS= parse-aadl real build_ada lnt 14 | 15 | -------------------------------------------------------------------------------- /examples/producer_consumer_ba2/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/producer_consumer_ba_v2.aadl 2 | AADL_ROOT = pc_simple.native 3 | 4 | OTHER_FILES = $(srcdir)/using-types-defined-by-base_types.aadl 5 | 6 | CLEANDIRS = pc_simple_native 7 | CLEANFILES = *.lnt demo.svl 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl build_c 12 | -------------------------------------------------------------------------------- /examples/producer_consumer_ba/producer_consumer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void print_spg 5 | (producer__consumer__alpha_type a_data_in) { 6 | 7 | printf("%d\n", a_data_in); 8 | fflush(stdout); 9 | } 10 | 11 | void consume_spg (producer__consumer__alpha_type data) 12 | { 13 | printf ("Consume %d\n", data); 14 | fflush(stdout); 15 | } 16 | -------------------------------------------------------------------------------- /examples/rma/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/rma.aadl 2 | AADL_ROOT = rma.impl 3 | 4 | OTHER_FILES = $(srcdir)/hello.c 5 | 6 | CLEANDIRS = rma_impl 7 | CLEANFILES = rma_impl_aadl_xml.xml 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl real cheddar mast aadl_xml build_ada \ 12 | build_c petri bound-t alloy stats subprograms 13 | -------------------------------------------------------------------------------- /examples/producer_consumer_ba_4ports_manyDispatchTriggers/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/producer_consumer_ba_4ports_manyDispatchTriggers.aadl 2 | AADL_ROOT = pc_simple.native 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = pc_simple_native 7 | CLEANFILES = *.lnt demo.svl 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl build_c 12 | 13 | -------------------------------------------------------------------------------- /examples/ping_spark/pinged.adb: -------------------------------------------------------------------------------- 1 | with PolyORB_HI.Output; 2 | 3 | package body Pinged is 4 | 5 | use PolyORB_HI.Output; 6 | 7 | -------------- 8 | -- Ping_Spg -- 9 | -------------- 10 | 11 | procedure Ping_Spg (Data_Sink : Simple_Type) is 12 | begin 13 | Put_Line ("*** PING ***" & Simple_Type'Image (Data_Sink)); 14 | end Ping_Spg; 15 | 16 | end Pinged; 17 | -------------------------------------------------------------------------------- /examples/stm32discovery_ada/blink.adb: -------------------------------------------------------------------------------- 1 | with STM32.Board; use STM32.Board; 2 | 3 | package body Blink is 4 | 5 | Blink_On : Boolean := True; 6 | 7 | procedure Do_Blink is 8 | begin 9 | if Blink_On then 10 | All_LEDs_On; 11 | else 12 | All_LEDs_Off; 13 | end if; 14 | Blink_On := not Blink_On; 15 | end Do_Blink; 16 | 17 | end Blink; 18 | -------------------------------------------------------------------------------- /examples/time_triggered/tt.ads: -------------------------------------------------------------------------------- 1 | with PolyORB_HI_Generated.Types; use PolyORB_HI_Generated.Types; 2 | 3 | package TT is 4 | 5 | procedure B0_Send (Out_Value : out Simple_Type); 6 | 7 | procedure B1_Receive_Send (Out_Value : out Simple_Type; 8 | In_Value : Simple_Type); 9 | 10 | procedure B2_Receive (In_Value : Simple_Type); 11 | 12 | end TT; 13 | -------------------------------------------------------------------------------- /examples/pathfinder_system/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/mars_pathfinder.aadl 2 | AADL_ROOT = sys_mars_pathfinder.impl 3 | 4 | OTHER_FILES = \ 5 | $(srcdir)/pathfinder_software.aadl \ 6 | $(srcdir)/pathfinder_hardware.aadl 7 | 8 | CLEANDIRS = 9 | CLEANFILES = 10 | 11 | include $(srcdir)/../Makefile.common 12 | 13 | AVAILABLE_TARGETS= parse-aadl real cheddar mast aadl_xml 14 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = no-dependencies 2 | ACLOCAL_AMFLAGS = -I support 3 | CLEANFILES = config-stamp 4 | 5 | SUBDIRS = src examples 6 | DIST_SUBDIRS = $(SUBDIRS) 7 | 8 | clean-local: 9 | -rm -rf *~ ocarina_out 10 | 11 | EXTRA_DIST = $(srcdir)/README.md 12 | 13 | # We disable checking of the distclean rule, it is a nuisance 14 | distcleancheck: 15 | @: 16 | 17 | distuninstallcheck: 18 | @: 19 | -------------------------------------------------------------------------------- /examples/rosace/common/README: -------------------------------------------------------------------------------- 1 | Shared code/file for the ROSACE use case 2 | 3 | This part of the code is "shared" by the various implementation 4 | namelly, POSIX, XtratuM, RTEMS and TASTE (generated from AADL specs). 5 | 6 | A Makefile allows users to compute WCET for all functions, to be used 7 | with Bound-T for SPARC LEON3 processors. wcet.txt provides reference 8 | output, unit is number of instructions cycles. 9 | -------------------------------------------------------------------------------- /examples/car/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/car.aadl 2 | AADL_ROOT = car.impl 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | 8 | include $(srcdir)/../Makefile.common 9 | 10 | AVAILABLE_TARGETS= parse-aadl real cheddar mast aadl_xml 11 | 12 | pouet: 13 | ocarina -y -g real_theorem -aadlv2 -real_lib $(top_srcdir)/src/real/ravenscar_theorems.real -real_theorem check_pcp -r rma.impl $(AADL_SOURCES) 14 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-afdx.aadl: -------------------------------------------------------------------------------- 1 | -- This package models a generic AFDX device, to be later refined 2 | 3 | package Devices::AFDX 4 | public 5 | with Buses::AFDX; 6 | 7 | ------------------ 8 | -- Generic_AFDX -- 9 | ------------------ 10 | 11 | device Generic_AFDX 12 | features 13 | AFDX_Phy : requires bus access Buses::AFDX::AFDX; 14 | end Generic_AFDX; 15 | 16 | end Devices::AFDX; 17 | 18 | -------------------------------------------------------------------------------- /examples/uxv/emaxxv2/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/emaxxv2_system.aadl 2 | AADL_ROOT = emaxxv2.impl 3 | 4 | AADL_LIB = -I$(srcdir)/../common 5 | 6 | include $(srcdir)/../../Makefile.common 7 | 8 | AVAILABLE_TARGETS= parse-aadl 9 | 10 | OTHER_FILES = $(srcdir)/emaxxv2_sw.aadl 11 | 12 | real2: 13 | $(OCARINA) $(OCARINA_FLAGS) -g real_theorem \ 14 | -real_lib $(srcdir)/../lib.real \ 15 | $(AADL_SOURCES) 16 | -------------------------------------------------------------------------------- /src/aadl/buses/protocols.aadl: -------------------------------------------------------------------------------- 1 | -- This package models protocols layers 2 | 3 | package Protocols 4 | public 5 | 6 | -- Application protocols are modeled as AADLv2 virtual bus 7 | -- components, and then stacked. Each protocol 8 | 9 | ---------------------- 10 | -- Generic_Protocol -- 11 | ---------------------- 12 | 13 | virtual bus Generic_Protocol 14 | end Generic_Protocol; 15 | 16 | end Protocols; 17 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-mpxv7002dp.aadl: -------------------------------------------------------------------------------- 1 | package devices::MPXV7002DP 2 | public 3 | 4 | with Electricity_Properties; 5 | with Data_Sheet; 6 | 7 | device MPXV7002DP 8 | properties 9 | Data_Sheet::UUID => "http://store.diydrones.com/product_p/br-0002-10.htm"; 10 | 11 | Electricity_Properties::Core_Voltage => 5.25 v; 12 | Electricity_Properties::run_current => 10.0 mA; 13 | end MPXV7002DP; 14 | 15 | end devices::MPXV7002DP; -------------------------------------------------------------------------------- /src/aadl/devices/devices-spi.aadl: -------------------------------------------------------------------------------- 1 | package Devices::SPI 2 | public 3 | 4 | device SPI_Pins 5 | features 6 | MISO : in event port; -- Master Input, Slave Output 7 | MOSI : out event port; -- Master Output, Slave Input 8 | SCLK : in out event port; -- Serial Clock 9 | SS : in out event port; -- Slave select 10 | RST : in event port; -- Reset 11 | end SPI_Pins; 12 | 13 | end Devices::SPI; 14 | -------------------------------------------------------------------------------- /examples/perseus/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/perseus.aadl 2 | AADL_ROOT = perseus_rocket.impl1 3 | 4 | OTHER_FILES = 5 | 6 | CLEANDIRS = 7 | CLEANFILES = 8 | 9 | include $(srcdir)/../Makefile.common 10 | 11 | AVAILABLE_TARGETS= parse-aadl 12 | 13 | real: 14 | ocarina -y -g real_theorem -aadlv2 -I$(top_srcdir)/src/property_set -real_lib $(srcdir)/lib.real -real_theorem check_perseus -r $(AADL_ROOT) $(AADL_SOURCES) 15 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/src/stm32_mavlink.h: -------------------------------------------------------------------------------- 1 | 2 | #ifdef STM32_MAVLINK_H_ 3 | #define STM32_MAVLINK_H_ 4 | 5 | struct mavlink_message_t; 6 | 7 | int stm32_mavlink_write_message(const mavlink_message_t* msg); 8 | void stm32_emit_heartbeat(); 9 | void stm32_emit_raw_imu(float rates[3], int16_t acc[3]); 10 | void stm32_emit_ping(int seq); 11 | 12 | void stm32_recv_message(mavlink_message_t* msg); 13 | 14 | #endif /* STM32_MAVLINK_H_ */ 15 | -------------------------------------------------------------------------------- /examples/air/ping/ping.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int p=0; 4 | 5 | void user_do_ping_spg (int *v) 6 | { 7 | printf ("*** SENDING PING *** %d\n", p); 8 | *v=p; 9 | p++; 10 | fflush (stdout); 11 | } 12 | 13 | void user_ping_spg (int i) 14 | { 15 | printf ("*** PING *** %d\n" ,i); 16 | fflush (stdout); 17 | } 18 | 19 | void recover (void) 20 | { 21 | printf ("*** RECOVER ACTION ***\n"); 22 | fflush (stdout); 23 | } 24 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-pci.aadl: -------------------------------------------------------------------------------- 1 | -- This package models PCI bus 2 | 3 | package Buses::PCI 4 | public 5 | with Bus_Properties; 6 | 7 | bus PCI 8 | properties 9 | Bus_Properties::Available_Bandwidth => 10 | (133 MBytesps, -- PCI 2.2 11 | 1066 MBytesps, -- PCI-X 12 | 2133 MBytesps -- PCI-X 2.0 13 | ); 14 | end PCI; 15 | 16 | bus implementation PCI.impl 17 | end PCI.impl; 18 | 19 | end Buses::PCI; 20 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-xyz_ir.aadl: -------------------------------------------------------------------------------- 1 | package devices::xyz_ir 2 | public 3 | 4 | 5 | with devices::thermopiles; 6 | with Data_Sheet; 7 | 8 | device XYZ_IR extends devices::thermopiles::MLX90247 9 | features 10 | out_XY : out event port; 11 | out_Z : out event port; 12 | Properties 13 | Data_Sheet::UUID => 14 | "http://paparazzi.enac.fr/wiki/Sensors/IR#Hardware_Architecture"; 15 | end XYZ_IR; 16 | 17 | 18 | end devices::xyz_ir; 19 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-i2c.aadl: -------------------------------------------------------------------------------- 1 | package Buses::I2C 2 | public 3 | with Bus_Properties; 4 | 5 | feature group I2C_Pins 6 | features 7 | SCL : in out event port; -- Clock line 8 | SDA : in out event port; -- Data line 9 | end I2C_Pins; 10 | 11 | bus I2C 12 | end I2C; 13 | 14 | bus implementation I2C.impl 15 | properties 16 | Bus_Properties::Bandwidth => 400_000 bitsps; 17 | end I2C.impl; 18 | 19 | end Buses::I2C; 20 | -------------------------------------------------------------------------------- /examples/rosace/common/io.h: -------------------------------------------------------------------------------- 1 | #ifndef __IO_H__ 2 | #define __IO_H__ 3 | 4 | typedef unsigned long long uint64_t; 5 | 6 | struct aircraft_dynamics_outs_t { 7 | float Va; 8 | float Vz; 9 | float q; 10 | float az; 11 | float h; 12 | }; 13 | 14 | typedef struct { 15 | struct aircraft_dynamics_outs_t sig_outputs; 16 | uint64_t t_simu; 17 | float sig_delta_th_c; 18 | float sig_delta_e_c; 19 | } output_t; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /share/emacs/README: -------------------------------------------------------------------------------- 1 | An AADL mode for emacs 2 | ====================== 3 | 4 | This mode provides support for 5 | 6 | syntax highlighting 7 | auto indentation of code 8 | 9 | Installation 10 | ------------ 11 | 12 | To load this emacs mode, you need to add the following line to your configuration file (usually located in ~/.emacs) : 13 | 14 | (load "/path/to/this/file.el") 15 | 16 | For more details on this mode, please refer to the emacs contextual help. 17 | -------------------------------------------------------------------------------- /examples/multicore/messages.aadl: -------------------------------------------------------------------------------- 1 | package Messages 2 | public 3 | 4 | data InitializationMsg 5 | properties 6 | Source_Language => (C); 7 | Type_Source_Name => "initmsg"; 8 | Source_Text => ("MsgType"); 9 | end InitializationMsg; 10 | 11 | data BusMessage 12 | properties 13 | Source_Language => (C); 14 | Type_Source_Name => "busmsg"; 15 | Source_Text => ("MsgType"); 16 | end BusMessage; 17 | 18 | end Messages; -------------------------------------------------------------------------------- /examples/multicore/devicesconf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __po_hi_c_ip_conf_t pohidrv_l0 = {"lo","127.0.0.1","","","","",__po_hi_c_ipv4, 4000,{0,0,0,0,0}}; 4 | __po_hi_c_ip_conf_t pohidrv_l1 = {"lo","127.0.0.1","","","","",__po_hi_c_ipv4, 4001,{0,0,0,0,0}}; 5 | __po_hi_c_ip_conf_t pohidrv_l2 = {"lo","127.0.0.1","","","","",__po_hi_c_ipv4, 4002,{0,0,0,0,0}}; 6 | __po_hi_c_ip_conf_t pohidrv_l3 = {"lo","127.0.0.1","","","","",__po_hi_c_ipv4, 4003,{0,0,0,0,0}}; 7 | 8 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-spacewire.aadl: -------------------------------------------------------------------------------- 1 | package Buses::SpaceWire 2 | public 3 | with Bus_Properties; 4 | 5 | feature group LVDS 6 | --features 7 | -- none; 8 | end LVDS; 9 | 10 | bus SpaceWire 11 | properties 12 | Bus_Properties::Channel_Type => Full_Duplex; 13 | Bus_Properties::Bandwidth_Scale => 2 MBytesps .. 400 MBytesps ; 14 | end SpaceWire; 15 | 16 | bus implementation SpaceWire.impl 17 | end SpaceWire.impl; 18 | 19 | end Buses::SpaceWire; 20 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-vme.aadl: -------------------------------------------------------------------------------- 1 | -- This package models VME bus 2 | 3 | package Buses::VME 4 | public 5 | with Bus_Properties; 6 | 7 | bus VME 8 | properties 9 | Bus_Properties::Available_Bandwidth => 10 | (40 MBytesps, -- VMEbus32, VMEbus IEEE-1014 11 | 80 MBytesps, -- VME64 12 | 160 MBytesps, -- VME64x 13 | 320 MBytesps -- VME320 14 | ); 15 | end VME; 16 | 17 | bus implementation VME.i 18 | end VME.i; 19 | 20 | end Buses::VME; 21 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/ahrs-systems.aadl 2 | 3 | AADL_ROOT = AHRS::Hardware::sbc_32f411ediscovery.rtos 4 | 5 | OTHER_FILES = $(srcdir)/ahrs-data_types.aadl \ 6 | $(srcdir)/ahrs-software.aadl $(srcdir)/ahrs-hardware.aadl \ 7 | $(srcdir)/ahrs-subprograms.aadl $(srcdir)/ahrs.aadl 8 | 9 | CLEANDIRS = sbc_32f411ediscovery_rtos 10 | 11 | CLEANFILES = 12 | 13 | include $(srcdir)/../Makefile.common 14 | 15 | AVAILABLE_TARGETS= parse-aadl c cheddar # run_cheddar 16 | -------------------------------------------------------------------------------- /examples/asl/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/asl.aadl 2 | AADL_ROOT = a_system.impl 3 | 4 | OTHER_FILES = $(srcdir)/constraints.real 5 | 6 | CLEANDIRS = 7 | 8 | include $(srcdir)/../Makefile.common 9 | 10 | AVAILABLE_TARGETS= parse-aadl real 11 | 12 | # Note: we overwrite the "real" target to match this project specific 13 | # constraints. 14 | 15 | real: 16 | -$(OCARINA) $(OCARINA_FLAGS) -g real_theorem \ 17 | -real_lib $(srcdir)/constraints.real \ 18 | -r $(AADL_ROOT) \ 19 | $(AADL_SOURCES) 20 | -------------------------------------------------------------------------------- /examples/fms/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/fms.aadl 2 | AADL_ROOT = fms.impl 3 | 4 | OTHER_FILES = $(srcdir)/afdx_properties.aadl $(srcdir)/fms.aadl \ 5 | $(srcdir)/m1_software.aadl $(srcdir)/m4_software.aadl \ 6 | $(srcdir)/subsystem.aadl $(srcdir)/datatype.aadl \ 7 | $(srcdir)/fms_hardware.aadl $(srcdir)/m3_software.aadl \ 8 | $(srcdir)/m2_software.aadl 9 | 10 | CLEANDIRS = 11 | CLEANFILES = 12 | 13 | include $(srcdir)/../Makefile.common 14 | 15 | AVAILABLE_TARGETS= parse-aadl 16 | -------------------------------------------------------------------------------- /examples/mjpeg/COLOR_METRICS.h: -------------------------------------------------------------------------------- 1 | // *********************************************************************** 2 | // 3 | // Filename : COLOR_METRICS.h 4 | // 5 | // Author : SpaceStudio generation engine 6 | // 7 | // Creation date : Tue Sep 24 10:38:50 EDT 2013 8 | // 9 | // 10 | // *********************************************************************** 11 | 12 | #ifndef COLOR_METRICS_H 13 | #define COLOR_METRICS_H 14 | 15 | 16 | 17 | 18 | // Thread 19 | void color(); 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /examples/rosace/rosace.aadl: -------------------------------------------------------------------------------- 1 | package ROSACE 2 | 3 | -- This package models the case study from "Pagetti, Claire and 4 | -- Saussie, David and Gratia, Romain and Noulard, Eric and Siron, 5 | -- Pierre "The ROSACE Case Study: From Simulink Specification to 6 | -- Multi/Many-Core Execution." (2014) In: Journees FAC - 7 | -- Formalisation des Activités Concurrentes, 16 April 2014 - 17 8 | -- April 2014 (Toulouse, France). 9 | 10 | public 11 | 12 | system ROSACE_System 13 | end ROSACE_System; 14 | 15 | end ROSACE; -------------------------------------------------------------------------------- /src/aadl/buses/buses-ethernet.aadl: -------------------------------------------------------------------------------- 1 | -- This package models Ethernet bus 2 | 3 | package Buses::Ethernet 4 | public 5 | with Bus_Properties; 6 | 7 | bus Ethernet 8 | properties 9 | Bus_Properties::Available_Bandwidth => 10 | (10 MBytesps, 100 MBytesps, 1 GBytesps); 11 | end Ethernet; 12 | 13 | bus implementation Ethernet.impl 14 | end Ethernet.impl; 15 | 16 | device Generic_Ethernet 17 | features 18 | Eth : requires bus access Ethernet.impl; 19 | end Generic_Ethernet; 20 | 21 | end Buses::Ethernet; 22 | -------------------------------------------------------------------------------- /examples/ping_spark/ping.adb: -------------------------------------------------------------------------------- 1 | with PolyORB_HI.Output; use PolyORB_HI.Output; 2 | 3 | package body Ping is 4 | 5 | Var : Simple_Type := 0; 6 | 7 | ----------------- 8 | -- Do_Ping_Spg -- 9 | ----------------- 10 | 11 | procedure Do_Ping_Spg (Data_Source : out Simple_Type) is 12 | begin 13 | if Var > 100 then 14 | Var := 0; 15 | end if; 16 | 17 | Var := Var + 1; 18 | 19 | Data_Source := Var; 20 | Put_Line ("Sending ORDER: ", Simple_Type'Image (Var)); 21 | end Do_Ping_Spg; 22 | 23 | end Ping; 24 | -------------------------------------------------------------------------------- /examples/rosace/app3_aadl.c: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "io.h" 3 | 4 | #include <../common/app3_code.c> 5 | 6 | void altitude_hold_aadl (float h_f, float h_c, float* output) { 7 | *output = altitude_hold (h_f, 10000.0 /*h_c*/); 8 | } 9 | 10 | void vz_control_aadl (float vz_f, float vz_c, float q_f, float az_f, float* output) { 11 | *output = Vz_control (vz_f, vz_c, q_f, az_f); 12 | } 13 | 14 | void va_control_aadl (float va_f, float vz_f, float q_f, float va_c, float* output) { 15 | *output = Va_control (va_f, vz_f, q_f, 230.0 /*va_c*/); 16 | } 17 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-ly530alh.aadl: -------------------------------------------------------------------------------- 1 | -- The LY530ALH device is a one-axis analogue gyrometer 2 | 3 | package Devices::LY530ALH 4 | public 5 | with Data_Sheet; 6 | with Unit; 7 | 8 | -------------- 9 | -- LY530ALH -- 10 | -------------- 11 | 12 | device LY530ALH 13 | features 14 | Theta_X : out data port Unit::Rotation; 15 | 16 | properties 17 | Data_Sheet::UUID => "http://www.sparkfun.com/products/9956"; 18 | end LY530ALH; 19 | 20 | device implementation LY530ALH.impl 21 | end LY530ALH.impl; 22 | 23 | end Devices::LY530ALH; 24 | -------------------------------------------------------------------------------- /support/gnu_make.m4: -------------------------------------------------------------------------------- 1 | # Automake macro for finding GNU make 2 | 3 | AC_DEFUN([AM_GNU_MAKE], 4 | [ 5 | AC_CHECK_PROGS(GNU_MAKE, [gmake gnumake make], no) 6 | 7 | AC_MSG_CHECKING(whether ${GNU_MAKE} is a GNU make) 8 | if test ! "x${GNU_MAKE}" = "xno"; then 9 | if ${GNU_MAKE} --version | head -1 | grep GNU >/dev/null 2>&1; then 10 | AC_MSG_RESULT(yes.) 11 | else 12 | GNU_MAKE="no" 13 | fi 14 | fi 15 | 16 | if test "x$GNU_MAKE" = "xno"; then 17 | AC_MSG_RESULT(no.) 18 | AC_MSG_ERROR([GNU Make has not been found on your system]) 19 | fi 20 | ]) -------------------------------------------------------------------------------- /examples/paparazzi/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/paparazzi_system.aadl 2 | AADL_ROOT = 3 | 4 | OTHER_FILES = $(srcdir)/flybywire_hard.aadl \ 5 | $(srcdir)/paparazzi_hard.aadl $(srcdir)/autopilot_hard.aadl \ 6 | $(srcdir)/flybywire_soft.aadl $(srcdir)/autopilot_soft.aadl \ 7 | $(srcdir)/flybywire_subsys.aadl \ 8 | $(srcdir)/paparazzi_subprograms.aadl \ 9 | $(srcdir)/autopilot_subsys.aadl $(srcdir)/papa_types.aadl 10 | 11 | CLEANDIRS = 12 | CLEANFILES = 13 | 14 | include $(srcdir)/../Makefile.common 15 | 16 | AVAILABLE_TARGETS= parse-aadl 17 | -------------------------------------------------------------------------------- /examples/ping_spark/msgs.adb: -------------------------------------------------------------------------------- 1 | with PolyORB_HI.Output; 2 | 3 | package body Msgs is 4 | 5 | use PolyORB_HI.Output; 6 | 7 | -------------------- 8 | -- Welcome_Pinger -- 9 | -------------------- 10 | 11 | procedure Welcome_Pinger is 12 | begin 13 | Put_Line ("Hello! This is the pinger thread starting"); 14 | end Welcome_Pinger; 15 | 16 | ------------- 17 | -- Recover -- 18 | ------------- 19 | 20 | procedure Recover is 21 | begin 22 | Put_Line ("Could not send message ! ***"); 23 | end Recover; 24 | 25 | end Msgs; 26 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-thermistors.aadl: -------------------------------------------------------------------------------- 1 | package devices::thermistors 2 | public 3 | 4 | With devices::resistances; 5 | with Electricity_Properties; 6 | 7 | device thermistor extends devices::resistances::Generic_Resistance 8 | features 9 | X : in out event port; 10 | Y : in out event port; 11 | 12 | properties 13 | Electricity_Properties::Max_Resistance => 4700.0 Kohms; 14 | Electricity_Properties::Thermistor_Type => PTC; 15 | Electricity_Properties::Resistance_Value => 24.0 KOhms; 16 | end thermistor; 17 | 18 | end devices::thermistors; -------------------------------------------------------------------------------- /src/property_set/os_properties.aadl: -------------------------------------------------------------------------------- 1 | -- This property set lists additional properties for virtual processors 2 | -- 3 | -- In AADLib, we assume that a virtual processor models the operating 4 | -- system services (scheduler, etc.). The processor component type is 5 | -- restricted to the hardware processor. 6 | 7 | property set OS_Properties is 8 | 9 | Hierarchical_Scheduler : inherit aadlboolean applies to (virtual processor); 10 | -- If set to true, then the corresponding OS supports hierarchy, 11 | -- e.g. IMA-like Operating system. 12 | 13 | end OS_Properties; 14 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/stlink-v2.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # STMicroelectronics ST-LINK/V2 in-circuit debugger/programmer 3 | # 4 | 5 | interface hla 6 | hla_layout stlink 7 | hla_device_desc "ST-LINK/V2" 8 | hla_vid_pid 0x0483 0x3748 9 | 10 | # Optionally specify the serial number of ST-LINK/V2 usb device. ST-LINK/V2 11 | # devices seem to have serial numbers with unreadable characters. ST-LINK/V2 12 | # firmware version >= V2.J21.S4 recommended to avoid issues with adapter serial 13 | # number reset issues. 14 | # eg. 15 | #hla_serial "\xaa\xbc\x6e\x06\x50\x75\xff\x55\x17\x42\x19\x3f" 16 | 17 | -------------------------------------------------------------------------------- /examples/mjpeg/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | mjpeg 4 | 5 | 6 | Plugin_Resources 7 | 8 | 9 | 10 | org.eclipse.xtext.ui.shared.xtextBuilder 11 | 12 | 13 | 14 | 15 | 16 | org.eclipse.xtext.ui.shared.xtextNature 17 | org.osate.core.aadlnature 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/property_set/memory_segment_properties.aadl: -------------------------------------------------------------------------------- 1 | property set Memory_Segment_Properties is 2 | 3 | Supported_Address_Kind: type enumeration 4 | (physical_as, logical_as, virtual_as, io_register_as); 5 | 6 | Address_Kind : Memory_Segment_Properties::Supported_Address_Kind 7 | applies to (memory); 8 | 9 | Supported_Segment_Kind : type enumeration (memory_segment, address_space); 10 | 11 | Segment_Kind : Memory_Segment_Properties::Supported_Segment_Kind 12 | applies to (memory); 13 | 14 | Page_Size : Size applies to (memory); 15 | 16 | end Memory_Segment_Properties; 17 | -------------------------------------------------------------------------------- /examples/rosace/app2_aadl.c: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "io.h" 3 | 4 | #include "../common/app2_code.c" 5 | 6 | void va_filter_aadl (float va, float* output) { 7 | *output = Va_filter (va); 8 | 9 | } 10 | 11 | void h_filter_aadl (float h, float* output) { 12 | *output = h_filter (h); 13 | 14 | } 15 | 16 | void az_filter_aadl (float az, float* output) { 17 | *output = az_filter (az); 18 | } 19 | 20 | void vz_filter_aadl (float vz, float* output) { 21 | *output = Vz_filter (vz); 22 | 23 | } 24 | 25 | void q_filter_aadl (float q, float* output) { 26 | *output = q_filter (q); 27 | } 28 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-thermopiles.aadl: -------------------------------------------------------------------------------- 1 | package devices::thermopiles 2 | public 3 | 4 | with Data_Sheet; 5 | with devices::thermistors; 6 | 7 | device MLX90247 extends devices::Thermistors::Thermistor 8 | features 9 | pin1 : in out event port; 10 | pin2 : in out event port; 11 | pin3 : in out event port; 12 | pin4 : in out event port; 13 | properties 14 | Data_Sheet::UUID => 15 | "http://www.digikey.com/product-detail/en/TMP006AIYZFR/296-28819-2-ND/2672544"; 16 | end MLX90247; 17 | 18 | device implementation MLX90247.impl 19 | 20 | end MLX90247.impl; 21 | 22 | end devices::thermopiles; -------------------------------------------------------------------------------- /examples/multicore/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/avionicsbusmanagers.aadl 2 | AADL_ROOT = avionicsbusmgr.xps8500 3 | 4 | OTHER_FILES = $(srcdir)/BCMgr.c $(srcdir)/busmgr0.aadl \ 5 | $(srcdir)/M0RTMgr.c $(srcdir)/M1RTMgr.c $(srcdir)/M2RTMgr.c \ 6 | $(srcdir)/messages.aadl $(srcdir)/MsgType.h \ 7 | $(srcdir)/rtbusmgr1.aadl $(srcdir)/rtbusmgr0.aadl \ 8 | $(srcdir)/rtbusmgr2.aadl $(srcdir)/devicesconf.c \ 9 | $(srcdir)/network.aadl 10 | 11 | CLEANDIRS = avionicsbusmgr_xps8500 12 | CLEANFILES = 13 | 14 | include $(srcdir)/../Makefile.common 15 | 16 | AVAILABLE_TARGETS= parse-aadl build_c 17 | -------------------------------------------------------------------------------- /examples/ardupilot/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/main_Ardupilot.aadl 2 | AADL_ROOT = ardupilot_shield.impl 3 | 4 | OTHER_FILES = \ 5 | $(srcdir)/ardupilot_platform.aadl \ 6 | $(srcdir)/ardupilot_software.aadl \ 7 | $(srcdir)/flt-mgmt.c \ 8 | $(srcdir)/gps.c \ 9 | $(srcdir)/throttle.c \ 10 | $(srcdir)/userdefined.mk \ 11 | $(srcdir)/yaw.c 12 | 13 | include $(srcdir)/../Makefile.common 14 | 15 | AVAILABLE_TARGETS= parse-aadl real 16 | # build_c: probleme pour prendre en compte userdefined.mk lors d'un distcheck 17 | 18 | distclean-local: 19 | -rm -rf ardupilot_i 20 | -------------------------------------------------------------------------------- /examples/tetris/arrival.ads: -------------------------------------------------------------------------------- 1 | package Arrival is 2 | pragma Elaborate_Body; 3 | 4 | task Manager is -- Starts the dropping bricks 5 | pragma Priority(8); 6 | entry Tick; 7 | entry Start; 8 | entry Stop; 9 | end Manager; 10 | 11 | task Timer is -- Timing between events 12 | pragma Priority(6); 13 | entry Start; 14 | entry Stop; 15 | end Timer; 16 | 17 | task Speeder is -- Picks up the pace after certain time 18 | pragma Priority(7); 19 | entry Start; 20 | entry Stop; 21 | end Speeder; 22 | 23 | end Arrival; 24 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-lpr530al.aadl: -------------------------------------------------------------------------------- 1 | -- The LPR530AL device is a two-axis analogue gyrometer 2 | 3 | package Devices::LPR530AL 4 | public 5 | with Data_Sheet; 6 | with Unit; 7 | 8 | -------------- 9 | -- LPR530AL -- 10 | -------------- 11 | 12 | device LPR530AL 13 | features 14 | Theta_X : out data port Unit::Rotation; 15 | Theta_Y : out data port Unit::Rotation; 16 | 17 | properties 18 | Data_Sheet::UUID => 19 | "http://www.sparkfun.com/products/9956"; 20 | end LPR530AL; 21 | 22 | device implementation LPR530AL.impl 23 | end LPR530AL.impl; 24 | 25 | end Devices::LPR530AL; 26 | -------------------------------------------------------------------------------- /examples/ardupilot/gps.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "types.h" 4 | 5 | float glob_longitude = 1.4; 6 | float glob_latitude = 2.5; 7 | int glob_altitude = 3; 8 | 9 | void gps_simulation (ardupilot_software__gps_position_i* pos) 10 | { 11 | pos->altitude = glob_altitude; 12 | pos->latitude = glob_latitude; 13 | pos->longitude = glob_longitude; 14 | 15 | printf ("[GPS] Simulate latitude %f, longitude %f\n", 16 | pos->latitude, pos->longitude); 17 | 18 | } 19 | 20 | void gps_backdoor (float yaw) 21 | { 22 | glob_longitude += sin(yaw)/20.0; 23 | glob_latitude += cos(yaw)/20.0; 24 | } 25 | -------------------------------------------------------------------------------- /examples/tetris/screen.ads: -------------------------------------------------------------------------------- 1 | package Screen is 2 | 3 | -- simple ANSI terminal emulator 4 | -- Michael Feldman, The George Washington University 5 | -- July, 1995 6 | 7 | ScreenHeight : constant Integer := 24; 8 | ScreenWidth : constant Integer := 80; 9 | 10 | subtype Height is Integer range 1..ScreenHeight; 11 | subtype Width is Integer range 1..ScreenWidth; 12 | 13 | type Position is record 14 | Row : Height := 1; 15 | Column: Width := 1; 16 | end record; 17 | 18 | procedure Beep; 19 | 20 | procedure ClearScreen; 21 | 22 | procedure MoveCursor (To: in Position); 23 | 24 | end Screen; 25 | -------------------------------------------------------------------------------- /examples/tetris/bricks.ads: -------------------------------------------------------------------------------- 1 | with Wall; 2 | package Bricks is 3 | pragma Elaborate_Body; 4 | 5 | function Finished return Boolean; 6 | 7 | task Move is -- User moves bricks according to key pressed 8 | pragma Priority(5); 9 | entry Start; 10 | entry Put(X : in Wall.Width; 11 | Y : in Wall.Height; 12 | Brick : in Wall.Brick_Type; 13 | Done : out Boolean); 14 | entry Right; 15 | entry Left; 16 | entry Rotation; 17 | entry Drop(Ok : out Boolean); 18 | entry Stop; 19 | end Move; 20 | 21 | end Bricks; 22 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/ahrs-data_types.aadl: -------------------------------------------------------------------------------- 1 | package AHRS::Data_Types 2 | 3 | -- This package models the data type of the AHRS case study. 4 | 5 | public 6 | 7 | -- For these types, we directly map to PolyORB-HI/C types 8 | 9 | data UINT32_TYPE_AADL 10 | properties 11 | Type_Source_Name => "__po_hi_uint32_t"; 12 | Source_Text => ("types"); 13 | Data_Size => 4 Bytes; 14 | end UINT32_TYPE_AADL; 15 | 16 | 17 | data FLOAT32_TYPE_AADL 18 | properties 19 | Type_Source_Name => "__po_hi_float32_t"; 20 | Source_Text => ("types"); 21 | Data_Size => 4 Bytes; 22 | end FLOAT32_TYPE_AADL; 23 | 24 | end AHRS::Data_Types; -------------------------------------------------------------------------------- /src/aadl/devices/devices-battery_14v_4ah.aadl: -------------------------------------------------------------------------------- 1 | package devices::battery_14v_4ah 2 | public 3 | 4 | with buses::misc; 5 | with Electricity_Properties; 6 | 7 | ----------------- 8 | -- DEVICE -- 9 | ----------------- 10 | device BAT_14V_4AH 11 | features 12 | Power_out : requires bus access buses::misc::VBat_bus.impl; 13 | end BAT_14V_4AH; 14 | device implementation BAT_14V_4AH.impl 15 | properties 16 | Electricity_Properties::Max_Current => 40000.0 mA; -- 10C max 17 | Electricity_Properties::Run_Current => 0.0 A; 18 | Electricity_Properties::Core_Voltage => 14.0 V; 19 | end BAT_14V_4AH.impl; 20 | 21 | end devices::battery_14v_4ah; 22 | -------------------------------------------------------------------------------- /src/property_set/arinc653_extended.aadl: -------------------------------------------------------------------------------- 1 | property set ARINC653_Extended is 2 | 3 | Access_Type : list of ARINC653_Extended::Supported_Access_Type_Ext 4 | applies to (memory); 5 | -- Access_Type : Supported_Access_Type applies to (memory); 6 | 7 | Memory_Kind : ARINC653_Extended::Supported_Memory_Kind_Ext 8 | applies to (memory); 9 | 10 | Supported_Memory_Kind_Ext : type enumeration 11 | (text, stack, heap, bss, data_seg, image, memory_system_pool); 12 | 13 | Supported_Access_Type_Ext : type enumeration 14 | (read, write, write_once, slow_write, limited_write_cycles, execute); 15 | 16 | end ARINC653_Extended; 17 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-battery_7v2_4a5h.aadl: -------------------------------------------------------------------------------- 1 | package devices::battery_7v2_4a5h 2 | public 3 | 4 | with buses::misc; 5 | with Electricity_Properties; 6 | 7 | ----------------- 8 | -- DEVICE -- 9 | ----------------- 10 | device BAT_7V2_4A5H 11 | features 12 | Power_out : requires bus access buses::misc::VBat_bus.impl; 13 | end BAT_7V2_4A5H; 14 | device implementation BAT_7V2_4A5H.impl 15 | properties 16 | Electricity_Properties::Max_Current => 40000.0 mA; -- 10C max 17 | Electricity_Properties::Run_Current => 0.0 A; 18 | Electricity_Properties::Core_Voltage => 1.0 V; 19 | end BAT_7V2_4A5H.impl; 20 | 21 | end devices::battery_7v2_4a5h; 22 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/ahrs-systems.aadl: -------------------------------------------------------------------------------- 1 | package AHRS::Systems 2 | 3 | 4 | public 5 | 6 | with AHRS::Hardware; 7 | with AHRS::Software; 8 | 9 | ------------ 10 | -- System -- 11 | ------------ 12 | 13 | system AHRS_System 14 | extends AHRS::Hardware::SBC_32F411EDISCOVERY 15 | end AHRS_System; 16 | 17 | system implementation AHRS_System.IMPL 18 | extends AHRS::Hardware::SBC_32F411EDISCOVERY.RTOS 19 | subcomponents 20 | Software : refined to process AHRS::Software::ATTITUDE.IMPL; 21 | -- actual AHRS software 22 | 23 | end AHRS_System.IMPL; 24 | 25 | 26 | 27 | 28 | end AHRS::Systems; 29 | -------------------------------------------------------------------------------- /examples/ping_spark/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/ping-local.aadl 2 | AADL_ROOT = ping.local 3 | 4 | OTHER_FILES = $(srcdir)/msgs.adb $(srcdir)/msgs.ads \ 5 | $(srcdir)/ping.adb $(srcdir)/ping.ads $(srcdir)/pinged.adb \ 6 | $(srcdir)/pinged.ads $(srcdir)/software.aadl 7 | 8 | CLEANDIRS = ping_local 9 | CLEANFILES = *.lnt demo.svl asn1_deployment.asn 10 | 11 | include $(srcdir)/../Makefile.common 12 | 13 | OCARINA_FLAGS += --spark2014 14 | 15 | AVAILABLE_TARGETS= parse-aadl build_ada 16 | 17 | prove: ## Prove code correctness 18 | ( cd $(CLEANDIRS)/node_a ; gnatprove -Pnode_a.gpr -XTARGET=SPARK -j 0 --warnings=off --report=fail --assumptions --level=4 ) 19 | -------------------------------------------------------------------------------- /examples/ravenscar/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/ravenscar_example.aadl 2 | AADL_ROOT = case_study.leon_local 3 | 4 | OTHER_FILES = \ 5 | $(srcdir)/auxiliary.adb \ 6 | $(srcdir)/auxiliary.ads \ 7 | $(srcdir)/events.adb \ 8 | $(srcdir)/events.ads \ 9 | $(srcdir)/event_source.adb \ 10 | $(srcdir)/event_source.ads \ 11 | $(srcdir)/logs.adb \ 12 | $(srcdir)/logs.ads \ 13 | $(srcdir)/production_workload.adb \ 14 | $(srcdir)/production_workload.ads \ 15 | $(srcdir)/work.adb \ 16 | $(srcdir)/work.ads 17 | 18 | CLEANDIRS = case_study_leon_local 19 | 20 | include $(srcdir)/../Makefile.common 21 | 22 | AVAILABLE_TARGETS = parse-aadl real ada 23 | -------------------------------------------------------------------------------- /share/vim/README: -------------------------------------------------------------------------------- 1 | An AADL mode for vim 2 | 3 | AADLib provides an AADL mode for vim, located in the share/vim directory. 4 | 5 | The AADL mode for vim is made of two files aadl.vim: one for syntactic 6 | coloration, and the other for indentation. The file for indentation 7 | must be placed into ~/.vim/indent/ while the one for syntactic 8 | coloration must be placed into ~/.vim/syntax/ 9 | 10 | To load the AADL mode whenever you edit AADL files, create a file 11 | named ~/.vim/filetype.vim, in which you write: 12 | 13 | augroup filetypedetect 14 | au BufNewFile,BufRead *.aadl setf aadl 15 | augroup END 16 | 17 | For more details, please read the documentation of vim. -------------------------------------------------------------------------------- /src/property_set/Makefile.am: -------------------------------------------------------------------------------- 1 | # Retrieve all source files 2 | 3 | AADL_SOURCES = ${shell find $(srcdir) -name '*.aadl'} 4 | 5 | EXTRA_DIST= $(AADL_SOURCES) 6 | 7 | check-local: 8 | for FILE in ${AADL_SOURCES}; do \ 9 | ocarina -y -aadlv2 -I$(top_srcdir)/src/property_set $${FILE};\ 10 | done 11 | 12 | install-data-local: 13 | mkdir -p $(DESTDIR)$(datadir)/ocarina/AADLv2 14 | for file in $(AADL_SOURCES); do \ 15 | $(INSTALL_DATA) $$file $(DESTDIR)$(datadir)/ocarina/AADLv2 || exit 1; \ 16 | done 17 | 18 | uninstall-local: 19 | for file in $(AADL_SOURCES); do \ 20 | rm -rf $(DESTDIR)$(datadir)/ocarina/AADLv2/$$file; \ 21 | done 22 | 23 | 24 | clean-local: 25 | -rm *~ 26 | -------------------------------------------------------------------------------- /examples/paparazzi/paparazzi_subprograms.aadl: -------------------------------------------------------------------------------- 1 | package paparazzi_subprograms 2 | public 3 | 4 | with Base_Types; 5 | 6 | -- subprograms 7 | subprogram Get_Integer 8 | features 9 | Result : out parameter Base_Types::Integer_8; 10 | end Get_Integer; 11 | 12 | subprogram Set_Integer 13 | features 14 | Int : in parameter Base_Types::Integer_8; 15 | end Set_Integer; 16 | 17 | subprogram Get_Integer16 18 | features 19 | Result : out parameter Base_Types::Integer_16; 20 | end Get_Integer16; 21 | 22 | subprogram Set_Integer16 23 | features 24 | Int : in parameter Base_Types::Integer_16; 25 | end Set_Integer16; 26 | 27 | end paparazzi_subprograms; 28 | -------------------------------------------------------------------------------- /examples/adiru/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/model.aadl 2 | AADL_ROOT = adiru.impl 3 | 4 | OTHER_FILES = $(srcdir)/acc_code.c $(srcdir)/adiru_devices.aadl \ 5 | $(srcdir)/adiru_errlibrary.aadl $(srcdir)/adiru_memory.aadl \ 6 | $(srcdir)/adiru_processor.aadl $(srcdir)/adirup_code.c \ 7 | $(srcdir)/model.aadl $(srcdir)/partitions.aadl $(srcdir)/receive.c \ 8 | $(srcdir)/shm_code.c $(srcdir)/shm_datatype.aadl \ 9 | $(srcdir)/subprograms.aadl $(srcdir)/threads.aadl 10 | 11 | CLEANDIRS = 12 | CLEANFILES = 13 | 14 | include $(srcdir)/../Makefile.common 15 | 16 | AVAILABLE_TARGETS= parse-aadl real deos_conf vxworks653_conf deos_code \ 17 | vxworks653_code #arinc653_conf 18 | -------------------------------------------------------------------------------- /examples/producer_consumer_ba2/producer_consumer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void print_spg 5 | (test__ba__backend__a_struct_impl a_data_in) { 6 | 7 | printf("****************************************** \n"); 8 | printf("#elems of a_data = %d\n", a_data_in.elem); 9 | fflush(stdout); 10 | for (int i = 0; i < a_data_in.elem; i++) 11 | { 12 | 13 | printf("a_data.all_elems [%d] = %d\n", i, a_data_in.all_elems [i]); 14 | fflush(stdout); 15 | } 16 | printf("****************************************** \n"); 17 | } 18 | 19 | void consume_spg (test__ba__backend__a_struct_impl data) 20 | { 21 | printf ("Consume %d\n", data.elem); 22 | fflush(stdout); 23 | } 24 | -------------------------------------------------------------------------------- /examples/mjpeg/BLOCK_METRICS.h: -------------------------------------------------------------------------------- 1 | // *********************************************************************** 2 | // 3 | // Filename : BLOCK_METRICS.h 4 | // 5 | // Author : SpaceStudio generation engine 6 | // 7 | // Creation date : Wed Sep 11 12:06:11 EDT 2013 8 | // 9 | // 10 | // *********************************************************************** 11 | 12 | #ifndef BLOCK_METRICS_H 13 | #define BLOCK_METRICS_H 14 | 15 | 16 | #include "SpaceBaseModule.h" 17 | 18 | #include 19 | 20 | 21 | double to_mseconds(uint64_t value); 22 | 23 | // Thread 24 | void metrics(); 25 | 26 | private: 27 | 28 | uint64_t m_time_resolution; 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/aadl/unit.aadl: -------------------------------------------------------------------------------- 1 | package Unit 2 | public 3 | with Data_Model; 4 | 5 | ------------------ 6 | -- Acceleration -- 7 | ------------------ 8 | 9 | data Acceleration 10 | -- Model of an acceleration 11 | properties 12 | Data_Model::Data_Representation => Float; 13 | Data_Model::Measurement_Unit => "g/s^2"; 14 | Data_Model::Real_Range => 0.0 .. 9.0; 15 | end Acceleration; 16 | 17 | -------------------- 18 | -- Rotation speed -- 19 | -------------------- 20 | 21 | data Rotation 22 | -- Model of a rotation 23 | properties 24 | Data_Model::Data_Representation => Float; 25 | Data_Model::Measurement_Unit => "rad/s"; 26 | end Rotation; 27 | 28 | end Unit; 29 | -------------------------------------------------------------------------------- /examples/minepump/simu.h: -------------------------------------------------------------------------------- 1 | /** 2 | * simu.h: simulator for the mine pump 3 | */ 4 | 5 | #ifndef _SIMU_H_ 6 | #define _SIMU_H_ 7 | #ifndef BYTE 8 | #define BYTE unsigned char 9 | #endif 10 | 11 | void InitSimu(void); 12 | /* Initialize simulator, should be called before any other function 13 | * from this unit 14 | */ 15 | 16 | BYTE ReadHLS(void); /* Return status byte from HLS sensor */ 17 | BYTE ReadLLS(void); /* Return status byte from LLS sensor */ 18 | BYTE ReadMS(void); /* Return status byte from MS sensor */ 19 | void CmdPump(BYTE cmd); /* Command pump, 1 = on, 0 = off */ 20 | void CmdAlarm(BYTE cmd); /* Command alarm, 1 = on, 0 = off */ 21 | 22 | #endif /* _SIMU_H_ */ 23 | -------------------------------------------------------------------------------- /src/property_set/data_sheet.aadl: -------------------------------------------------------------------------------- 1 | property set Data_Sheet is 2 | 3 | UUID : aadlstring applies to (thread, processor, 4 | thread group, process, system, virtual processor, device); 5 | -- Generic identifier of this component. Provides a uniform way to 6 | -- retrieve information on this component 7 | 8 | Part_Number : aadlstring applies to (thread, processor, 9 | thread group, process, system, virtual processor, device); 10 | -- Reference of this component in a bill of material, or a stock, etc. 11 | 12 | Version : aadlstring applies to (thread, processor, 13 | thread group, process, system, virtual processor, device); 14 | -- Reference identifier of this product version 15 | 16 | end Data_Sheet; -------------------------------------------------------------------------------- /examples/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS= adiru ahrs_discovery aocs aram ardupilot arinc653_annex asl \ 2 | behavior_annex car data_modeling_annex fcs flow_analysis \ 3 | fms isr line_follower mixin memory mosart multicore \ 4 | paparazzi pathfinder_system perseus producer_consumer \ 5 | ravenscar radar rap rap_code redundancy rma robot \ 6 | round_robin time_triggered units uxv voter satellite \ 7 | stm32discovery_ada robot_ba pacemaker doors rosace mjpeg \ 8 | air minepump producer_consumer_ba minepump_ba \ 9 | producer_consumer_ba2 producer_consumer_ba_many_transitions \ 10 | producer_consumer_ba_4ports_manyDispatchTriggers ping_spark 11 | 12 | EXTRA_DIST=$(srcdir)/Makefile.common 13 | 14 | clean-local: 15 | -rm -rf *~ 16 | -------------------------------------------------------------------------------- /examples/fms/afdx_properties.aadl: -------------------------------------------------------------------------------- 1 | property set AFDX_Properties is 2 | 3 | Rate: type aadlinteger 0 bitsps .. 100 Gbytesps units Data_Volume_Units; 4 | 5 | Bandwidth : AFDX_Properties::Rate applies to (bus); 6 | 7 | -- Bandwidth_Range : type range of AFDX_Properties::Bandwidth; 8 | 9 | Channel_Type : enumeration (Simplex, Half_Duplex, Full_Duplex) 10 | applies to (bus); 11 | 12 | Allowed_Message_Size: Size_Range 13 | applies to (virtual bus); 14 | 15 | Bandwidth_Allocation_Gap : Time applies to (virtual bus); 16 | 17 | Jitter_Max : Time applies to (virtual bus); 18 | 19 | Latency_Constraint : Time applies to (virtual bus); 20 | 21 | Switching_Delay : Time applies to (device); 22 | 23 | end AFDX_Properties; 24 | -------------------------------------------------------------------------------- /src/aadl/buses/buses-uart.aadl: -------------------------------------------------------------------------------- 1 | -- This package models UART bus 2 | 3 | package Buses::UART 4 | public 5 | with Bus_Properties; 6 | 7 | feature group UART_Pins 8 | features 9 | RX : in event port; 10 | TX : out event port; 11 | end UART_Pins; 12 | 13 | bus UART 14 | properties 15 | Bus_Properties::Available_Bandwidth => 16 | (9_600 Bytesps, 19_200 Bytesps, 38_400 Bytesps, 57_600 Bytesps, 17 | 115_200 Bytesps); 18 | end UART; 19 | 20 | bus implementation UART.impl 21 | end UART.impl; 22 | 23 | device Generic_UART 24 | features 25 | UART : requires bus access UART.impl; 26 | end Generic_UART; 27 | 28 | device implementation Generic_UART.impl 29 | end Generic_UART.impl; 30 | 31 | end Buses::UART; 32 | -------------------------------------------------------------------------------- /src/aadl/processors/processors-x86.aadl: -------------------------------------------------------------------------------- 1 | -- This package defines some processors from the x86 family 2 | 3 | package Processors::x86 4 | public 5 | with Processor_Properties; 6 | 7 | ----------------- 8 | -- Generic_x86 -- 9 | ----------------- 10 | 11 | processor Generic_x86 12 | properties 13 | Processor_Properties::Processor_Family => x86; 14 | Processor_Properties::Endianess => Little_Endian; 15 | Processor_Properties::Word_Length => 32 bits; 16 | end Generic_x86; 17 | 18 | --------- 19 | -- SMP -- 20 | --------- 21 | 22 | system SMP 23 | end SMP; 24 | 25 | system implementation SMP.i 26 | subcomponents 27 | procs : processor Generic_x86[2]; 28 | end SMP.i; 29 | 30 | end Processors::x86; 31 | -------------------------------------------------------------------------------- /examples/ardupilot/yaw.c: -------------------------------------------------------------------------------- 1 | /* 2 | * POK header 3 | * 4 | * The following file is a part of the POK project. Any modification should 5 | * made according to the POK licence. You CANNOT use this file or a part of 6 | * this file is this part of a file for your own project 7 | * 8 | * For more information on the POK licence, please see our LICENCE FILE 9 | * 10 | * Please follow the coding guidelines described in doc/CODING_GUIDELINES 11 | * 12 | * Copyright (c) 2007-2009 POK team 13 | * 14 | * Created by julien on Thu Oct 15 13:04:22 2009 15 | */ 16 | 17 | #include 18 | 19 | void yaw_simulation (int angle) 20 | { 21 | printf ("[YAW] received angle %d\n", angle); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-regulator_reg113_33.aadl: -------------------------------------------------------------------------------- 1 | package devices::regulator_reg113_33 2 | public 3 | 4 | with buses::misc; 5 | with Electricity_Properties; 6 | 7 | ----------------- 8 | -- DEVICE -- 9 | ----------------- 10 | device REG_3V3 11 | features 12 | Power_in : requires bus access buses::misc::V5_bus.impl; 13 | Power_out : requires bus access buses::misc::V3v3_bus.impl; 14 | end REG_3V3; 15 | device implementation REG_3V3.impl 16 | properties 17 | Electricity_Properties::Device_Regulator => Linear; 18 | Electricity_Properties::Max_Current => 400.0 mA; 19 | Electricity_Properties::Run_Current => 0.0 A; 20 | Electricity_Properties::Core_Voltage => 0.0 V; 21 | end REG_3V3.impl; 22 | 23 | 24 | 25 | 26 | end devices::regulator_reg113_33; 27 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Ocarina / Ubuntu (default GNAT) 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-18.04 12 | 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v2 16 | 17 | - name: Set up Python 18 | uses: actions/setup-python@v2 19 | 20 | - name: Set up GNAT toolchain (Ubuntu default distribution) 21 | run: > 22 | sudo apt-get update && 23 | sudo apt-get install gnat gprbuild 24 | - name: Set up ocarina-builder 25 | run: > 26 | git clone https://github.com/OpenAADL/ocarina-build.git 27 | - name: Build 28 | run: ( cd ocarina-build ; ./build_ocarina.sh --scenario=github ) 29 | -------------------------------------------------------------------------------- /examples/adiru/receive.c: -------------------------------------------------------------------------------- 1 | /* 2 | * POK header 3 | * 4 | * The following file is a part of the POK project. Any modification should 5 | * made according to the POK licence. You CANNOT use this file or a part of 6 | * this file is this part of a file for your own project 7 | * 8 | * For more information on the POK licence, please see our LICENCE FILE 9 | * 10 | * Please follow the coding guidelines described in doc/CODING_GUIDELINES 11 | * 12 | * Copyright (c) 2007-2009 POK team 13 | * 14 | * Created by julien on Thu Jan 15 23:34:13 2009 15 | */ 16 | 17 | 18 | #include 19 | #include 20 | 21 | void user_receive (int t) 22 | { 23 | printf ("I receive value %d\n", t); 24 | } 25 | -------------------------------------------------------------------------------- /examples/ardupilot/throttle.c: -------------------------------------------------------------------------------- 1 | /* 2 | * POK header 3 | * 4 | * The following file is a part of the POK project. Any modification should 5 | * made according to the POK licence. You CANNOT use this file or a part of 6 | * this file is this part of a file for your own project 7 | * 8 | * For more information on the POK licence, please see our LICENCE FILE 9 | * 10 | * Please follow the coding guidelines described in doc/CODING_GUIDELINES 11 | * 12 | * Copyright (c) 2007-2009 POK team 13 | * 14 | * Created by julien on Thu Oct 15 13:04:22 2009 15 | */ 16 | 17 | #include 18 | 19 | void throttle_simulation (int speed) 20 | { 21 | printf ("[THROTTLE] received speed=%d\n", speed); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /examples/radar/radar.ads: -------------------------------------------------------------------------------- 1 | with PolyORB_HI_Generated.Deployment; 2 | with PolyORB_HI_Generated.Types; 3 | 4 | package Radar is 5 | 6 | use PolyORB_HI_Generated.Deployment; 7 | use PolyORB_HI_Generated.Types; 8 | 9 | procedure Analyser 10 | (From_Receiver : Target_Distance; 11 | Analyser_Out : out Target_Position_Impl; 12 | From_Controller : Motor_Position); 13 | 14 | procedure Receiver 15 | (Receiver_Out : out Target_Distance; 16 | Receiver_In : Target_Distance); 17 | 18 | procedure Controller 19 | (Controller_In : Motor_Position; 20 | Controller_Out : out Motor_Position); 21 | 22 | procedure Transmitter (Entity : Entity_Type); 23 | 24 | procedure Display_Panel (Display_In : Target_Position_Impl); 25 | 26 | end Radar; 27 | -------------------------------------------------------------------------------- /examples/producer_consumer/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/producer_consumer.aadl 2 | AADL_ROOT = pc_simple.native 3 | 4 | OTHER_FILES = $(srcdir)/producer_consumer.adb \ 5 | $(srcdir)/producer_consumer.ads 6 | 7 | CLEANDIRS = pc_simple_native 8 | CLEANFILES = *.lnt demo.svl asn1_deployment.asn 9 | 10 | include $(srcdir)/../Makefile.common 11 | 12 | AVAILABLE_TARGETS= parse-aadl real petri build_ada lnt stats asn1 13 | 14 | # Note: we overwrite the "real" target to match this project specific 15 | # constraints. 16 | 17 | real: 18 | -$(OCARINA) $(OCARINA_FLAGS) -g real_theorem \ 19 | -real_lib $(srcdir)/lib.real \ 20 | -r $(AADL_ROOT) \ 21 | $(AADL_SOURCES) 22 | 23 | dump: 24 | -$(OCARINA) $(OCARINA_FLAGS) -i \ 25 | -d \ 26 | -r $(AADL_ROOT) \ 27 | $(AADL_SOURCES) 28 | -------------------------------------------------------------------------------- /examples/aram/data_types.aadl: -------------------------------------------------------------------------------- 1 | package Data_Types 2 | public 3 | 4 | ------------------------- 5 | -- Mission data types -- 6 | ------------------------ 7 | 8 | -- In this part, we define some generic data types for the function 9 | -- parts. At this level, these types remain generic enough, and do 10 | -- not define the exact content (data type, representation, etc.). 11 | -- It will be covered in the implementation model. 12 | 13 | data fpa_data 14 | -- fpa_data represents the data manipulated by the FPA sensor 15 | properties 16 | Data_Size => 7 MByte; 17 | end fpa_data; 18 | 19 | data fpa_ctrl 20 | end fpa_ctrl; 21 | 22 | data compressed_data 23 | end compressed_data; 24 | 25 | data processed_data 26 | end processed_data; 27 | 28 | end Data_Types; 29 | -------------------------------------------------------------------------------- /examples/perseus/perseus.aadl: -------------------------------------------------------------------------------- 1 | package Perseus 2 | public 3 | with Electricity_Properties; 4 | 5 | -- OBC: On-board Computer 6 | 7 | device OBC 8 | properties 9 | Electricity_Properties::Max_Current => 1.0 A; 10 | end OBC; 11 | 12 | device implementation OBC.impl1 13 | properties 14 | Electricity_Properties::Run_Current => 0.5 A; 15 | end OBC.impl1; 16 | 17 | -- Perseus_Rocket 18 | 19 | system Perseus_Rocket 20 | end Perseus_Rocket; 21 | 22 | system implementation Perseus_Rocket.Master 23 | subcomponents 24 | OBC : device OBC.impl1; 25 | end Perseus_Rocket.Master; 26 | 27 | system implementation Perseus_Rocket.impl1 extends Perseus_Rocket.Master 28 | subcomponents 29 | OBC : refined to device OBC.impl1; 30 | end Perseus_Rocket.impl1; 31 | 32 | end Perseus; -------------------------------------------------------------------------------- /src/aadl/devices/devices-regulator_tsi10n.aadl: -------------------------------------------------------------------------------- 1 | package devices::regulator_tsi10n 2 | public 3 | 4 | with buses::misc; 5 | with Electricity_Properties; 6 | 7 | ----------------- 8 | -- DEVICE -- 9 | ----------------- 10 | device REG_5V 11 | features 12 | Power_in : requires bus access buses::misc::VBat_bus.impl; 13 | Power_out : requires bus access buses::misc::V5_bus.impl; 14 | end REG_5V; 15 | device implementation REG_5V.impl 16 | properties 17 | Electricity_Properties::Efficiency => 0.93 ; 18 | Electricity_Properties::Device_Regulator => Switcher; 19 | Electricity_Properties::Max_Current => 2.0 A; 20 | Electricity_Properties::Run_Current => 0.0 A; 21 | Electricity_Properties::Core_Voltage => 0.0 V; 22 | end REG_5V.impl; 23 | 24 | 25 | 26 | 27 | end devices::regulator_tsi10n; 28 | -------------------------------------------------------------------------------- /examples/memory/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/prodcons.aadl 2 | AADL_ROOT = vxworks.impl 3 | 4 | OTHER_FILES = \ 5 | $(srcdir)/prodcons.aadl \ 6 | $(srcdir)/producer_consummer_software.aadl \ 7 | $(srcdir)/vxworks_platform.aadl \ 8 | $(srcdir)/mem3.real \ 9 | $(srcdir)/soft.real \ 10 | $(srcdir)/vxworks.real 11 | 12 | CLEANDIRS = vxworks_impl 13 | 14 | include $(srcdir)/../Makefile.common 15 | 16 | AVAILABLE_TARGETS= parse-aadl real #build_c 17 | 18 | # Note: we overwrite the "real" target to match this project specific 19 | # constraints. 20 | 21 | real: 22 | -$(OCARINA) $(OCARINA_FLAGS) -g real_theorem \ 23 | -real_lib $(srcdir)/mem3.real \ 24 | -real_lib $(srcdir)/soft.real \ 25 | -real_lib $(srcdir)/vxworks.real \ 26 | -r $(AADL_ROOT) \ 27 | $(AADL_SOURCES) 28 | -------------------------------------------------------------------------------- /examples/producer_consumer/producer_consumer.adb: -------------------------------------------------------------------------------- 1 | with PolyORB_HI.Output; 2 | 3 | package body Producer_Consumer is 4 | 5 | use PolyORB_HI.Output; 6 | 7 | The_Data : Alpha_Type := 1; 8 | 9 | ----------------- 10 | -- Produce_Spg -- 11 | ----------------- 12 | 13 | procedure Produce_Spg (Data_Source : out Alpha_Type) is 14 | begin 15 | Data_Source := The_Data; 16 | The_Data := The_Data + 1; 17 | Put_Line (Normal, " Produced " & Alpha_Type'Image (Data_Source)); 18 | end Produce_Spg; 19 | 20 | ----------------- 21 | -- Consume_Spg -- 22 | ----------------- 23 | 24 | procedure Consume_Spg (Data_Sink : Alpha_Type) is 25 | begin 26 | Put_Line (Normal, "Consumed " & Alpha_Type'Image (Data_Sink)); 27 | end Consume_Spg; 28 | 29 | end Producer_Consumer; 30 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-regulator_ten40_4812.aadl: -------------------------------------------------------------------------------- 1 | package devices::regulator_ten40_4812 2 | public 3 | 4 | with buses::misc; 5 | with Electricity_Properties; 6 | 7 | ----------------- 8 | -- DEVICE -- 9 | ----------------- 10 | device REG_12V 11 | features 12 | Power_in : requires bus access buses::misc::VBat_bus.impl; 13 | Power_out : requires bus access buses::misc::V12_bus.impl; 14 | end REG_12V; 15 | device implementation REG_12V.impl 16 | properties 17 | Electricity_Properties::Efficiency => 0.89 ; 18 | Electricity_Properties::Device_Regulator => Switcher; 19 | Electricity_Properties::Max_Current => 3.3 A; 20 | Electricity_Properties::Run_Current => 0.0 A; 21 | Electricity_Properties::Core_Voltage => 0.0 V; 22 | end REG_12V.impl; 23 | 24 | 25 | end devices::regulator_ten40_4812; 26 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-bmp085.aadl: -------------------------------------------------------------------------------- 1 | -- This is a high-precision, ultra-low power barometric pressure sensor 2 | 3 | package devices::BMP085 4 | public 5 | 6 | with Electricity_Properties; 7 | with Data_sheet; 8 | 9 | device BMP085 10 | Properties 11 | Data_Sheet::UUID => "http://www.sparkfun.com/products/9603"; 12 | end BMP085; 13 | 14 | device implementation BMP085.impl 15 | Properties 16 | Electricity_Properties::VIL_max => 0.72 v; 17 | Electricity_Properties::VIH_min => 2.88 v; 18 | Electricity_Properties::VOH_min => 1.32 v; 19 | Electricity_Properties::VOL_max => 0.3 v; 20 | 21 | Electricity_Properties::Core_Voltage => 3.6 v; 22 | Electricity_Properties::Acquisition_Time => 25_500 us;-- for the ultra high resolution 23 | Electricity_Properties::Run_Current => 96.0 uA; 24 | end BMP085.impl; 25 | 26 | end devices::BMP085; -------------------------------------------------------------------------------- /src/aadl/shields-xbee.aadl: -------------------------------------------------------------------------------- 1 | -- This package models the X-Bee shield for the Arduino. For more 2 | -- details, see 3 | -- http://www.sparkfun.com/commerce/product_info.php?products_id=9841 4 | 5 | package Shields::XBee 6 | public 7 | with Data_Sheet; 8 | with Shields; 9 | 10 | -------------- 11 | -- XBee -- 12 | -------------- 13 | 14 | device XBee extends Shields::Empty_Shield 15 | features 16 | RX : in event port; 17 | TX : in event port; 18 | 19 | GND : in out event port; 20 | VIN : in out event port; 21 | 22 | properties 23 | Data_Sheet::UUID => 24 | "http://www.sparkfun.com/commerce/product_info.php?products_id=9841"; 25 | Data_Sheet::Version => "WRL-09841"; 26 | end XBee; 27 | 28 | device implementation XBee.impl 29 | end XBee.impl; 30 | 31 | end Shields::XBee; 32 | -------------------------------------------------------------------------------- /examples/rosace/app_aadl.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | #define MATH 7 | #include 8 | 9 | void aircraft_dynamics_aadl (float delta_e, float t, float* va, float* vz, float* q, float* az, float* h) { 10 | static bool first_run = true; 11 | struct aircraft_dynamics_outs_t outputs; 12 | 13 | if (first_run) { 14 | first_run = false; 15 | delta_e = 0.012009615652468, t = 41813.92119463; 16 | } 17 | 18 | aircraft_dynamics (delta_e, t, &outputs); 19 | *va = outputs.Va; 20 | *vz = outputs.Vz; 21 | *q = outputs.q; 22 | *az = outputs.az; 23 | *h = outputs.h; 24 | } 25 | 26 | void elevator_aadl (float delta_e_c, float* output) { 27 | *output = elevator (delta_e_c); 28 | } 29 | 30 | void engine_aadl (float delta_th_c, float* output) { 31 | *output = engine (delta_th_c); 32 | } 33 | -------------------------------------------------------------------------------- /src/real/perseus_lib.real: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | -- High level theorem for Perseus 3 | -- 4 | 5 | theorem check_perseus 6 | foreach s in system_set do 7 | requires (check_electricity); 8 | check (1 = 1); 9 | end check_perseus; 10 | -------------------------------------------------------------------------------- 11 | 12 | theorem check_electricity 13 | foreach d in device_set do 14 | 15 | check ((not property_exists (d, "electricity_properties::max_current")) 16 | or (property_exists (d, "electricity_properties::run_current") 17 | and (get_property_value (d, "electricity_properties::run_current") <= 18 | get_property_value (d, "electricity_properties::max_current")))); 19 | 20 | end check_electricity; 21 | -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- /examples/air/README.md: -------------------------------------------------------------------------------- 1 | AIR examples 2 | ============ 3 | 4 | These examples demonstrate support of the AIR hypervisor by GMV ( https://www.gmv.com/en/Products/air/ ) 5 | 6 | The following examples are available: 7 | 8 | * hello: basic example with one partition 9 | * ping: example of two partitions with inter-partition communication 10 | * smp01: example of a system with multiple cores 11 | 12 | To compile these examples, run `make air_conf c build_air` from the terminal 13 | 14 | to 15 | * generate the AIR XML configuration file (`air_conf` target) 16 | * generate C code using PolyORB-HI/C (`c` target) 17 | * generate AIR-specific code and compile the generated code (`build_air` target) 18 | 19 | NOTE: 20 | ----- 21 | 22 | The following environment variables must be defined 23 | 24 | * AIR : AIR base source directory 25 | * RTEMS_MAKEFILE_PATH=$AIR/install/pos/rtems5/rtems5-install/sparc-rtems5/leon3 -------------------------------------------------------------------------------- /examples/behavior_annex/ba_example4.aadl: -------------------------------------------------------------------------------- 1 | -- Copyright © 2008 SAE International 2 | 3 | -- This example shows the use of non deterministic transitions that enumerate 4 | -- all the possible behaviors of a subprogram, without specifying precisely 5 | -- when each case occurs. 6 | 7 | package BA_example4 public 8 | with Base_Types; 9 | 10 | subprogram addition 11 | features 12 | x: in parameter Base_Types::Integer; 13 | y: in parameter Base_Types::Integer; 14 | r: out parameter Base_Types::Integer; 15 | ovf: out parameter Base_Types::Boolean; 16 | end addition; 17 | 18 | subprogram implementation addition.default 19 | annex behavior_specification {** 20 | states 21 | s0 : initial state; 22 | s1 : final state; 23 | transitions 24 | regular: s0 -[ ]-> s1 { r := x + y ; ovf := false }; 25 | overflow: s0 -[ ]-> s1 { r := 0; ovf := true }; 26 | **}; 27 | end addition.default; 28 | 29 | end BA_example4; -------------------------------------------------------------------------------- /examples/radar/radar_types.aadl: -------------------------------------------------------------------------------- 1 | PACKAGE radar_types 2 | PUBLIC 3 | with data_model; 4 | 5 | -- Defines the angular position of the motor, in range 0 .. 359 6 | 7 | DATA Motor_Position 8 | PROPERTIES 9 | Data_Model::Data_Representation => integer; 10 | END Motor_Position; 11 | 12 | -- Define the distance of the target being echoed by the radar pulse 13 | 14 | DATA Target_Distance 15 | PROPERTIES 16 | Data_Model::Data_Representation => integer; 17 | END Target_Distance; 18 | 19 | -- Define the exact position of the target, in polar coordinates 20 | 21 | DATA Target_Position 22 | END Target_Position; 23 | 24 | DATA IMPLEMENTATION Target_Position.impl 25 | SUBCOMPONENTS 26 | theta : DATA radar_types::Motor_Position; 27 | rho : DATA radar_types::Target_Distance; 28 | PROPERTIES 29 | Data_Model::Data_Representation => struct; 30 | END Target_Position.impl; 31 | 32 | END radar_types; 33 | -------------------------------------------------------------------------------- /examples/line_follower/software_lf.aadl: -------------------------------------------------------------------------------- 1 | package Software_lf 2 | public 3 | 4 | ----------------- 5 | -- Subprograms -- 6 | ----------------- 7 | 8 | subprogram Main_Loop 9 | properties 10 | source_language => (C); 11 | source_name => "robot_main"; 12 | source_text => ("robot.c"); 13 | end Main_Loop; 14 | 15 | ------------- 16 | -- Threads -- 17 | ------------- 18 | 19 | thread Task 20 | end Task; 21 | 22 | thread implementation Task.impl_1 23 | calls 24 | Mycalls: { 25 | P_Spg : subprogram Main_Loop; 26 | }; 27 | properties 28 | Dispatch_Protocol => Background; 29 | end Task.impl_1; 30 | 31 | --------------- 32 | -- Processes -- 33 | --------------- 34 | 35 | process node_a 36 | end node_a; 37 | 38 | process implementation node_a.impl 39 | subcomponents 40 | Task1 : thread Task.impl_1; 41 | end node_a.impl; 42 | 43 | end Software_lf; 44 | -------------------------------------------------------------------------------- /src/aadl/Makefile.am: -------------------------------------------------------------------------------- 1 | # Retrieve all source files 2 | 3 | AADL_SOURCES = ${shell find $(srcdir) -name '*.aadl'} 4 | 5 | OCARINA_FLAGS=-I$(top_srcdir)/src/aadl -I$(top_srcdir)/src/aadl/buses \ 6 | -I$(top_srcdir)/src/aadl/devices -I$(top_srcdir)/src/aadl/drivers \ 7 | -I$(top_srcdir)/src/aadl/drivers/uart \ 8 | -I$(top_srcdir)/src/property_set 9 | 10 | debug: 11 | @echo $(AADL_SOURCES) 12 | 13 | check-local: 14 | for FILE in ${AADL_SOURCES}; do \ 15 | ocarina -y -aadlv2 $(OCARINA_FLAGS) $${FILE};\ 16 | done 17 | 18 | clean-local: 19 | -rm *~ 20 | 21 | install-data-local: 22 | $(INSTALL) -d $(DESTDIR)$(datadir)/ocarina/AADLv2 23 | for file in $(AADL_SOURCES); do \ 24 | $(INSTALL_DATA) $$file $(DESTDIR)$(datadir)/ocarina/AADLv2 || exit 1; \ 25 | done 26 | 27 | uninstall-local: 28 | for file in $(AADL_SOURCES); do \ 29 | rm -rf $(DESTDIR)$(datadir)/ocarina/AADLv2/$$file ; \ 30 | done 31 | 32 | EXTRA_DIST= $(AADL_SOURCES) 33 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-qre1113.aadl: -------------------------------------------------------------------------------- 1 | -- This package models a QRE1113 device, a reflectance sensor from 2 | -- Pollulu, and packaged by Sparkfun as a breakout-board wih all 3 | -- required connection pins. 4 | 5 | package Devices::QRE1113 6 | public 7 | with Data_Sheet, Electricity_Properties; 8 | 9 | -------------------- 10 | -- QRE1113_Analog -- 11 | -------------------- 12 | 13 | device QRE1113_Analog 14 | features 15 | GND : in out event port; 16 | VCC : in out event port 17 | {Electricity_Properties::Input_Voltage => 5.0 V;}; 18 | 19 | OUTp : in out event port; -- should be connected to an Analog pin 20 | properties 21 | Data_Sheet::UUID => 22 | "http://www.sparkfun.com/commerce/product_info.php?products_id=9453"; 23 | Data_Sheet::Version => "ROB-09453"; 24 | end QRE1113_Analog; 25 | 26 | device implementation QRE1113_Analog.impl 27 | end QRE1113_Analog.impl; 28 | 29 | end Devices::QRE1113; 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AADLib - A library of AADL components 2 | 3 | ## About 4 | 5 | AADLib is a library of reusable AADLv2 components, associated property sets and validation theorems based on REAL. It has been defined to work properly with [Ocarina](https://github.com/OpenAADL/ocarina), [AADL-Inspector](http://www.ellidiss.com/products/aadl-inspector/) and [OSATE](http://osate.org). 6 | 7 | ## Installation 8 | 9 | ### Ocarina 10 | 11 | The recommended installation process is through the proper configuration and installation of [Ocarina](https://github.com/OpenAADL/ocarina), see Ocarina documentation for details. 12 | 13 | ### OSATE 14 | 15 | Simply import the AADLib repository as an AADL project 16 | 17 | ### AADL Inspector 18 | 19 | Import the AADLib examples through the GitHub import facility 20 | 21 | ## Q&A 22 | 23 | Build status ![Ocarina / Ubuntu (default GNAT)](https://github.com/OpenAADL/AADLib/workflows/Ocarina%20/%20Ubuntu%20(default%20GNAT)/badge.svg) 24 | -------------------------------------------------------------------------------- /examples/fms/datatype.aadl: -------------------------------------------------------------------------------- 1 | package dataType 2 | public 3 | 4 | data request_pilot 5 | -- properties 6 | -- Source_Data_Size => 600 Bytes; 7 | end request_pilot; 8 | 9 | data display 10 | -- properties 11 | -- Source_Data_Size => 600 Bytes; 12 | end display; 13 | 14 | data pression 15 | -- properties 16 | -- Source_Data_Size => 600 Bytes; 17 | end pression; 18 | 19 | data waypoint_identifier 20 | properties 21 | Data_Size => 600 Bytes; 22 | end waypoint_identifier; 23 | 24 | data database_query 25 | properties 26 | Data_Size => 1000 Bytes; 27 | end database_query; 28 | 29 | data database_answer 30 | properties 31 | Data_Size => 4000 Bytes; 32 | end database_answer; 33 | 34 | data waypoint_info 35 | properties 36 | Data_Size => 1000 Bytes; 37 | end waypoint_info; 38 | 39 | data speed 40 | properties 41 | Data_Size => 700 Bytes; 42 | end speed; 43 | 44 | data time 45 | properties 46 | Data_Size => 5000 Bytes; 47 | end time; 48 | 49 | end dataType; -------------------------------------------------------------------------------- /examples/multicore/M1RTMgr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MsgType.h" 3 | 4 | static uint8_t FirstTimeThrough = TRUE; 5 | static uint32_t MessageCounter = 0; 6 | 7 | 8 | void m1rtinit(initmsg *msg){ 9 | printf("RT Bus Manager 1 Remote Terminal Initialization - Start\n"); 10 | msg->InitializationComplete = TRUE; 11 | printf("RT Bus Manager 1 Remote Terminal - Complete\n"); 12 | } 13 | 14 | void m1rtmgr(initmsg msg,busmsg *RTtoBCMsg){ 15 | if(msg.InitializationComplete){ 16 | if(FirstTimeThrough){ 17 | printf("RT Bus Manager 1 Remote Terminal - Start\n"); 18 | FirstTimeThrough = FALSE; 19 | } 20 | if(MessageCounter == 0){ 21 | RTtoBCMsg->MsgQueue[0].Msg[0]=1; 22 | RTtoBCMsg->MsgQueue[0].Msg[1]++; 23 | MessageCounter = 800; // 8 Seconds 24 | printf("RT Bus Mgr 1 Sending Message (%d) to BC\n",RTtoBCMsg->MsgQueue[0].Msg[1]); 25 | } 26 | else { 27 | RTtoBCMsg->MsgQueue[0].Msg[0]=0; 28 | MessageCounter--; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-hmc5843.aadl: -------------------------------------------------------------------------------- 1 | -- This package models a HMC5843 device, a three-axis magnetometer 2 | -- produced by Honeywell, and packaged by Sparkfun as a breakout-board 3 | -- wih all required connection pins. 4 | 5 | package Devices::HMC5843 6 | public 7 | with Data_Sheet, Buses::I2C, Electricity_Properties; 8 | 9 | ------------- 10 | -- HMC5843 -- 11 | ------------- 12 | 13 | device HMC5843 14 | features 15 | GND : in out event port; 16 | VCC : in out event port 17 | {Electricity_Properties::Input_Voltage => 3.3V;}; 18 | I2C_Bus : feature group Buses::I2C::I2C_Pins; 19 | 20 | I2C_Link : requires bus access Buses::I2C::I2C.impl; 21 | properties 22 | Data_Sheet::UUID => 23 | "http://www.sparkfun.com/commerce/product_info.php?products_id=9371"; 24 | Data_Sheet::Version => "SEN-09371"; 25 | end HMC5843; 26 | 27 | device implementation HMC5843.impl 28 | end HMC5843.impl; 29 | 30 | end Devices::HMC5843; 31 | -------------------------------------------------------------------------------- /src/aadl/shields-ardupilot.aadl: -------------------------------------------------------------------------------- 1 | -- Ardupilot Shield V2 2 | 3 | package Shields::Ardupilot 4 | public 5 | 6 | with Data_sheet; 7 | with devices::MPXV7002DP; 8 | with shields; 9 | 10 | system Ardupilot --extends shields::Empty_Shield 11 | features 12 | V3_3 : in event port; -- 3.3 V for GPS/Modem 13 | V5 : in event port; -- 5 V for GPS/Modem 14 | ada_gps : in out event port; -- Em406/uBlox Adapter GPS 15 | XY_in : in event port; -- XY port for XYZ sensor 16 | Z_in : in event port; -- Z port for XYZ sensor 17 | Properties 18 | Data_sheet::UUID => 19 | "http://store.diydrones.com/ProductDetails.asp?ProductCode=KT-0001-01"; 20 | end Ardupilot; 21 | 22 | system implementation Ardupilot.impl 23 | subcomponents 24 | shield : device shields::Empty_Shield; 25 | MPXV7002DP : device devices::MPXV7002DP::MPXV7002DP; 26 | -- -- On board differential pressure sensor 27 | end Ardupilot.impl; 28 | 29 | end Shields::Ardupilot; 30 | -------------------------------------------------------------------------------- /src/real/flow_latency.real: -------------------------------------------------------------------------------- 1 | -- Checks whether the latency is below the user-specified max latency 2 | 3 | -- In order to actually work, we need to detect user-specified flows 4 | -- and match them to actual flows 5 | 6 | theorem Latency_2 7 | 8 | foreach f in End_To_End_Flows_Set do 9 | 10 | crossed_buses := {b in Bus_Set | 11 | Is_Passing_Through (b, f)}; 12 | 13 | crossed_threads := {t in Thread_Set | 14 | Is_Passing_Through (t, f)}; 15 | 16 | -- This theorem is valid only in the (simple) case where their 17 | -- is no message queuing 18 | 19 | check ((Sum (Last 20 | (Get_Property_Value 21 | (crossed_buses, "Transmission_Time"))) + 22 | Sum (Last 23 | (Get_Property_Value 24 | (crossed_threads, "Subprogram_Execution_Time")))) 25 | > Last (Get_Property_Value (f, "Expected_Latency"))); 26 | 27 | end Latency_2; 28 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/include/AttitudeEKF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * AttitudeEKF.h 3 | * 4 | * Code generation for function 'AttitudeEKF' 5 | * 6 | * C source code generated on: Thu Aug 21 11:17:28 2014 7 | * 8 | */ 9 | 10 | #ifndef __ATTITUDEEKF_H__ 11 | #define __ATTITUDEEKF_H__ 12 | /* Include files */ 13 | 14 | 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Function Declarations */ 21 | extern void AttitudeEKF(unsigned char approx_prediction, unsigned char use_inertia_matrix, const unsigned char zFlag[3], float dt, const float z[9], float q_rotSpeed, float q_rotAcc, float q_acc, float q_mag, float r_gyro, float r_accel, float r_mag, const float J[9], float xa_apo[12], float Pa_apo[144], float Rot_matrix[9], float eulerAngles[3], float debugOutput[4]); 22 | extern void AttitudeEKF_initialize(void); 23 | extern void AttitudeEKF_terminate(void); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | /* End of code generation (AttitudeEKF.h) */ 31 | -------------------------------------------------------------------------------- /examples/tetris/screen.adb: -------------------------------------------------------------------------------- 1 | with Text_IO; 2 | package body Screen is 3 | 4 | package Int_IO is new Text_IO.Integer_IO (Num => Integer); 5 | 6 | ---------- 7 | -- Beep -- 8 | ---------- 9 | 10 | procedure Beep is 11 | begin 12 | Text_IO.Put (Item => ASCII.BEL); 13 | end Beep; 14 | 15 | ----------------- 16 | -- ClearScreen -- 17 | ----------------- 18 | 19 | procedure ClearScreen is 20 | begin 21 | Text_IO.Put (Item => ASCII.ESC); 22 | Text_IO.Put (Item => "[2J"); 23 | end ClearScreen; 24 | 25 | ---------------- 26 | -- MoveCursor -- 27 | ---------------- 28 | 29 | procedure MoveCursor (To: in Position) is 30 | begin 31 | Text_IO.New_Line; 32 | Text_IO.Put (Item => ASCII.ESC); 33 | Text_IO.Put ("["); 34 | Int_IO.Put (Item => To.Row, Width => 1); 35 | Text_IO.Put (Item => ';'); 36 | Int_IO.Put (Item => To.Column, Width => 1); 37 | Text_IO.Put (Item => 'f'); 38 | end MoveCursor; 39 | 40 | end Screen; 41 | -------------------------------------------------------------------------------- /examples/rosace/log.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "types.h" 3 | #define FMTFLOAT "%5.15f" 4 | 5 | void rosace_log 6 | (rosace__software__rosace_float t, 7 | rosace__software__rosace_float va, 8 | rosace__software__rosace_float az, 9 | rosace__software__rosace_float q, 10 | rosace__software__rosace_float vz, 11 | rosace__software__rosace_float h, 12 | rosace__software__rosace_float delta_th_c, 13 | rosace__software__rosace_float delta_e_c) 14 | { 15 | 16 | static int first=1; 17 | if (first) { 18 | printf("# %15s, %15s, %15s, %15s, %15s, %15s, %15s, %15s\n", 19 | "T","Va","az","q","Vz","h","delta_th_c","delta_e_c"); 20 | first = 0; 21 | } 22 | 23 | printf("%3.4f, ", t); 24 | printf(FMTFLOAT", ", va); 25 | printf(FMTFLOAT", ", az); 26 | printf(FMTFLOAT", ", q); 27 | printf(FMTFLOAT", ", vz); 28 | printf(FMTFLOAT", ", h); 29 | printf(FMTFLOAT", ", delta_th_c); 30 | printf(FMTFLOAT"\n", delta_e_c); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /examples/multicore/M2RTMgr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "MsgType.h" 4 | 5 | static uint8_t FirstTimeThrough = TRUE; 6 | static uint32_t MessageCounter = 0; 7 | 8 | 9 | void m2rtinit(initmsg *msg){ 10 | printf("RT Bus Manager 2 Remote Terminal Initialization - Start\n"); 11 | msg->InitializationComplete = TRUE; 12 | printf("RT Bus Manager 2 Remote Terminal - Complete\n"); 13 | } 14 | 15 | void m2rtmgr(initmsg msg, busmsg *RTtoBCMsg){ 16 | if(msg.InitializationComplete){ 17 | if(FirstTimeThrough){ 18 | printf("RT Bus Manager 2 Remote Terminal - Start\n"); 19 | FirstTimeThrough = FALSE; 20 | } 21 | if(MessageCounter == 0){ 22 | RTtoBCMsg->MsgQueue[0].Msg[0]=1; 23 | RTtoBCMsg->MsgQueue[0].Msg[1]++; 24 | MessageCounter = 500; // 5 seconds 25 | printf("RT Bus Mgr 2 Sending Message (%d) to BC\n",RTtoBCMsg->MsgQueue[0].Msg[1]); 26 | } 27 | else { 28 | RTtoBCMsg->MsgQueue[0].Msg[0]=0; 29 | MessageCounter--; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /examples/units/test_units.aadl: -------------------------------------------------------------------------------- 1 | package test_units 2 | public 3 | with Unit_PS; 4 | with Base_Types; 5 | 6 | data Distance_Value extends Base_Types::Float 7 | properties 8 | Unit_PS::Measurement_Unit => Unit_PS::Meter; 9 | end Distance_Value; 10 | 11 | data Time_Value extends Base_Types::Float 12 | properties 13 | Unit_PS::Measurement_Unit => Unit_PS::Second; 14 | end Time_Value; 15 | 16 | data Speed_Value extends Base_Types::Float 17 | properties 18 | Unit_PS::Measurement_Unit => Unit_PS::Speed; 19 | end Speed_Value; 20 | 21 | subprogram Compute_Speed 22 | features 23 | Distance_Traveled : in parameter Distance_Value; 24 | Time_Elapsed : in parameter Time_Value; 25 | Average_Speed : out parameter Speed_Value; 26 | annex behavior_specification {** 27 | states s : initial final state; 28 | transitions t : s -[]-> s { Average_Speed := Distance_Traveled / Time_Elapsed }; 29 | 30 | **}; 31 | end Compute_Speed; 32 | 33 | 34 | end test_units; -------------------------------------------------------------------------------- /examples/adiru/shm_datatype.aadl: -------------------------------------------------------------------------------- 1 | -- This package defines data types to be manipulated by software elements. 2 | -- It follows the conventions from the Data Modeling Annex document. 3 | 4 | package SHM_DataType 5 | public 6 | with Data_Model; 7 | 8 | data C_Unsigned_Long_Int 9 | -- This data component defines a C unsigned long int type, with a 10 | -- dual nature The first properties defines its representation in 11 | -- memory, the two last its mapping in C. 12 | properties 13 | Data_Model::Data_Representation => integer; 14 | Data_Model::Number_Representation => unsigned; 15 | Data_Size => 4 bytes; 16 | Source_Language => (C); 17 | Type_Source_Name => "unsigned long int"; 18 | end C_Unsigned_Long_Int; 19 | 20 | data accData extends C_Unsigned_Long_Int 21 | end accData; 22 | 23 | data errorData extends C_Unsigned_Long_Int 24 | end errorData; 25 | 26 | data actionData extends C_Unsigned_Long_Int 27 | end actionData; 28 | 29 | end SHM_DataType; 30 | -------------------------------------------------------------------------------- /examples/multicore/BCMgr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "MsgType.h" 4 | 5 | static uint8_t FirstTimeThrough = TRUE; 6 | 7 | void bcinit(initmsg *msg){ 8 | printf("Bus Controller Initialization - Start\n"); 9 | msg->InitializationComplete = TRUE; 10 | printf("Bus Controller Initialization - Complete\n"); 11 | } 12 | 13 | void bcmgr(initmsg msg, busmsg M0RTtoBCMsg, busmsg M1RTtoBCMsg, busmsg M2RTtoBCMsg){ 14 | if(msg.InitializationComplete){ 15 | if(FirstTimeThrough){ 16 | printf("Bus Controller Manager - Start\n"); 17 | FirstTimeThrough = FALSE; 18 | } 19 | } 20 | if(M0RTtoBCMsg.MsgQueue[0].Msg[0] > 0){ 21 | printf("Message Received from RT Bus Mgr 0 (%d)\n",M0RTtoBCMsg.MsgQueue[0].Msg[1]); 22 | } 23 | if(M1RTtoBCMsg.MsgQueue[0].Msg[0] > 0){ 24 | printf("Message Received from RT Bus Mgr 1 (%d)\n",M1RTtoBCMsg.MsgQueue[0].Msg[1]); 25 | } 26 | if(M2RTtoBCMsg.MsgQueue[0].Msg[0] > 0){ 27 | printf("Message Received from RT Bus Mgr 2 (%d)\n",M2RTtoBCMsg.MsgQueue[0].Msg[1]); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/multicore/M0RTMgr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "MsgType.h" 4 | 5 | static uint8_t FirstTimeThrough = TRUE; 6 | static uint32_t MessageCounter = 0; 7 | 8 | void m0rtinit(initmsg *msg){ 9 | printf("RT Bus Manager 0 Remote Terminal Initialization - Start\n"); 10 | msg->InitializationComplete = TRUE; 11 | printf("RT Bus Manager 0 Remote Terminal - Complete\n"); 12 | } 13 | 14 | void m0rtmgr(initmsg msg, busmsg *RTtoBCMsg){ 15 | if(msg.InitializationComplete){ 16 | if(FirstTimeThrough){ 17 | printf("RT Bus Manager 0 Remote Terminal - Start\n"); 18 | FirstTimeThrough = FALSE; 19 | RTtoBCMsg->NumberOfMessages = 1; 20 | } 21 | if(MessageCounter == 0){ 22 | RTtoBCMsg->MsgQueue[0].Msg[0]=1; 23 | RTtoBCMsg->MsgQueue[0].Msg[1]++; 24 | MessageCounter = 1000; // 10 seconds 25 | printf("RT Bus Mgr 0 Sending Message (%d) to BC\n",RTtoBCMsg->MsgQueue[0].Msg[1]); 26 | } 27 | else { 28 | RTtoBCMsg->MsgQueue[0].Msg[0]=0; 29 | MessageCounter--; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/property_set/transformations.aadl: -------------------------------------------------------------------------------- 1 | -- Transformations property set 2 | -- 3 | -- Mon Feb 16 15:27:39 CET 2009 4 | 5 | -- Property set for the transfo package 6 | 7 | property set Transformations is 8 | 9 | Call_Sequence_Period: inherit Time 10 | applies to (subprogram); 11 | 12 | Priority : aadlinteger 0 .. 255 13 | applies to (subprogram); 14 | 15 | Source_Name : aadlstring 16 | applies to (subprogram); 17 | 18 | Fusion_Occurred : aadlboolean 19 | applies to (thread); 20 | 21 | Priority_Shifter : aadlboolean 22 | applies to (data); 23 | 24 | Deadline : inherit Time 25 | applies to (subprogram); 26 | 27 | No_Optimization : aadlboolean 28 | applies to (process, thread); 29 | -- Forbid optimization for the targeted component 30 | 31 | Scheduler_Name : aadlstring 32 | applies to (thread); 33 | -- Name of the package containing the thread schedule 34 | 35 | Original_Name : aadlstring 36 | applies to (thread); 37 | -- Original name of the thread 38 | 39 | end Transformations; 40 | 41 | -------------------------------------------------------------------------------- /examples/adiru/adiru_errlibrary.aadl: -------------------------------------------------------------------------------- 1 | -- This package provides the error library for the ADIRU model 2 | 3 | package ADIRU_errLibrary 4 | public 5 | 6 | annex EMV2 {** 7 | error types 8 | -- ACC error types, those type of error can 9 | -- propagate through the whole system 10 | ValueError: type; 11 | ValueErroneous : type extends ValueError; 12 | ValueStuck : type extends ValueError; 13 | ValueStuckHigh : type extends ValueStuck; 14 | ValueStuckLow : type extends ValueError; 15 | ValueChangeTooFast : type extends ValueError; 16 | NoValue : type; 17 | end types; 18 | 19 | -- Simple error state machine 20 | error behavior simple 21 | states 22 | Operational : initial state; 23 | Failed : state; 24 | end behavior; 25 | 26 | -- Voter and Display module error state machine 27 | error behavior display_simple 28 | states 29 | operational : initial state; 30 | displayErroneousValue : state; 31 | end behavior; 32 | **}; 33 | end ADIRU_errLibrary; 34 | -------------------------------------------------------------------------------- /examples/mjpeg/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/integration.aadl 2 | 3 | AADL_ROOT = mjpeg::integration::integration.a9impl 4 | #AADL_ROOT = mjpeg::integration::integration.demuxub_vlda9 5 | #AADL_ROOT = mjpeg::integration::integration.demuxub_iqzza9 6 | #AADL_ROOT = mjpeg::integration::integration.demuxub_idcta9 7 | #AADL_ROOT = mjpeg::integration::integration.demuxlibuub_idcta9 8 | 9 | OTHER_FILES = $(srcdir)/BLOCK_METRICS.cpp $(srcdir)/DEMUX.h \ 10 | $(srcdir)/LIBU.cpp $(srcdir)/BLOCK_METRICS.h \ 11 | $(srcdir)/IDCT.cpp $(srcdir)/LIBU.h \ 12 | $(srcdir)/COLOR_METRICS.cpp $(srcdir)/IDCT.h $(srcdir)/VLD.cpp \ 13 | $(srcdir)/COLOR_METRICS.h $(srcdir)/IQZZ.cpp $(srcdir)/VLD.h \ 14 | $(srcdir)/DEMUX.cpp $(srcdir)/IQZZ.h \ 15 | $(srcdir)/mjpeg-platform.aadl $(srcdir)/mjpeg-software.aadl \ 16 | $(srcdir)/spacestudio.aadl 17 | 18 | CLEANDIRS = SpaceStudioProject 19 | CLEANFILES = 20 | 21 | include $(srcdir)/../Makefile.common 22 | 23 | AVAILABLE_TARGETS= parse-aadl 24 | 25 | # The backend is deactivated for the moment 26 | #spacestudio 27 | -------------------------------------------------------------------------------- /examples/minepump_ba/simu.h: -------------------------------------------------------------------------------- 1 | /** 2 | * simu.h: simulator for the mine pump 3 | */ 4 | 5 | #ifndef _SIMU_H_ 6 | #define _SIMU_H_ 7 | #ifndef BYTE 8 | #define BYTE unsigned char 9 | #endif 10 | 11 | void InitSimu(void); 12 | /* Initialize simulator, should be called before any other function 13 | * from this unit 14 | */ 15 | 16 | readhls (int *hls); /* Set hls status from HLS sensor */ 17 | readlls (int *lls); /* Set lls status from LLS sensor */ 18 | readms (int *ms); /* Set ms status from MS sensor */ 19 | void cmdpump (int cmd); /* Command pump, 1 = on, 0 = off */ 20 | void cmdalarm(int cmd); /* Command alarm, 1 = on, 0 = off */ 21 | 22 | //BYTE ReadHLS(void); /* Return status byte from HLS sensor */ 23 | //BYTE ReadLLS(void); /* Return status byte from LLS sensor */ 24 | //BYTE ReadMS(void); /* Return status byte from MS sensor */ 25 | //void CmdPump(BYTE cmd); /* Command pump, 1 = on, 0 = off */ 26 | //void CmdAlarm(BYTE cmd); /* Command alarm, 1 = on, 0 = off */ 27 | 28 | #endif /* _SIMU_H_ */ 29 | -------------------------------------------------------------------------------- /src/property_set/bus_properties.aadl: -------------------------------------------------------------------------------- 1 | property set Bus_Properties is 2 | 3 | Bandwidth : Data_Volume applies to (bus); 4 | 5 | Bandwidth_Range : type range of Data_Volume; 6 | 7 | Bandwidth_Scale : Bus_Properties::Bandwidth_Range applies to (bus); 8 | 9 | Available_Bandwidth : list of Data_Volume applies to (bus); 10 | 11 | Required_Bandwidth : Data_Volume applies to 12 | (abstract, system, device, bus access, connection); 13 | 14 | Channel_Type : enumeration (Simplex, Half_Duplex, Full_Duplex) 15 | applies to (bus); 16 | 17 | Bus_Type : enumeration (mtp, ptp) applies to (bus, system, abstract); 18 | -- mtp: multi-point bus 19 | -- ptp: point-to-point bus 20 | 21 | Expected_Latency : Time_Range applies to (bus, bus access, abstract); 22 | 23 | Max_Latency : Time applies to (bus, bus access, abstract); 24 | 25 | Message_Priority : aadlinteger applies to (connection); 26 | -- Priority of a message being sent through a connection, e.g. when 27 | -- bound to a priority-aware bus like CAN. 28 | 29 | end Bus_Properties; 30 | -------------------------------------------------------------------------------- /src/real/code_gen.real: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | -- This set of REAL theorems implements checks that are implicitely 3 | -- performed by Ocarina code generators 4 | 5 | theorem code_gen_master 6 | foreach s in system_set do 7 | requires ( 8 | check_thread_per_process 9 | ); 10 | check (1 = 1); 11 | end code_gen_master; 12 | 13 | -------------------------------------------------------------------------------- 14 | -- AADLv2.2 5.6 semantics indicates in the notes that: An AADL process 15 | -- represents only a virtual address space and requires at least one 16 | -- explicitly declared thread subcomponent in order to be 17 | -- executable. 18 | -- 19 | -- This theorem checks that each process has at least one thread as 20 | -- subcomponent 21 | 22 | theorem check_thread_per_process 23 | foreach p in process_set do 24 | thread_subcomponents := { t in Thread_Set | Is_subcomponent_of (t, p)}; 25 | 26 | check (Cardinal (Thread_Subcomponents) > 0); 27 | end check_thread_per_process; -------------------------------------------------------------------------------- /examples/tetris/wall.ads: -------------------------------------------------------------------------------- 1 | package Wall is 2 | 3 | subtype Styles is INTEGER range 1..7; 4 | 5 | type Brick_Section is 6 | record 7 | Y, X : Integer; 8 | end record; 9 | 10 | type Brick_Type is array(1 .. 4) of Brick_Section; 11 | 12 | function Pick ( Style : in Styles ) return Brick_Type; 13 | 14 | subtype Width is Integer range 0 .. 11; 15 | subtype Height is Integer range 1 .. 21; 16 | 17 | procedure Initialize; 18 | 19 | procedure Put(Brick : in Brick_Type; 20 | X : in Width; 21 | Y : in Height); 22 | 23 | procedure Erase(Brick : in Brick_Type; 24 | X : in Width; 25 | Y : in Height); 26 | 27 | procedure Place(Brick : in Brick_Type; 28 | X : in Width; 29 | Y : in Height); 30 | 31 | function Examine(Brick : in Brick_Type; 32 | X : in Width; 33 | Y : in Height) return Boolean; 34 | 35 | procedure Erase_Lines; 36 | 37 | end Wall; 38 | -------------------------------------------------------------------------------- /src/aadl/shields-ardumoto.aadl: -------------------------------------------------------------------------------- 1 | -- This package models the Ardumoto shield for the Arduino. For more 2 | -- details, see 3 | -- http://www.sparkfun.com/commerce/product_info.php?products_id=9213 4 | 5 | package Shields::Ardumoto 6 | public 7 | with Data_Sheet; 8 | with Shields; 9 | 10 | -------------- 11 | -- Ardumoto -- 12 | -------------- 13 | 14 | device Ardumoto extends Shields::Empty_Shield 15 | -- Note: a newer version exists, with different pins, see 16 | -- SparkFun site for more details. 17 | 18 | features 19 | Digital_10 : in event port; 20 | Digital_11 : in event port; 21 | Digital_12 : in event port; 22 | Digital_13 : in event port; 23 | 24 | GND : in out event port; 25 | VIN : in out event port; 26 | 27 | properties 28 | Data_Sheet::UUID => 29 | "http://www.sparkfun.com/commerce/product_info.php?products_id=9213"; 30 | Data_Sheet::Version => "DEV-09213"; 31 | end Ardumoto; 32 | 33 | device implementation Ardumoto.impl 34 | end Ardumoto.impl; 35 | 36 | end Shields::Ardumoto; 37 | -------------------------------------------------------------------------------- /examples/adiru/adiru_memory.aadl: -------------------------------------------------------------------------------- 1 | -- This package models the memory components of the ADIRU system 2 | 3 | package ADIRU_memory 4 | public 5 | 6 | with ARINC653; 7 | 8 | memory partition_memory 9 | -- This component defines a memory segment associated to a 10 | -- partition 11 | end partition_memory; 12 | 13 | memory implementation partition_memory.i 14 | properties 15 | Base_Address => 0; 16 | Memory_Size => 102400 Bytes; 17 | ARINC653::Memory_Type => (Code_Memory); 18 | end partition_memory.i; 19 | 20 | memory main_memory 21 | -- This component represents the whole memory associated to a 22 | -- processor 23 | end main_memory; 24 | 25 | memory implementation main_memory.impl 26 | subcomponents 27 | accMem : memory partition_memory.i; 28 | acc_hmMem : memory partition_memory.i; 29 | ADIRUpMem : memory partition_memory.i; 30 | SHMMem : memory partition_memory.i; 31 | --acc4Mem: memory acc_partition_memory.impl; 32 | end main_memory.impl; 33 | 34 | end ADIRU_memory; 35 | -------------------------------------------------------------------------------- /examples/multicore/MsgType.h: -------------------------------------------------------------------------------- 1 | #ifndef MSGTYPE_H 2 | #define MSGTYPE_H 3 | 4 | #include 5 | 6 | #define FALSE 0 7 | #define TRUE 1 8 | #define MAXNUMBEROFWORDS 34 9 | #define MSGQUEUELENGTH 64 10 | 11 | // data InitializationMsg 12 | // properties 13 | // Source_Language => (C); 14 | // Type_Source_Name => "initmsg"; 15 | // Source_Text => ("MsgType"); 16 | // end InitializationMsg; 17 | 18 | typedef struct InitMessageType{ 19 | uint8_t InitializationComplete; 20 | }INITMESSAGETYPE; 21 | 22 | typedef INITMESSAGETYPE initmsg; 23 | 24 | // data BusMessage 25 | // properties 26 | // Source_Language => (C); 27 | // Type_Source_Name => "busmsg"; 28 | // Source_Text => ("MsgType"); 29 | // end BusMessage; 30 | 31 | typedef struct BusMessageType{ 32 | uint16_t Msg[MAXNUMBEROFWORDS]; 33 | }BUSMESSAGETYPE; 34 | 35 | typedef struct BusMessageQueueType{ 36 | BUSMESSAGETYPE MsgQueue[MSGQUEUELENGTH]; 37 | uint32_t NumberOfMessages; 38 | }BUSMESSAGEQUEUETYPE; 39 | 40 | typedef BUSMESSAGEQUEUETYPE busmsg; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/real/bare_board_theorems.real: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | -- This set of REAL theorems defines implicit constraints defined for 3 | -- bare board systems 4 | -- 5 | -- For each property, we define the list of constraints attached 6 | 7 | -------------------------------------------------------------------------------- 8 | -- Global theorem: this theorem gathers all sub theorem defined in this file. 9 | 10 | theorem check_bare_board_system 11 | foreach s in system_set do 12 | requires (check_threads); 13 | check (1 = 1); 14 | end check_bare_board_system; 15 | 16 | -------------------------------------------------------------------------------- 17 | -- On a bare board system, there can be only one thread 18 | 19 | theorem check_threads 20 | 21 | foreach e in Processor_Set do 22 | 23 | Proc_Set(e) := {x in Process_Set | Is_Bound_To (x, e)}; 24 | Threads := {x in Thread_Set | Is_Subcomponent_Of (x, Proc_Set)}; 25 | 26 | check (Cardinal (Threads) <= Get_Property_Value (e, "Thread_Limit")); 27 | 28 | end check_threads; 29 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-sn74ls157d.aadl: -------------------------------------------------------------------------------- 1 | -- QUADRUPLE 2-LINE TO 1-LINE DATA SELECTIOR/MULTIPLEXER 2 | package devices::SN74LS157D 3 | public 4 | 5 | with Data_Sheet; 6 | with Electricity_Properties; 7 | 8 | device SN74LS157D 9 | features 10 | A1 : in event port; 11 | B1 : in event port; 12 | A2 : in event port; 13 | B2 : in event port; 14 | A3 : in event port; 15 | B3 : in event port; 16 | A4 : in event port; 17 | B4 : in event port; 18 | 19 | Y1 : out event port; 20 | Y2 : out event port; 21 | Y3 : out event port; 22 | Y4 : out event port; 23 | 24 | Ab_B: in out event port; 25 | Gb : in out event port; 26 | Properties 27 | Data_Sheet::UUID => 28 | "http://pdf1.alldatasheet.com/datasheet-pdf/view/170857/TI/SN74LS157D.html"; 29 | end SN74LS157D; 30 | 31 | device implementation SN74LS157D.impl 32 | properties 33 | Electricity_Properties::Core_Voltage => 5.25 v; 34 | Electricity_Properties::VIH_min => 2.0 v; 35 | Electricity_Properties::VIL_max => 0.8 v; 36 | Electricity_Properties::VOH_min => 2.4 v; 37 | Electricity_Properties::VOL_max => 0.4 v; 38 | end SN74LS157D.impl; 39 | 40 | end devices::SN74LS157D; -------------------------------------------------------------------------------- /src/aadl/devices/devices-motor_bl2824.aadl: -------------------------------------------------------------------------------- 1 | package devices::motor_bl2824 2 | public 3 | 4 | with buses::misc; 5 | with Electricity_Properties; 6 | 7 | ----------------- 8 | -- DEVICE -- 9 | ----------------- 10 | device MOTOR 11 | features 12 | three_phases_Wire : requires bus access buses::misc::three_phases_bus.impl; 13 | end MOTOR; 14 | 15 | device implementation MOTOR.impl 16 | properties 17 | Electricity_Properties::Idle_Current => 0.0mA; -- no data 18 | Electricity_Properties::Run_Current => 15.0 mA; -- 90W motor 19 | Electricity_Properties::Core_Voltage => 14.8 V; 20 | Electricity_Properties::Peak_current => 0.0 mA; 21 | Electricity_Properties::Acquisition_Time => 0 ms; 22 | Electricity_Properties::Peak_Time => 0 ms; 23 | 24 | -- BEGIN : Added by Julien 25 | Electricity_Properties::Device_Type => Master; 26 | Electricity_Properties::VOH_min => 3.0 V; 27 | Electricity_Properties::VOL_max => 0.4 V; 28 | Electricity_Properties::VIH_min => 1.0 V; 29 | Electricity_Properties::VIL_max => 2.0 V; 30 | -- END : Added by Julien 31 | 32 | 33 | end MOTOR.impl; 34 | 35 | 36 | end devices::motor_bl2824; 37 | -------------------------------------------------------------------------------- /examples/rosace/rosace-rtems.aadl: -------------------------------------------------------------------------------- 1 | package ROSACE::RTEMS 2 | 3 | -- This package models the controller design from figure 3 of the 4 | -- ROSACE paper, and propose various system to deploy this assembly 5 | -- on RTEMS systems, either in 1-core configuration (ROSACE_RTEMS.Monocore), 6 | -- or 4-core setting (ROSACE_RTEMS.Multicore). 7 | 8 | public 9 | with Deployment; 10 | with ROSACE::POSIX; 11 | 12 | -- In the following, we simply adjust the deployment platform from 13 | -- Native (POSIX) to RTEMS 14 | 15 | system ROSACE_RTEMS extends ROSACE::POSIX::ROSACE_POSIX 16 | end ROSACE_RTEMS; 17 | 18 | system implementation ROSACE_RTEMS.Monocore 19 | extends ROSACE::POSIX::ROSACE_POSIX.Monocore 20 | properties 21 | Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to Hardware; 22 | 23 | end ROSACE_RTEMS.Monocore; 24 | 25 | system implementation ROSACE_RTEMS.Multicore 26 | extends ROSACE::POSIX::ROSACE_POSIX.Multicore 27 | properties 28 | Deployment::Execution_Platform => LEON_RTEMS_POSIX applies to Hardware; 29 | 30 | end ROSACE_RTEMS.Multicore; 31 | 32 | end ROSACE::RTEMS; 33 | -------------------------------------------------------------------------------- /examples/aram/mission_properties.aadl: -------------------------------------------------------------------------------- 1 | -- This package defines properties for defining space mission 2 | -- objectives and requirements. 3 | 4 | property set Mission_Properties is 5 | 6 | -------------------- 7 | -- Mission Timing -- 8 | -------------------- 9 | 10 | Mission_Time_Units: type units 11 | (ps, 12 | ns => ps * 1000, 13 | us => ns * 1000, 14 | ms => us * 1000, 15 | sec => ms * 1000, 16 | min => sec * 60, 17 | hr => min * 60, 18 | day => hr * 24, 19 | week => day * 7); 20 | 21 | Mission_Max_Time: constant Mission_Properties::Mission_Duration_Type 22 | => 1000 week; 23 | 24 | Mission_Duration_Type: type aadlinteger 25 | 0 ps .. Mission_Properties::Mission_Max_Time 26 | units Mission_Properties::Mission_Time_Units; 27 | 28 | Mission_Duration : inherit Mission_Properties::Mission_Duration_Type 29 | applies to (system); 30 | 31 | -------------------------------- 32 | -- Communication requirements -- 33 | -------------------------------- 34 | 35 | Bandwidth_To_Earth : Data_Volume applies to (abstract, system, device, bus); 36 | 37 | end Mission_Properties; 38 | -------------------------------------------------------------------------------- /src/aadl/boards/boards-cpiom.aadl: -------------------------------------------------------------------------------- 1 | -- This package models the hardware part of the CPIOM 2 | -- cf http://www.embedded-systems-portal.com/CTB/CPIOM_Hardware,10004.html 3 | 4 | package Boards::CPIOM 5 | public 6 | 7 | with Buses::ARINC_429; 8 | with Buses::AFDX; 9 | with Devices::AFDX; 10 | with Memories; 11 | with Processors::PPC; 12 | 13 | ----------- 14 | -- CPIOM -- 15 | ----------- 16 | 17 | system CPIOM 18 | features 19 | ARINC429 : requires bus access Buses::ARINC_429::ARINC_429; 20 | AFDX : requires bus access Buses::AFDX::AFDX; 21 | -- XXX discrete? 22 | end CPIOM; 23 | 24 | system implementation CPIOM.impl 25 | subcomponents 26 | -- Memory elements 27 | NVRAM : memory Memories::NVRAM {Memory_Size => 64 MByte;}; 28 | RAM : memory Memories::RAM {Memory_Size => 64 MByte;}; 29 | Flash : memory Memories::Flash_Memory; 30 | 31 | -- Processor 32 | 33 | PPC750 : processor Processors::PPC::PPC750.impl; 34 | 35 | -- Communication devices 36 | 37 | AFDX_1 : device Devices::AFDX::Generic_AFDX; 38 | 39 | end CPIOM.impl; 40 | 41 | end Boards::CPIOM; 42 | -------------------------------------------------------------------------------- /examples/ardupilot/ardupilot_platform.aadl: -------------------------------------------------------------------------------- 1 | package ardupilot_platform 2 | public 3 | with Data_Sheet; 4 | 5 | device GPS 6 | end GPS; 7 | 8 | device ESC 9 | features 10 | pin : in event port; 11 | outM: out event port; 12 | Vin : in event port; 13 | end ESC; 14 | 15 | device elevator 16 | features 17 | ele : in event port; 18 | end elevator; 19 | 20 | device aileron 21 | features 22 | ail : in event port; 23 | end aileron; 24 | 25 | device battery 26 | features 27 | Vout : out event port; 28 | end battery; 29 | 30 | device RC_Rx 31 | features 32 | ch1 : out event port; 33 | ch2 : out event port; 34 | ch3 : out event port; 35 | ch4 : in out event port;-- not used in Ardupilot 36 | ch5 : out event port; 37 | ch6 : in out event port;-- not used in Ardupilot 38 | end RC_Rx; 39 | 40 | device XYZ_sensor 41 | features 42 | Out_XY : out event port; 43 | Out_Z : out event port; 44 | end XYZ_sensor; 45 | 46 | 47 | device Motor 48 | features 49 | pin : in event port; 50 | end Motor; 51 | 52 | properties 53 | Data_Sheet::UUID => "-atmel.com"; -- see doc0943 54 | end ardupilot_platform; 55 | -------------------------------------------------------------------------------- /examples/time_triggered/tt.adb: -------------------------------------------------------------------------------- 1 | with PolyORB_HI.Output; use PolyORB_HI.Output; 2 | 3 | package body TT is 4 | 5 | B0_Cycles : Simple_Type := 0; 6 | B1_Cycles : Simple_Type := 0; 7 | 8 | ------------- 9 | -- B0_Send -- 10 | ------------- 11 | 12 | procedure B0_Send (Out_Value : out Simple_Type) is 13 | begin 14 | Out_Value := B0_Cycles; 15 | Put_Line ("B0: sending: " & Simple_Type'Image (Out_Value)); 16 | B0_Cycles := B0_Cycles + 1; 17 | end B0_Send; 18 | 19 | --------------------- 20 | -- B1_Receive_Send -- 21 | --------------------- 22 | 23 | procedure B1_Receive_Send 24 | (Out_Value : out Simple_Type; In_Value : Simple_Type) is 25 | begin 26 | Out_Value := B1_Cycles; 27 | Put_Line ("B1: received" & Simple_Type'Image (In_Value) 28 | & " sending" & Simple_Type'Image (Out_Value)); 29 | B1_Cycles := B1_Cycles + 1; 30 | end B1_Receive_Send; 31 | 32 | ---------------- 33 | -- B2_Receive -- 34 | ---------------- 35 | 36 | procedure B2_Receive (In_Value : Simple_Type) is 37 | begin 38 | Put_Line ("B2: received" & Simple_Type'Image (In_Value)); 39 | end B2_Receive; 40 | 41 | end TT; 42 | -------------------------------------------------------------------------------- /examples/rosace/rosace-hardware.aadl: -------------------------------------------------------------------------------- 1 | package ROSACE::Hardware 2 | public 3 | with Deployment; 4 | with Processor_Properties; 5 | 6 | --------------- 7 | -- POSIX_CPU -- 8 | --------------- 9 | 10 | processor POSIX_CPU 11 | properties 12 | Scheduling_Protocol => (POSIX_1003_HIGHEST_PRIORITY_FIRST_PROTOCOL); 13 | Deployment::Execution_Platform => Native; 14 | end POSIX_CPU; 15 | 16 | processor implementation POSIX_CPU.Default 17 | -- This implements default POSIX_CPU behavior, does not assume 18 | -- anything on task placement in case of multicore systems. 19 | end POSIX_CPU.Default; 20 | 21 | virtual processor a_core 22 | end a_core; 23 | 24 | virtual processor implementation a_core.impl 25 | end a_core.impl; 26 | 27 | processor implementation POSIX_CPU.Cores4 28 | subcomponents 29 | Cpu0 : virtual processor a_core.impl {Processor_Properties::Core_Id => 0;}; 30 | Cpu1 : virtual processor a_core.impl {Processor_Properties::Core_Id => 1;}; 31 | Cpu2 : virtual processor a_core.impl {Processor_Properties::Core_Id => 2;}; 32 | Cpu3 : virtual processor a_core.impl {Processor_Properties::Core_Id => 3;}; 33 | end POSIX_CPU.Cores4; 34 | 35 | end ROSACE::Hardware; -------------------------------------------------------------------------------- /src/aadl/devices/devices-em406a.aadl: -------------------------------------------------------------------------------- 1 | -- The EM-406A GPS module 2 | 3 | package devices::EM406A 4 | public 5 | 6 | with Electricity_Properties; 7 | with Data_Sheet; 8 | 9 | device EM406A 10 | features 11 | VIN : in event port; 12 | TX : in out event port; 13 | RX : in out event port; 14 | GND : in out event port; 15 | PPS : out event port; 16 | Properties 17 | Data_Sheet::UUID => "http://www.sparkfun.com/products/465"; 18 | 19 | end EM406A; 20 | 21 | device implementation EM406A.impl 22 | properties 23 | Electricity_Properties::Acquisition_Time => 42000 ms; -- the worst case acquisistin time "Cold start" 24 | Electricity_Properties::Core_Voltage => 6.5 v; 25 | Electricity_Properties::Run_current => 4.5mA; -- no Idle, peack current specified 26 | -- noise margin is not specified in datasheet 27 | 28 | end EM406A.impl; 29 | 30 | device V_Regulator 31 | -- on-board voltage regulation included in GPS mudule 32 | Features 33 | GPS_5V : in event port; 34 | V3_3 : out event port; 35 | Properties 36 | Data_Sheet::UUID => "http://api.ning.com/files/BdPAnXQKPPBivh4NGdRV3nuWUin7czE860PWaCUObsdzglDPoc05u*ZEX9FAONjZntUSL75TFGt5vNji-0mdA3Fzxusc0qn3/ArduPilot_Shield1.png"; 37 | 38 | end V_Regulator; 39 | 40 | end devices::EM406A; -------------------------------------------------------------------------------- /src/aadl/devices/devices-router_wifi_refxx.aadl: -------------------------------------------------------------------------------- 1 | package devices::router_wifi_refxx 2 | public 3 | 4 | with buses::ETHERNET; 5 | with Electricity_Properties; 6 | 7 | ----------------- 8 | -- DEVICE -- 9 | ----------------- 10 | device ROUTER_WIFI 11 | features 12 | Serial_Wire1 : requires bus access buses::ETHERNET::ethernet.impl; 13 | Serial_Wire2 : requires bus access buses::ETHERNET::ethernet.impl; 14 | proc_evt : out event port; 15 | end ROUTER_WIFI; 16 | device implementation ROUTER_WIFI.impl 17 | properties 18 | Electricity_Properties::Idle_Current => 10.0 mA; -- no data 19 | Electricity_Properties::Run_Current => 1000.0 mA; -- no data 20 | Electricity_Properties::Peak_Current => 100.0 mA; -- to measure 21 | Electricity_Properties::Core_Voltage => 12.0 V; 22 | Electricity_Properties::VIH_min => 2.0 V; 23 | Electricity_Properties::VIL_max => 1.0 V; 24 | Electricity_Properties::VOH_min => 3.2 V; 25 | Electricity_Properties::VOL_max => 0.4 V; 26 | Electricity_Properties::Acquisition_Time => 0 sec; 27 | Electricity_Properties::Peak_Time => 0 sec; 28 | Electricity_Properties::Device_Type => Master; 29 | end ROUTER_WIFI.impl; 30 | 31 | 32 | end devices::router_wifi_refxx; 33 | 34 | -------------------------------------------------------------------------------- /examples/mjpeg/LIBU.h: -------------------------------------------------------------------------------- 1 | // *********************************************************************** 2 | // 3 | // Filename : LIBU.h 4 | // 5 | // Author : SpaceStudio generation engine 6 | // 7 | // Creation date : Wed Jun 08 15:02:09 EDT 2011 8 | // 9 | // 10 | // *********************************************************************** 11 | 12 | #ifndef LIBU_H 13 | #define LIBU_H 14 | 15 | 16 | #include "jpeg.h" 17 | 18 | #include 19 | 20 | 21 | void libu_funct(unsigned int nbFrames); 22 | void before_libu(void); 23 | 24 | unsigned int WIDTH; 25 | unsigned int HEIGHT; 26 | unsigned int BLOCKS_W; 27 | unsigned int BLOCKS_H; 28 | 29 | unsigned int frameCnt; 30 | unsigned int nb_comp, HiVi[NB_MAX_COMP], lumHi, lumVi; 31 | SPACE_ALIGNED unsigned char Y[4][BLOCK_SIZE], Cb[BLOCK_SIZE], Cr[BLOCK_SIZE]; 32 | int offset; 33 | unsigned int outputPixel; 34 | unsigned long Ready; 35 | unsigned int uiLastCommand; 36 | unsigned int uiCommand; 37 | 38 | 39 | int hei; 40 | int temp; 41 | 42 | unsigned int ycbcr2rgba(unsigned char y, unsigned char cb, unsigned char cr); 43 | unsigned int grayscale2rgba(unsigned char y); 44 | void block_metrics(uint64_t value); 45 | 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/aadl/boards/boards-gr_cpci_x4cv.aadl: -------------------------------------------------------------------------------- 1 | -- This package models the GR-Rasta GR-CPCI-XC4V LEON Compact-PCI 2 | -- development board by AEROFlex Gaisler. 3 | 4 | package Boards::GR_CPCI_X4CV 5 | public 6 | with Processors::SPARC, Memories, Data_Sheet; 7 | with Buses::SpaceWire, Buses::UART; 8 | 9 | ------------------ 10 | -- GR_CPCI_X4CV -- 11 | ------------------ 12 | 13 | system GR_CPCI_X4CV 14 | features 15 | spw_core_1 : requires bus access Buses::SpaceWire::SpaceWire.impl; 16 | spw_core_2 : requires bus access Buses::SpaceWire::SpaceWire.impl; 17 | spw_core_3 : requires bus access Buses::SpaceWire::SpaceWire.impl; 18 | 19 | uart_core_1 : requires bus access Buses::UART::UART.impl; 20 | uart_core_2 : requires bus access Buses::UART::UART.impl; 21 | uart_core_3 : requires bus access Buses::UART::UART.impl; 22 | 23 | properties 24 | Data_Sheet::UUID => "http://www.gaisler.com/cms/index.php?option=com_content&task=view&id=253&Itemid=156"; 25 | 26 | end GR_CPCI_X4CV; 27 | 28 | system implementation GR_CPCI_X4CV.impl 29 | subcomponents 30 | LEON_Core : processor Processors::SPARC::LEON2; 31 | SRAM : memory Memories::SRAM {Memory_size => 64 MByte;}; 32 | end GR_CPCI_X4CV.impl; 33 | 34 | end Boards::GR_CPCI_X4CV; 35 | -------------------------------------------------------------------------------- /examples/memory/vxworks.real: -------------------------------------------------------------------------------- 1 | -- These theorems model constraints specific to the VxWorks kernel 2 | 3 | ------------------------------------------------------------------------------- 4 | -- A kernel shall have: 5 | -- 1) exactly one text, one data and one bss segment, 6 | -- 2) there base address shall verify: 7 | -- base_addr (text) < base_addr (data) < base_addr (segment) 8 | 9 | theorem check_system_image_order 10 | foreach m in Local_Set do 11 | text := { x in memory_set | 12 | is_subcomponent_of(x, m) 13 | and (property(x, "arinc653_extended::Memory_Kind")="text") 14 | }; 15 | 16 | data := { x in memory_set | 17 | is_subcomponent_of(x, m) 18 | and (property(x, "arinc653_extended::Memory_Kind")="data_seg") 19 | and (max(property(text, "Base_Address")) 20 | < property(x, "Base_Address")) 21 | }; 22 | 23 | bss := { x in memory_set | 24 | is_subcomponent_of(x, m) 25 | and (property(x, "arinc653_extended::Memory_Kind")="bss") 26 | and (max(property(data, "Base_Address")) 27 | < property(x, "Base_Address")) 28 | }; 29 | 30 | check ((cardinal(text)=1) 31 | and (cardinal(data)=1) 32 | and (cardinal(bss)=1)); 33 | 34 | end check_system_image_order; 35 | -------------------------------------------------------------------------------- /examples/satellite/satellite_hardware.aadl: -------------------------------------------------------------------------------- 1 | package satellite_hardware 2 | public 3 | 4 | with buses::mil1553; 5 | with memories; 6 | with processors; 7 | 8 | 9 | 10 | ------------------------------------------------------------------------------- 11 | -- the hardware 12 | ------------------------------------------------------------------------------- 13 | bus bus_1553 extends buses::MIL1553::MIL1553 14 | end bus_1553; 15 | 16 | memory RAM extends memories::ROM 17 | features 18 | AVB_bus_connected : requires bus access bus_1553; 19 | ICB_bus_connected : requires bus access bus_1553; 20 | PLB_bus_connected : requires bus access bus_1553; 21 | end RAM; 22 | 23 | -- memory implementation RAM.Impl 24 | -- properties 25 | -- Memory_Protocol => read_write; 26 | -- Word_Size => 32 Bits; 27 | -- end RAM.Impl; 28 | 29 | processor ERC32 extends processors::cpu_rma 30 | features 31 | AVB_bus_connected : requires bus access bus_1553; 32 | ICB_bus_connected : requires bus access bus_1553; 33 | PLB_bus_connected : requires bus access bus_1553; 34 | -- properties 35 | -- Cheddar_Properties::Scheduling_Protocol => POSIX_1003_HIGHEST_PRIORITY_FIRST_PROTOCOL; 36 | end ERC32; 37 | 38 | end satellite_hardware; -------------------------------------------------------------------------------- /examples/aram/aram_properties.aadl: -------------------------------------------------------------------------------- 1 | property set ARAM_Properties is 2 | 3 | Required_Memory : inherit Size applies to 4 | (system, abstract, device, processor); 5 | 6 | Minimum_Size : inherit Size applies to (memory, abstract); 7 | 8 | Memory_Size : inherit Size applies to (memory, abstract); 9 | 10 | Realizes : list of classifier (abstract, system) applies to 11 | (processor, bus, device, abstract, memory, process, system); 12 | -- In our modeling patterns, we use AADLv2 abstract components to 13 | -- model Java-like interfaces, i.e. a set of services to be 14 | -- implemented. The Realizes functions indicates which interface is 15 | -- implemented by a concrete component type 16 | 17 | Actual_Function_Binding : inherit list of reference (abstract, system) 18 | applies to (processor, bus, device, abstract, memory, process); 19 | -- Define the binding of abstract function to actual implementations. 20 | 21 | Required : aadlboolean applies to (system, abstract); 22 | 23 | Redundancy : list of enumeration (hot, warm, cold) applies to (system, abstract); 24 | 25 | Priority : aadlinteger applies to (memory, bus, virtual bus); 26 | 27 | File_Type : enumeration (fixed, extensible, circular) applies to (memory); 28 | 29 | end ARAM_Properties; 30 | -------------------------------------------------------------------------------- /examples/rosace/common/app3_code.c: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | 3 | float 4 | altitude_hold(float h_f, float h_c){ 5 | float Vz_c = -2.5; 6 | static float y = 0.0; 7 | static float Ts_h = 1.0/50.0; 8 | static float integrator = 532.2730285; 9 | 10 | if ((h_f - h_c) < -50) { 11 | // Output 12 | y = Vz_c; 13 | } 14 | else if ((h_f - h_c) > 50) { 15 | // Output 16 | y = -Vz_c; 17 | } 18 | else { 19 | // Output 20 | y = Kp_h * (h_f - h_c) + Ki_h * integrator; 21 | // State 22 | integrator += Ts_h * (h_f - h_c); 23 | } 24 | 25 | return y; 26 | } 27 | 28 | float 29 | Vz_control(float Vz_f, float Vz_c, float q_f, float az_f){ 30 | static float y = 0.0; 31 | static float Ts_K2 = 1.0/50.0; 32 | static float integrator = 0.0; 33 | 34 | // Output 35 | y = K2_intVz * integrator + K2_Vz * Vz_f + K2_q * q_f + K2_az * az_f + delta_e_eq; 36 | // State 37 | integrator += Ts_K2 * (Vz_c - Vz_f); 38 | 39 | return y; 40 | } 41 | 42 | float 43 | Va_control(float Va_f, float Vz_f, float q_f, float Va_c){ 44 | static float y = 0.0; 45 | static float Ts_K1 = 1.0/50.0; 46 | static float integrator = 0.0; 47 | 48 | // Output 49 | y = K1_intVa * integrator + K1_Va * (Va_f - Va_eq) + K1_Vz * Vz_f + K1_q * q_f + delta_th_eq; 50 | // State 51 | integrator += Ts_K1 * (Va_c - Va_f + Va_eq); 52 | 53 | return y; 54 | } 55 | -------------------------------------------------------------------------------- /src/aadl/memories.aadl: -------------------------------------------------------------------------------- 1 | -- This package models hierarchy of memories 2 | 3 | package Memories 4 | public 5 | 6 | ------------ 7 | -- EEPROM -- 8 | ------------ 9 | 10 | memory EEPROM 11 | -- properties 12 | -- ARINC653::Access_Type => (Read, Write); 13 | end EEPROM; 14 | 15 | memory implementation EEPROM.impl 16 | end EEPROM.impl; 17 | 18 | ------------------ 19 | -- Flash_Memory -- 20 | ------------------ 21 | 22 | memory Flash_Memory 23 | -- properties 24 | -- ARINC653::Access_Type => (Read, Write); 25 | end Flash_Memory; 26 | 27 | memory implementation Flash_Memory.impl 28 | end Flash_Memory.impl; 29 | 30 | --------- 31 | -- RAM -- 32 | --------- 33 | 34 | memory RAM 35 | -- properties 36 | -- ARINC653::Access_Type => (Read, Write); 37 | end RAM; 38 | 39 | --------- 40 | -- ROM -- 41 | --------- 42 | 43 | memory ROM 44 | -- properties 45 | -- ARINC653::Access_Type => (Read); 46 | end ROM; 47 | 48 | ---------- 49 | -- SRAM -- 50 | ---------- 51 | 52 | memory SRAM extends RAM 53 | end SRAM; 54 | 55 | memory implementation SRAM.impl 56 | end SRAM.impl; 57 | 58 | ----------- 59 | -- NVRAM -- 60 | ----------- 61 | 62 | memory NVRAM extends RAM 63 | end NVRAM; 64 | 65 | memory implementation NVRAM.impl 66 | end NVRAM.impl; 67 | 68 | end Memories; 69 | -------------------------------------------------------------------------------- /examples/adiru/adiru_devices.aadl: -------------------------------------------------------------------------------- 1 | package ADIRU_Devices 2 | public 3 | 4 | with SHM_DataType; 5 | with ADIRU_errLibrary; 6 | 7 | -- ACC_DEVICE 8 | -- Physical device that produces the acc data that is then 9 | -- sent to ACC_HM. Its output port can propagate erroneous 10 | -- values. 11 | device acc_device 12 | features 13 | accData : out event data port SHM_DataType::accData; 14 | end acc_device; 15 | 16 | device implementation acc_device.impl 17 | annex EMV2 18 | {** 19 | use types ADIRU_errLibrary; 20 | use behavior ADIRU_errLibrary::simple; 21 | 22 | error propagations 23 | accData : out propagation{ValueErroneous}; 24 | flows 25 | f1 : error source accData{ValueErroneous} when failed; 26 | end propagations; 27 | 28 | properties 29 | emv2::hazards => 30 | ([ crossreference => "N/A"; 31 | failure => "Accelerometer value error"; 32 | phases => ("in flight"); 33 | description => "Accelerometer starts to send an erroneous value"; 34 | comment => "Can be critical if not detected by the health monitoring"; 35 | ]) 36 | applies to accData.valueerroneous; 37 | 38 | EMV2::OccurrenceDistribution => [ ProbabilityValue => 3.4e-5 ; Distribution => Fixed;] applies to accData.valueerroneous; 39 | **}; 40 | end acc_device.impl; 41 | 42 | end ADIRU_Devices; -------------------------------------------------------------------------------- /src/aadl/boards/boards-verdex_xm4.aadl: -------------------------------------------------------------------------------- 1 | -- This package models the Gumstix Verdex XM4 board, by Gumstix inc. 2 | 3 | package Boards::Verdex_XM4 4 | public 5 | with Processor_Properties; 6 | with Processors::ARM, Memories, Data_Sheet; 7 | with Buses::Ethernet, Buses::UART; 8 | 9 | ---------------- 10 | -- Verdex_XM4 -- 11 | ---------------- 12 | 13 | -- The Verdex XM4 is a "Computer-On-Module" with a Marvell PXA270 14 | -- processor, plus connectors to various interfaces: USB, microSD, 15 | -- UART, Wifi, ethernet, ... 16 | 17 | system Verdex_XM4 18 | features 19 | uart_core_1 : requires bus access Buses::UART::UART.impl; 20 | 21 | eth_1 : requires bus access Buses::Ethernet::Ethernet.impl; 22 | wifi_1 : requires bus access Buses::Ethernet::Ethernet.impl; 23 | 24 | properties 25 | Data_Sheet::UUID => "http://www.gumstix.com/store/catalog/product_info.php?products_id=209"; 26 | 27 | end Verdex_XM4; 28 | 29 | system implementation Verdex_XM4.i 30 | subcomponents 31 | ARM_Core : processor Processors::ARM::Xscale_PXA270 32 | {Processor_Properties::Processor_Frequency => 400 MHz;}; 33 | SRAM : memory Memories::SRAM {Memory_size => 64 MByte;}; 34 | Flash : memory Memories::Flash_Memory {Memory_size => 16 MByte;}; 35 | end Verdex_XM4.i; 36 | 37 | end Boards::Verdex_XM4; 38 | -------------------------------------------------------------------------------- /examples/ahrs_discovery/ahrs.aadl: -------------------------------------------------------------------------------- 1 | package AHRS 2 | 3 | -- This hierarchy provides a simple AHRS -- Attitude Heading 4 | -- Reference System -- implemented on a STM32F411 Discovery board. 5 | 6 | public 7 | 8 | with AHRS::Data_Types; 9 | 10 | process AHRS_Process 11 | features 12 | acc_in_data_x : in data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 13 | acc_in_data_y : in data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 14 | acc_in_data_z : in data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 15 | 16 | mag_in_data_x : in data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 17 | mag_in_data_y : in data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 18 | mag_in_data_z : in data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 19 | 20 | gyro_in_data_x : in data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 21 | gyro_in_data_y : in data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 22 | gyro_in_data_z : in data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 23 | 24 | roll_out_data : out data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 25 | pitch_out_data : out data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 26 | yaw_out_data : out data port AHRS::Data_Types::FLOAT32_TYPE_AADL; 27 | 28 | flows 29 | f1 : flow sink acc_in_data_x { latency => 10 ms .. 20 ms;}; -- XXX: consolidate to all ports 30 | 31 | end AHRS_Process; 32 | 33 | end AHRS; -------------------------------------------------------------------------------- /examples/behavior_annex/ba_example2.aadl: -------------------------------------------------------------------------------- 1 | -- Copyright © 2008 SAE International 2 | 3 | -- Next example exploits the AADL execution model to compute a speed by 4 | -- counting the number of ticks received each second by the measuring thread. 5 | -- The event port queue acts as a persistent count. At each periodic 6 | -- dispatch, all events received during the previous period are transferred 7 | -- to a thread local queue (implemented as counter) and become available to 8 | -- the user. At that time the event port queue is reset to empty (count 9 | -- zero). The Dequeue_Protocol of AllItems specifies that all events are to 10 | -- be removed from the event port queue. 11 | package BA_example2 public 12 | with Base_Types; 13 | 14 | thread speed 15 | features 16 | tick: in event port { Dequeue_Protocol => AllItems; }; 17 | sp: out data port Base_Types::Integer; 18 | properties 19 | Dispatch_Protocol => periodic; 20 | Period => 1 sec; 21 | end speed; 22 | 23 | thread implementation speed.i 24 | annex behavior_specification {** 25 | states 26 | s0: initial complete final state; 27 | transitions 28 | s0 -[ on dispatch ]-> s0 { sp := tick'count }; 29 | **}; 30 | end speed.i; 31 | 32 | -- Note that in the preceding code, tick�count provides the number of events 33 | -- that are available in the tick port queue. 34 | 35 | end BA_example2; -------------------------------------------------------------------------------- /src/aadl/boards/boards-sbc8349e.aadl: -------------------------------------------------------------------------------- 1 | -- This package models the SBC8349 Edevelopment board. This 2 | -- board is compatible with VxWorks RTOS kernels. 3 | 4 | package Boards::SBC8349E 5 | public 6 | with Processors::PPC; 7 | with Buses::UART, Buses::Ethernet, Buses::PCI; 8 | with Processor_Properties; 9 | with Memories; 10 | 11 | -------------- 12 | -- SBC8349E -- 13 | -------------- 14 | 15 | system SBC8349E 16 | features 17 | uart_core_1 : requires bus access Buses::UART::UART.impl; 18 | uart_core_2 : requires bus access Buses::UART::UART.impl; 19 | 20 | eth_1 : requires bus access Buses::Ethernet::Ethernet.impl; 21 | eth_2 : requires bus access Buses::Ethernet::Ethernet.impl; 22 | 23 | pci : requires bus access Buses::PCI::PCI.impl; 24 | end SBC8349E; 25 | 26 | system implementation SBC8349E.impl 27 | subcomponents 28 | PPC_Core : processor Processors::PPC::MPC8349E 29 | { Processor_Properties::Processor_Frequency => 400 Mhz; }; 30 | SDRAM : memory Memories::SRAM {Memory_size => 256 MByte;}; 31 | 32 | -- XXX check wether it is part of the micro or not 33 | Flash_Memory : memory Memories::Flash_Memory.impl 34 | {Memory_size => 8 MByte;}; 35 | 36 | EEPROM : memory Memories::EEPROM.impl 37 | {Memory_size => 8 MByte;}; 38 | 39 | end SBC8349E.impl; 40 | 41 | end Boards::SBC8349E; 42 | -------------------------------------------------------------------------------- /examples/behavior_annex/ba_example1.aadl: -------------------------------------------------------------------------------- 1 | -- Copyright © 2008 SAE International 2 | 3 | -- This first example shows the use of variable labels as local variables to 4 | -- pass data between successive actions. 5 | package BA_example1 public 6 | 7 | data number 8 | end number; 9 | 10 | subprogram mul 11 | features 12 | x : in parameter number; 13 | y : in parameter number; 14 | z : out parameter number; 15 | end mul; 16 | 17 | subprogram cube 18 | features 19 | x : in parameter number; 20 | y : out parameter number; 21 | mul : requires subprogram access mul; 22 | end cube; 23 | subprogram implementation cube.ba 24 | annex behavior_specification {** 25 | variables tmp : number; 26 | states s : initial final state; 27 | transitions t : s -[]-> s { mul!(x,x,tmp); mul!(tmp,x,y) }; 28 | **}; 29 | end cube.ba; 30 | -- In the preceding code, mul! represents a call to subprogram mul. This can 31 | -- thus be used as a shortcut for the following equivalent call specification 32 | -- expressed in core AADL: 33 | 34 | subprogram implementation cube.no_ba 35 | calls t : { 36 | mul1 : subprogram mul; 37 | mul2 : subprogram mul; 38 | }; 39 | connections 40 | cnx1: parameter x -> mul1.x; 41 | cnx2: parameter x -> mul1.y; 42 | cnx3: parameter mul1.z -> mul2.x; 43 | cnx4: parameter x -> mul2.y; 44 | cnx5: parameter mul2.z -> y; 45 | end cube.no_ba; 46 | 47 | end BA_example1; 48 | -------------------------------------------------------------------------------- /examples/satellite/satellite_system.aadl: -------------------------------------------------------------------------------- 1 | package satellite_system 2 | public 3 | 4 | with satellite_software; 5 | with satellite_hardware; 6 | 7 | ------------------------------------------------------------------------------- 8 | -- the system 9 | ------------------------------------------------------------------------------- 10 | 11 | system OBMU 12 | 13 | end OBMU; 14 | 15 | system implementation OBMU.Impl 16 | subcomponents 17 | OBSW: process satellite_software::SAT_APPLI.Impl; 18 | ERC32: processor satellite_hardware::ERC32; 19 | RAM: memory satellite_hardware::RAM; 20 | AVB: bus satellite_hardware::bus_1553; 21 | ICB: bus satellite_hardware::bus_1553; 22 | PLB: bus satellite_hardware::bus_1553; 23 | 24 | connections 25 | C1: bus access AVB -> RAM.AVB_bus_connected; 26 | C2: bus access AVB -> ERC32.AVB_bus_connected; 27 | C3: bus access ICB -> RAM.ICB_bus_connected; 28 | C4: bus access ICB -> ERC32.ICB_bus_connected; 29 | C5: bus access PLB -> RAM.PLB_bus_connected; 30 | C6: bus access PLB -> ERC32.PLB_bus_connected; 31 | 32 | properties 33 | Actual_Processor_Binding => (reference (erc32)) applies to OBSW; 34 | Actual_Memory_Binding => (reference (ram)) applies to OBSW; 35 | 36 | end OBMU.Impl; 37 | 38 | end satellite_system; -------------------------------------------------------------------------------- /examples/producer_consumer_ba_many_transitions/producer_consumer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int nb_call_of_compute_spg = 1; 7 | 8 | //void compute_spg (base_types__integer *a_data_out) { 9 | void compute_spg (int* a_data_out) { 10 | 11 | if (nb_call_of_compute_spg == 1) 12 | // Use current time as seed for random generator 13 | srand(time(0)); 14 | 15 | nb_call_of_compute_spg++; 16 | 17 | /* random int between 0 and 20 */ 18 | int r = rand() % 20 + 1; 19 | printf ("compute_spg : value = %d \n", r); 20 | *a_data_out = r; 21 | } 22 | 23 | void print_spg 24 | (test__ba__backend_ba_v3__a_struct_impl a_data_in) { 25 | 26 | printf("****************************************** \n"); 27 | printf("#elems of consumed data = %d\n", a_data_in.elem); 28 | fflush(stdout); 29 | for (int i = 0; i < a_data_in.elem; i++) 30 | { 31 | 32 | printf("Consumed data.all_elems [%d] = %d\n", i, a_data_in.all_elems [i]); 33 | fflush(stdout); 34 | } 35 | printf("****************************************** \n"); 36 | } 37 | 38 | void print_thread_begin_execution () 39 | { 40 | 41 | printf("*--------------------------------------------* \n"); 42 | printf(" Thread consumer starts execution \n"); 43 | printf("*--------------------------------------------* \n"); 44 | fflush(stdout); 45 | } 46 | -------------------------------------------------------------------------------- /examples/mjpeg/IQZZ.h: -------------------------------------------------------------------------------- 1 | // *********************************************************************** 2 | // 3 | // Filename : IQZZ.h 4 | // 5 | // Author : SpaceStudio generation engine 6 | // 7 | // Creation date : Wed Jun 08 15:02:04 EDT 2011 8 | // 9 | // 10 | // *********************************************************************** 11 | 12 | #ifndef IQZZ_H 13 | #define IQZZ_H 14 | 15 | #define MAX_Q_TABLE 3 16 | #define Q_TABLE_SIZE 64 17 | 18 | 19 | #include 20 | 21 | 22 | void iqzz_funct(unsigned int uiCommand, unsigned int nbQuant); 23 | unsigned int before_iqzz(unsigned int nbQuant); 24 | 25 | 26 | unsigned long m_uiOffset; 27 | unsigned char m_Buffer[4]; 28 | bool m_BufferValid; 29 | unsigned char m_QuantizationTables[MAX_Q_TABLE][Q_TABLE_SIZE]; 30 | 31 | SPACE_ALIGNED short in[BLOCK_SIZE]; 32 | SPACE_ALIGNED short UnZZ[BLOCK_SIZE]; 33 | unsigned int NBLOCKS; 34 | unsigned int nb_comp, HiVi[NB_MAX_COMP], Hi, Vi, selector; 35 | 36 | int nbQuantReal; 37 | int size; 38 | 39 | 40 | 41 | /// 42 | /// Methods 43 | /// 44 | void load_multi_quant_table(unsigned char QuantizationTables[MAX_Q_TABLE][Q_TABLE_SIZE], int nbQuant); 45 | void load_quant_table(unsigned char QuantizationTables[MAX_Q_TABLE][Q_TABLE_SIZE], unsigned short tableID); 46 | unsigned short read_16_bits(); 47 | unsigned char read_8_bits(); 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-router_wifi_wndr3300.aadl: -------------------------------------------------------------------------------- 1 | package devices::router_wifi_wndr3300 2 | public 3 | 4 | with buses::misc; 5 | with Buses::Ethernet; 6 | with Electricity_Properties; 7 | 8 | ----------------- 9 | -- DEVICE -- 10 | ----------------- 11 | device ROUTER_WIFI 12 | features 13 | Port1 : requires bus access Buses::Ethernet::Ethernet.impl; 14 | Port2 : requires bus access Buses::Ethernet::Ethernet.impl; 15 | Port3 : requires bus access Buses::Ethernet::Ethernet.impl; 16 | Port4 : requires bus access Buses::Ethernet::Ethernet.impl; 17 | Supply : requires bus access buses::misc::V12_Bus.impl; 18 | proc_evt : out event port; 19 | end ROUTER_WIFI; 20 | device implementation ROUTER_WIFI.impl 21 | properties 22 | Electricity_Properties::Idle_Current => 10.0 mA; -- no data 23 | Electricity_Properties::Run_Current => 1000.0 mA; -- no data 24 | Electricity_Properties::Peak_Current => 100.0 mA; -- to measure 25 | Electricity_Properties::Core_Voltage => 12.0 V; 26 | Electricity_Properties::VIH_min => 2.0 V; 27 | Electricity_Properties::VIL_max => 1.0 V; 28 | Electricity_Properties::VOH_min => 3.2 V; 29 | Electricity_Properties::VOL_max => 0.4 V; 30 | Electricity_Properties::Acquisition_Time => 0 sec; 31 | Electricity_Properties::Peak_Time => 0 sec; 32 | Electricity_Properties::Device_Type => Master; 33 | end ROUTER_WIFI.impl; 34 | 35 | 36 | end devices::router_wifi_wndr3300; 37 | -------------------------------------------------------------------------------- /src/aadl/boards/boards-arduimu.aadl: -------------------------------------------------------------------------------- 1 | -- This package models the ArduIMU platform, an AVR-based derivative 2 | -- of the Arduino. For more details, see http://code.google.com/p/ardu-imu/ 3 | 4 | package Boards::ArduImu 5 | public 6 | with Data_Sheet; 7 | with Processor_Properties; 8 | 9 | with Buses::I2C; 10 | with Buses::UART; 11 | 12 | with Devices::ADXL; 13 | with Devices::LPR530AL; 14 | with Devices::LY530ALH; 15 | 16 | with Processors::ATMEGA; 17 | 18 | ------------- 19 | -- ArduIMU -- 20 | ------------- 21 | 22 | -- The ArduIMU is an Arduino-based AHRS (Attitude Heading Reference 23 | -- System) made of an ATMEGA328p, one three-axis analog 24 | -- accelerometer (ADXL335), one one-axis gyrometer (LY530ALH) and 25 | -- one two-axis gyrometer (LPR530AL). 26 | 27 | system ArduIMU 28 | properties 29 | Data_Sheet::UUID => "http://code.google.com/p/ardu-imu/"; 30 | end ArduIMU; 31 | 32 | system implementation ArduImu.impl 33 | subcomponents 34 | ATMEGA328p : processor Processors::ATMEGA::ATMEGA328p.impl 35 | { Processor_Properties::Processor_Frequency => 16 Mhz; }; 36 | 37 | ADXL335 : device Devices::ADXL::ADXL335.impl; 38 | LPR530AL : device Devices::LPR530AL::LPR530AL.impl; 39 | LY530ALH : device Devices::LY530ALH::LY530ALH.impl; 40 | 41 | I2C : bus Buses::I2C::I2C.impl; 42 | UART : bus Buses::UART::UART.impl; 43 | end ArduImu.impl; 44 | 45 | end Boards::ArduImu; 46 | -------------------------------------------------------------------------------- /src/real/edf_theorems.real: -------------------------------------------------------------------------------- 1 | -- Earliest deadline first (EDF) is a dynamic scheduling 2 | -- algorithm used in real-time operating systems 3 | 4 | -- This theorem is able to verify EDF schedulability 5 | -- on each processor designed in a system 6 | 7 | -- check_prop_def : verify existence of required properties 8 | -- and then all threads are periodic 9 | 10 | theorem edf_prop_def 11 | 12 | foreach e in thread_set do 13 | 14 | check( Exists (e,"Dispatch_Protocol") 15 | and (Property (e, "Dispatch_Protocol") = "Periodic") 16 | and Exists (e,"compute_execution_time") 17 | and Exists (e,"Period")); 18 | 19 | end edf_prop_def; 20 | 21 | -- Utilization_Factor : compute and return utilization factor 22 | -- of a thread set. 23 | 24 | theorem Utilization_Factor 25 | 26 | foreach e in Local_Set do 27 | 28 | var Period := Property (e, "period"); 29 | var CET := Last ( Property (e, "compute_execution_time")); 30 | var Factor := CET / Period; 31 | 32 | return (MSum (Factor)); 33 | 34 | end Utilization_Factor; 35 | 36 | -- theorem EDF uses Utilization_Factor returned value 37 | -- for checking EDF schedulability law. 38 | 39 | theorem edf 40 | 41 | foreach e in processor_set do 42 | 43 | Processes (e) := { x in process_set | Is_Bound_To (x, e)}; 44 | Threads := { x in thread_Set | Is_Subcomponent_Of (x, processes)}; 45 | 46 | var Sum_Utilizations := compute Utilization_Factor(Threads); 47 | 48 | check (Sum_Utilizations <= 1); 49 | 50 | end edf; 51 | 52 | -------------------------------------------------------------------------------- /examples/stm32discovery_ada/stm32discovery_ada.aadl: -------------------------------------------------------------------------------- 1 | -- This example demonstrates how to use an embedded Ada runtime when 2 | -- performing code generation from AADL. 3 | -- 4 | -- It blink a led on a STM32F407 Discovery kit, and relies on the ada 5 | -- Drivers Library from AdaCore 6 | 7 | package STM32Discovery_Ada 8 | public 9 | with Deployment; 10 | 11 | subprogram Blink 12 | properties 13 | Source_Language => (Ada); 14 | Source_Name => "blink.do_blink"; 15 | end Blink; 16 | 17 | thread Task end Task; 18 | 19 | thread implementation Task.impl_1 20 | calls 21 | Mycalls: { P_Spg : subprogram Blink; }; 22 | 23 | properties 24 | Dispatch_Protocol => Periodic; 25 | Priority => 1; 26 | Period => 1000 ms; 27 | end Task.impl_1; 28 | 29 | processor Cortex_M4 30 | properties 31 | Deployment::Execution_Platform => GNAT_Runtime; 32 | Deployment::Ada_Runtime => "stm32f407_discovery"; 33 | end Cortex_M4; 34 | 35 | process node_a 36 | end node_a; 37 | 38 | process implementation node_a.impl 39 | subcomponents 40 | Task1 : thread Task.impl_1; 41 | end node_a.impl; 42 | 43 | system blinky 44 | end blinky; 45 | 46 | system implementation blinky.impl 47 | subcomponents 48 | node_a : process node_a.impl; 49 | cpu : processor Cortex_M4; 50 | properties 51 | Actual_Processor_Binding => (reference (cpu)) applies to node_a; 52 | 53 | end blinky.impl; 54 | 55 | end STM32Discovery_Ada; 56 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Quick installation instructions for AADLib 2 | ========================================== 3 | 4 | Please refer to the AADLib user's guide for more detailed 5 | installation instructions. 6 | 7 | BUILD REQUIREMENTS: 8 | =================== 9 | 10 | - Ocarina 2.0w 11 | - OSATE2 12 | 13 | Optionnaly autoconf/automake if you rebuild from a fresh copy of the 14 | repository. 15 | 16 | BUILD AND INSTALLATION INSTRUCTIONS FOR AADLIB: 17 | =============================================== 18 | 19 | - Install Ocarina as specified by its documentation and make sure its 20 | 'bin' installation directories is located at the top of your PATH 21 | environment variable. 22 | 23 | - Issue 24 | ./configure 25 | make && make install 26 | 27 | - Type ./configure --help to get the list of possible options. 28 | 29 | If you modify source files, build AADLib after a checkout or 30 | make distclean, or the directory hierarchy of the source files, you 31 | should re-generate autoconf and automake files (configure, 32 | Makefile.in...); to do this, from the main directory, run: 33 | 34 | ./support/reconfig 35 | 36 | BUILD AND INSTALLATION INSTRUCTIONS FOR OSATE2: 37 | =============================================== 38 | 39 | - Install OSATE2 as specified by its documentation 40 | 41 | - AADLib is designed as an OSATE2 project, simply import it using 42 | either git import mechanisms, or from your filesystem. 43 | 44 | - Examples can be ran separately by instanciating their root system 45 | -------------------------------------------------------------------------------- /examples/memory/vxworks_platform.aadl: -------------------------------------------------------------------------------- 1 | -- This package models a VxWorks platform based on a 68040 processor 2 | -- and attached memory components for the MV162 board. 3 | 4 | package VxWorks_Platform 5 | public 6 | 7 | with processors; 8 | with memories_vxworks; 9 | 10 | --------------- 11 | -- Processor -- 12 | --------------- 13 | 14 | processor MC68040_proc extends processors::MC68040 15 | end MC68040_proc; 16 | 17 | processor implementation MC68040_proc.impl 18 | end MC68040_proc.impl; 19 | 20 | ------------ 21 | -- Memory -- 22 | ------------ 23 | 24 | memory memory_segment extends memories_vxworks::memory_segment 25 | end memory_segment; 26 | 27 | memory implementation memory_segment.impl extends memories_vxworks::memory_segment.impl 28 | end memory_segment.impl; 29 | 30 | memory implementation memory_segment.system_image extends memories_vxworks::memory_segment.system_image 31 | end memory_segment.system_image; 32 | 33 | memory implementation memory_segment.board_specific extends memories_vxworks::memory_segment.board_specific 34 | end memory_segment.board_specific; 35 | 36 | memory address_space extends memories_vxworks::address_space 37 | end address_space; 38 | 39 | memory implementation address_space.vxworks extends memories_vxworks::address_space.vxworks 40 | end address_space.vxworks; 41 | 42 | memory implementation address_space.mv162 extends memories_vxworks::address_space.mv162 43 | end address_space.mv162; 44 | 45 | end VxWorks_Platform; 46 | -------------------------------------------------------------------------------- /src/real/rma_theorems.real: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- 3 | -- Check whether the threads bound to each processors can be 4 | -- scheduled with RMA (cf. Liu, Layland. "Scheduling Algorithms for 5 | -- Multi-programming in hard-Real-Time Environment", JACM, 01/1973) 6 | 7 | -- Utility theorem: compute Utilization factor for a set of threads 8 | 9 | -- check_prop_def : verify existence of required properties 10 | -- and then all threads are periodic 11 | 12 | theorem rma_prop_def 13 | 14 | foreach e in thread_set do 15 | check( Exists (e,"Dispatch_Protocol") 16 | and (Property (e, "Dispatch_Protocol") = "Periodic") 17 | and Exists (e,"compute_execution_time") 18 | and Exists (e,"Period")); 19 | 20 | end rma_prop_def; 21 | 22 | theorem evaluate_utilization 23 | foreach e in Local_Set do 24 | var Period := get_property_value (e, "period"); 25 | var WCET := last (get_property_value (e, "compute_execution_time")); 26 | var U := WCET/Period; 27 | 28 | return (MSum (U)); 29 | end evaluate_utilization; 30 | 31 | -- Main RMA theorem starts here 32 | 33 | theorem rma 34 | 35 | foreach e in Processor_Set do 36 | Proc_Set(e) := {x in Process_Set | Is_Bound_To (x, e)}; 37 | Threads := {x in Thread_Set | Is_Subcomponent_Of (x, Proc_Set)}; 38 | 39 | var U := compute evaluate_utilization (Threads); 40 | check (U <= (Cardinal (Threads) * (2 ** (1 / Cardinal (Threads))) -1)); 41 | 42 | end rma; 43 | -------------------------------------------------------------------------------- /examples/rap_code/Makefile.am: -------------------------------------------------------------------------------- 1 | AADL_SOURCES = $(srcdir)/rap.aadl 2 | AADL_ROOT = rap.native 3 | 4 | OTHER_FILES = $(srcdir)/ac_flight_data.adb \ 5 | $(srcdir)/mpd_tactical_display.ads \ 6 | $(srcdir)/ac_flight_data.ads $(srcdir)/radar_controller.adb \ 7 | $(srcdir)/builtin_test.adb $(srcdir)/radar_controller.ads \ 8 | $(srcdir)/builtin_test.ads $(srcdir)/rwr_control.adb \ 9 | $(srcdir)/computations.adb $(srcdir)/rwr_control.ads \ 10 | $(srcdir)/computations.ads $(srcdir)/rwr_threat_response.adb \ 11 | $(srcdir)/hotas.adb $(srcdir)/rwr_threat_response.ads \ 12 | $(srcdir)/hotas.ads $(srcdir)/steering.adb \ 13 | $(srcdir)/hud_display.adb $(srcdir)/steering.ads \ 14 | $(srcdir)/hud_display.ads $(srcdir)/target_designation.adb \ 15 | $(srcdir)/hw.adb $(srcdir)/target_designation.ads \ 16 | $(srcdir)/hw.ads $(srcdir)/target_tracking.adb \ 17 | $(srcdir)/keyset.adb $(srcdir)/target_tracking.ads \ 18 | $(srcdir)/keyset.ads $(srcdir)/weapon_release.adb \ 19 | $(srcdir)/mpd_status_display.adb $(srcdir)/weapon_release.ads \ 20 | $(srcdir)/mpd_status_display.ads \ 21 | $(srcdir)/weapon_selection.adb \ 22 | $(srcdir)/mpd_stores_display.adb \ 23 | $(srcdir)/weapon_selection.ads \ 24 | $(srcdir)/mpd_stores_display.ads \ 25 | $(srcdir)/weapon_trajectory.adb \ 26 | $(srcdir)/mpd_tactical_display.adb \ 27 | $(srcdir)/weapon_trajectory.ads 28 | 29 | 30 | CLEANDIRS = rap_native 31 | CLEANFILES = 32 | 33 | include $(srcdir)/../Makefile.common 34 | 35 | AVAILABLE_TARGETS= parse-aadl cheddar ada 36 | -------------------------------------------------------------------------------- /src/aadl/drivers/asn1_configuration.aadl: -------------------------------------------------------------------------------- 1 | package ASN1_Configuration 2 | public 3 | with Deployment; 4 | 5 | ------------------------ 6 | -- Configuration Type -- 7 | ------------------------ 8 | 9 | data configuration_type_ip 10 | properties 11 | Type_Source_Name => "IP-Conf-T"; 12 | Deployment::ASN1_Module_Name => "POHICDRIVER-IP"; 13 | Source_Language => (ASN1); 14 | Source_Text => ("OCARINA_INCLUDE_PATH/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/ip.asn" , "drivers/configuration/ip.h"); 15 | end configuration_type_ip; 16 | 17 | data configuration_type_serial 18 | properties 19 | Type_Source_Name => "Serial-Conf-T"; 20 | Deployment::ASN1_Module_Name => "POHICDRIVER-UART"; 21 | Source_Language => (ASN1); 22 | Source_Text => ("OCARINA_INCLUDE_PATH/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/serial.asn", "drivers/configuration/serial.h"); 23 | end configuration_type_serial; 24 | 25 | data configuration_type_spacewire 26 | properties 27 | Type_Source_Name => "Spacewire-Conf-T"; 28 | Deployment::ASN1_Module_Name => "POHICDRIVER-SPACEWIRE"; 29 | Source_Language => (ASN1); 30 | Source_Text => ("OCARINA_INCLUDE_PATH/ocarina/runtime/polyorb-hi-c/src/drivers/configuration/spacewire.asn", "drivers/configuration/spacewire.h"); 31 | end configuration_type_spacewire; 32 | 33 | end ASN1_Configuration; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2024, OpenAADL 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /src/aadl/boards/boards-sbcp4080.aadl: -------------------------------------------------------------------------------- 1 | -- This package models the SBCP4080 Edevelopment board. This 2 | -- board is compatible with VxWorks RTOS kernels. 3 | 4 | package Boards::SBCP4080E 5 | public 6 | with Processors::PPC; 7 | with Buses::UART, Buses::Ethernet, Buses::PCI; 8 | with Processor_Properties; 9 | with Memories; 10 | with Data_Sheet; 11 | 12 | -------------- 13 | -- SBCP4080E -- 14 | -------------- 15 | 16 | system SBCP4080E 17 | features 18 | uart_core_1 : requires bus access Buses::UART::UART.impl; 19 | uart_core_2 : requires bus access Buses::UART::UART.impl; 20 | 21 | eth_1 : requires bus access Buses::Ethernet::Ethernet.impl; 22 | eth_2 : requires bus access Buses::Ethernet::Ethernet.impl; 23 | 24 | pci : requires bus access Buses::PCI::PCI.impl; 25 | 26 | properties 27 | Data_Sheet::UUID => "http://www.windriver.com/products/OCD/SBCP4080/"; 28 | 29 | end SBCP4080E; 30 | 31 | system implementation SBCP4080E.impl 32 | subcomponents 33 | P4080 : processor Processors::PPC::P4080.impl 34 | { Processor_Properties::Processor_Frequency => 1_500 Mhz; }; 35 | 36 | SDRAM_1 : memory Memories::SRAM {Memory_size => 2 GByte;}; 37 | SDRAM_2 : memory Memories::SRAM {Memory_size => 2 GByte;}; 38 | 39 | -- XXX check wether it is part of the micro or not 40 | Flash_Memory : memory Memories::Flash_Memory.impl 41 | {Memory_size => 1 GByte;}; 42 | 43 | EEPROM : memory Memories::EEPROM.impl 44 | {Memory_size => 8 KByte;}; 45 | 46 | end SBCP4080E.impl; 47 | 48 | end Boards::SBCP4080E; 49 | -------------------------------------------------------------------------------- /examples/fms/m3_software.aadl: -------------------------------------------------------------------------------- 1 | package m3_software 2 | public 3 | 4 | with dataType; 5 | 6 | ------------------------------------------------------------------- 7 | -----------------------processes------------------------------------- 8 | ------------------------------------------------------------------- 9 | 10 | process prs_ADIRU1 11 | features 12 | pres1_apex : in event data port dataType::pression; 13 | speed1_apex : out event data port dataType::speed; 14 | flows 15 | fromPresToSpeed : flow path pres1_apex -> speed1_apex ; 16 | end prs_ADIRU1; 17 | 18 | process implementation prs_ADIRU1.impl 19 | subcomponents 20 | ADIRU1 : thread th_ADIRU1; 21 | connections 22 | pres1ApexToFunct : port pres1_apex -> ADIRU1.th_pres1; 23 | speed1FunctToApex : port ADIRU1.th_speed1 -> speed1_apex; 24 | flows 25 | fromPresToSpeed : flow path pres1_apex -> pres1ApexToFunct -> ADIRU1.speed_computation-> speed1FunctToApex -> speed1_apex ; 26 | end prs_ADIRU1.impl; 27 | 28 | ------------------------------------------------------------------- 29 | -----------------------threads------------------------------------- 30 | ------------------------------------------------------------------- 31 | 32 | thread th_ADIRU1 33 | 34 | features 35 | th_pres1 : in event data port dataType::pression; 36 | th_speed1 : out event data port dataType::speed; 37 | flows 38 | speed_computation : flow path th_pres1 -> th_speed1; 39 | properties 40 | Dispatch_protocol => periodic; 41 | period => 60 ms; 42 | compute_execution_time => 0 ms .. 30 ms; 43 | deadline => 60 ms; 44 | -- priority => 7; 45 | 46 | end th_ADIRU1; 47 | 48 | end m3_software; -------------------------------------------------------------------------------- /examples/mjpeg/mjpeg-platform.aadl: -------------------------------------------------------------------------------- 1 | package mjpeg::platform 2 | public 3 | with SpaceStudio; 4 | 5 | processor a9 6 | features 7 | socket : requires bus access AMBA; 8 | end a9; 9 | 10 | processor implementation a9.impl 11 | properties 12 | SpaceStudio::Subtype_component => armCortexA9; 13 | SpaceStudio::Simulation_Model => "armCortexA9_DisTLM"; 14 | end a9.impl; 15 | 16 | processor ub 17 | features 18 | socket : requires bus access AMBA; 19 | end ub; 20 | 21 | processor implementation ub.impl 22 | properties 23 | SpaceStudio::Subtype_component => uBlaze; 24 | end ub.impl; 25 | 26 | bus AMBA 27 | properties 28 | SpaceStudio::Subtype_component => AMBA_AXIBus; 29 | end AMBA; 30 | 31 | memory BRAM 32 | features 33 | b0 : requires bus access AMBA; 34 | properties 35 | SpaceStudio::Subtype_component => XilinxBRAM; 36 | end BRAM; 37 | 38 | system platform 39 | end platform; 40 | 41 | system implementation platform.ubimpl 42 | subcomponents 43 | proc : processor ub.impl; 44 | busAmba : bus AMBA; 45 | mem : memory BRAM; 46 | connections 47 | b0 : bus access busAmba <-> proc.socket; 48 | b1 : bus access busAmba <-> mem.b0; 49 | end platform.ubimpl; 50 | 51 | system implementation platform.a9impl 52 | subcomponents 53 | proc : processor a9.impl; 54 | busAmba : bus AMBA; 55 | mem : memory BRAM; 56 | connections 57 | b0 : bus access busAmba <-> proc.socket; 58 | b1 : bus access busAmba <-> mem.b0; 59 | end platform.a9impl; 60 | 61 | end mjpeg::platform; 62 | -------------------------------------------------------------------------------- /src/aadl/devices/devices-adxl.aadl: -------------------------------------------------------------------------------- 1 | -- This package defines some Accelerometer from the ADXL family 2 | 3 | package Devices::ADXL 4 | public 5 | with Data_Sheet; 6 | with Unit; 7 | with Electricity_Properties; 8 | 9 | ------------- 10 | -- ADXL335 -- 11 | ------------- 12 | -- The ADXL335 device is a 3-axis analogue accelerometer 13 | 14 | device ADXL335 15 | features 16 | X : out data port Unit::Acceleration; 17 | Y : out data port Unit::Acceleration; 18 | Z : out data port Unit::Acceleration; 19 | 20 | properties 21 | Data_Sheet::UUID => "http://www.sparkfun.com/products/9265"; 22 | end ADXL335; 23 | 24 | device implementation ADXL335.impl 25 | Properties 26 | Electricity_Properties::VIL_max => 0.6v; 27 | Electricity_Properties::VIH_min => 2.4v; 28 | Electricity_Properties::VOL_max => 0.1v; 29 | Electricity_Properties::VOH_min => 2.8v; 30 | Electricity_Properties::Core_Voltage => 3.0 V; 31 | Electricity_Properties::Acquisition_Time => 1 ms; 32 | Electricity_Properties::Run_Current => 350.0 uA; 33 | 34 | end ADXL335.impl; 35 | 36 | ------------- 37 | -- ADXL345 -- 38 | ------------- 39 | 40 | device ADXL345 41 | properties 42 | Data_Sheet::UUID => "http://www.sparkfun.com/products/9045"; 43 | end ADXL345; 44 | 45 | device implementation ADXL345.impl 46 | properties 47 | Electricity_Properties::Core_Voltage => 3.6 v; 48 | Electricity_Properties::VIH_min => 2.88 v; 49 | Electricity_Properties::VIL_max => 0.72 v; 50 | Electricity_Properties::VOH_min => 3.06 v; 51 | Electricity_Properties::VOL_max => 0.54 v; 52 | end ADXL345.impl; 53 | 54 | end Devices::ADXL; 55 | -------------------------------------------------------------------------------- /examples/round_robin/round_robin.aadl: -------------------------------------------------------------------------------- 1 | -- This package demonstrates how to model a system based on a 2 | -- Round-Robin scheduler, with two variants: preemptive and 3 | -- non-preemptive. 4 | 5 | package Round_Robin 6 | public 7 | 8 | with processors; 9 | 10 | thread T 11 | properties 12 | Dispatch_Protocol => Periodic; 13 | Priority => 1; 14 | end T; 15 | 16 | process P 17 | end P; 18 | 19 | process implementation P.impl 20 | subcomponents 21 | T1 : thread T 22 | {Time_Slot => (1,3); 23 | Compute_Execution_Time => 0 ms .. 10 ms; 24 | Period => 20 ms; 25 | }; 26 | T2 : thread T 27 | {Time_Slot => (2); 28 | Compute_Execution_Time => 0 ms .. 10 ms; 29 | Period => 20 ms; 30 | }; 31 | end P.impl; 32 | 33 | processor Proc extends processors::Proc 34 | end Proc; 35 | 36 | processor implementation Proc.RR_NoPreemption extends processors::Proc.RR_NoPreemption 37 | end Proc.RR_NoPreemption; 38 | 39 | processor implementation Proc.RR_Preemption extends processors::Proc.RR_Preemption 40 | end Proc.RR_Preemption; 41 | 42 | system RR 43 | end RR; 44 | 45 | system implementation RR.impl_nopreempt 46 | subcomponents 47 | P : process P.impl; 48 | Proc : processor Proc.RR_NoPreemption; 49 | properties 50 | Actual_Processor_Binding => (reference (Proc)) applies to P; 51 | end RR.impl_nopreempt; 52 | 53 | system implementation RR.impl_preempt 54 | subcomponents 55 | P : process P.impl; 56 | Proc : processor Proc.RR_Preemption; 57 | properties 58 | Actual_Processor_Binding => (reference (Proc)) applies to P; 59 | end RR.impl_preempt; 60 | 61 | end Round_Robin; 62 | -------------------------------------------------------------------------------- /examples/aram/gaia.aadl: -------------------------------------------------------------------------------- 1 | -- This package models mission criteria for the Gaia mission. 2 | 3 | package GAIA 4 | public 5 | 6 | with Mission_Properties; 7 | with Physical_Properties; 8 | 9 | -- Root system for the Gaia mission 10 | -- 11 | -- This system defines the Gaia mission requirements to be 12 | -- fullfilled by each variant of the models that support the GAIA 13 | -- mission design. 14 | -- 15 | -- For a first (public) description of Gaia, see 16 | -- http://sci.esa.int/science-e/www/area/index.cfm?fareaid=26 17 | -- 18 | -- This system is split in two parts: 19 | -- 1) requirements are defined as AADLv2 properties, in the 20 | -- "properties" subclause of the system; 21 | -- 22 | -- 2) validation of these requirements is performed by REAL 23 | -- specifications, in the "real_specification" annex subclause. 24 | 25 | system Gaia 26 | properties 27 | Mission_Properties::Bandwidth_To_Earth => 10 Mbytesps; 28 | Physical_Properties::Total_Power => 350.0 W; 29 | Physical_Properties::Max_Mass => 40.0 Kg; 30 | 31 | annex real_specification {** 32 | theorem check_all 33 | foreach s in Root_System_Set do 34 | system := { sys in Root_System_Set | 1 = 1 }; 35 | 36 | var verif_mass := compute check_mass (system); 37 | var verif_power := compute check_power_consume (system); 38 | -- requires (check_mass 39 | -- and check_power_consume 40 | -- and check_devices 41 | -- ); 42 | --check (1 = 1); 43 | check (verif_mass = 0.0 44 | and verif_power = 0.0); 45 | 46 | 47 | check (1 = 1); 48 | end check_all; 49 | **}; 50 | end Gaia; 51 | 52 | end GAIA; 53 | -------------------------------------------------------------------------------- /src/aadl/systems.aadl: -------------------------------------------------------------------------------- 1 | -- This package models several root systems, each of which defines a 2 | -- set of architecture-level properties to be verified using REAL 3 | 4 | package Systems 5 | public 6 | 7 | ----------------- 8 | -- AADL_System -- 9 | ----------------- 10 | 11 | -- This system drags all advanced AADL legality rules not checked 12 | -- by Ocarina. 13 | 14 | system AADL_System 15 | annex real_specification {** 16 | theorem check_all 17 | foreach s in local_set do 18 | requires (check_aadl); 19 | check (1 = 1); 20 | end check_all; 21 | **}; 22 | end AADL_System; 23 | 24 | --------------------- 25 | -- ARINC653_System -- 26 | --------------------- 27 | 28 | -- This system models a ARINC653-compliant system, see 29 | -- corresponding REAL theorems for more details. 30 | 31 | -- system ARINC653_System extends AADL_System 32 | -- annex real_specification {** 33 | -- theorem check_arinc653 34 | -- foreach s in local_set do 35 | -- requires (check_arinc653_restrictions); 36 | -- check (1 = 1); 37 | -- end check_arinc653; 38 | -- **}; 39 | -- end ARINC653_System; 40 | 41 | ---------------------- 42 | -- Ravenscar_System -- 43 | ---------------------- 44 | 45 | -- This system models a Ravenscar-compliant system, see 46 | -- corresponding REAL theorems for more details. 47 | 48 | system Ravenscar_System extends AADL_System 49 | annex real_specification {** 50 | theorem check_ravenscar 51 | foreach s in local_set do 52 | requires (check_ravenscar_profile); 53 | check (1 = 1); 54 | end check_ravenscar; 55 | **}; 56 | end Ravenscar_System; 57 | 58 | end Systems; 59 | -------------------------------------------------------------------------------- /src/property_set/processor_properties.aadl: -------------------------------------------------------------------------------- 1 | -- This property set lists additional properties for processors 2 | -- 3 | -- In AADLib, we assume that a processor models only the hardware 4 | -- processor, the operating system services (scheduler, etc) are 5 | -- modeled as virtual processor to separate concerns. 6 | 7 | property set Processor_Properties is 8 | 9 | Processor_Family : enumeration 10 | (ARM, AVR, SPARC, PowerPC, x86, x86_64) applies to (processor); 11 | 12 | Frequency : type aadlinteger 0 Hz .. 2#1#e32 Hz units 13 | (Hz, KHz => Hz * 1000, MHz => KHz * 1000, GHz => MHz * 1000); 14 | -- Frequency of a processor 15 | 16 | Processor_Frequency : Processor_Properties::Frequency applies to (processor); 17 | 18 | Endianess: enumeration (Little_Endian, Big_Endian, Bi_Endian) 19 | applies to (processor); 20 | -- Endianess of the processor. Note that some processors can either 21 | -- be Little- or Big- endian, the OS decides of the actual endianess. 22 | 23 | Word_Length : Size applies to (processor); 24 | -- Length of a word for this processor architecture 25 | 26 | FPU_Present : aadlboolean applies to (processor); 27 | 28 | MIPS : aadlinteger 0 .. Max_Aadlinteger applies to (processor); 29 | 30 | Max_Prio_First : processor_properties::Alowed_Max_Prio_First 31 | applies to (processor); 32 | 33 | Alowed_Max_Prio_First : type enumeration (high, low); 34 | -- Max_Prio_First indicates if the scheduler takes the highest 35 | -- priority of threads is the highest value of threads priorities 36 | -- or inversely 37 | 38 | Core_Id : aadlinteger 0 .. Max_Aadlinteger applies to (virtual processor); 39 | 40 | end Processor_Properties; 41 | -------------------------------------------------------------------------------- /examples/mjpeg/DEMUX.h: -------------------------------------------------------------------------------- 1 | // *********************************************************************** 2 | // 3 | // Filename : DEMUX.h 4 | // 5 | // Author : SpaceStudio generation engine 6 | // 7 | // Creation date : Wed Jun 08 15:01:58 EDT 2011 8 | // 9 | // 10 | // *********************************************************************** 11 | 12 | #ifndef DEMUX_H 13 | #define DEMUX_H 14 | 15 | #include "jpeg.h" 16 | 17 | // Typedef 18 | typedef enum JPEGReaderState 19 | { 20 | LookingForMarker, 21 | MarkerFound 22 | } JPEGReaderState; 23 | 24 | 25 | 26 | 27 | 28 | 29 | // Thread 30 | void demux_funct(void); 31 | void before_demux(void); 32 | 33 | 34 | 35 | 36 | 37 | /// 38 | /// Methods 39 | /// 40 | unsigned short get_next_mk(); 41 | void skip_segment(); 42 | void find_info(void); 43 | unsigned char read_8_bits(); 44 | unsigned short read_16_bits(); 45 | void skip_bytes(unsigned short NbBytes); 46 | 47 | /// Variables 48 | /// 49 | 50 | unsigned int m_nbFrames; 51 | unsigned int m_uiOffset; 52 | SPACE_ALIGNED unsigned char m_Buffer[4]; 53 | bool m_BufferValid; 54 | 55 | unsigned int currentFrame; 56 | unsigned int dataMagic; 57 | unsigned short temp_mk; 58 | unsigned int header_size, height, width, nb_comp; 59 | unsigned int HiVi; 60 | 61 | unsigned char pot_mark; 62 | unsigned short mark; 63 | unsigned int found_mk, done, end_nb; 64 | 65 | unsigned short image_max_height; 66 | unsigned short image_max_width; 67 | unsigned int NBLOCKS, BLOCKS_H, BLOCKS_W, marker; 68 | unsigned int uiDummy; 69 | bool hasHuffTable; 70 | bool shouldSkip; 71 | 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /examples/air/ping/air_polling.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | #include 15 | 16 | void user_ports_polling () 17 | { 18 | __po_hi_port_t portno; 19 | __po_hi_node_t mynode; 20 | __po_hi_node_t tmpnode; 21 | __po_hi_request_t request; 22 | __po_hi_port_kind_t pkind; 23 | __po_hi_msg_t msg; 24 | 25 | RETURN_CODE_TYPE rc; 26 | SAMPLING_PORT_CURRENT_STATUS_TYPE STATUS; 27 | MESSAGE_SIZE_TYPE len; 28 | PARTITION_ID_TYPE self_id; 29 | 30 | __DEBUGMSG ("Polling ports for partition \n"); 31 | 32 | mynode = __po_hi_transport_get_mynode (); 33 | 34 | for (portno = 0 ; portno < __PO_HI_NB_PORTS ; portno++) { 35 | pkind = __po_hi_transport_get_port_kind (portno); 36 | tmpnode = __po_hi_transport_get_node_from_entity 37 | (__po_hi_get_entity_from_global_port (portno)); 38 | 39 | if (tmpnode == mynode) { 40 | __DEBUGMSG ("Testing port %d\n", 41 | __po_hi_transport_air_get_port (portno)); 42 | 43 | if (pkind == __PO_HI_IN_EVENT_DATA_INTER_PROCESS) { 44 | RECEIVE_QUEUING_MESSAGE 45 | (__po_hi_transport_air_get_port (portno), 46 | INFINITE_TIME_VALUE, 47 | &msg, 48 | &len, 49 | &rc); 50 | 51 | __po_hi_unmarshall_request (&request, &msg); 52 | 53 | if (rc == NO_ERROR) { 54 | __po_hi_main_deliver (&request); 55 | } 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /examples/producer_consumer_ba_4ports_manyDispatchTriggers/producer_consumer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int nb_call_of_compute_spg = 1; 8 | 9 | void compute_spg (test__ba__backend__alpha_type *a_data_out) { 10 | 11 | if (nb_call_of_compute_spg == 1) 12 | // Use current time as seed for random generator 13 | srand(time(0)); 14 | 15 | nb_call_of_compute_spg++; 16 | 17 | /* random int between 0 and 20 */ 18 | int r = rand() % 20 + 1; 19 | printf ("compute_spg : value = %d \n", r); 20 | *a_data_out = r; 21 | } 22 | 23 | void print_spg 24 | (test__ba__backend__alpha_type a_data_in) { 25 | 26 | printf("%d\n", a_data_in); 27 | fflush(stdout); 28 | } 29 | 30 | void print_spg1 31 | (test__ba__backend__alpha_type a_data_in) { 32 | 33 | printf("%d\n", a_data_in); 34 | fflush(stdout); 35 | } 36 | 37 | void print_thread_begin_execution (int thread_index) 38 | { 39 | char thread_name[20] = {0}; 40 | 41 | switch (thread_index) 42 | { 43 | case 0: 44 | { 45 | strcpy(thread_name, "computation"); 46 | break; 47 | } 48 | case 1: 49 | { 50 | strcpy(thread_name, "producer"); 51 | break; 52 | } 53 | case 2: 54 | { 55 | strcpy(thread_name, "consumer"); 56 | break; 57 | } 58 | case 3: 59 | { 60 | strcpy(thread_name, "receiver"); 61 | break; 62 | } 63 | 64 | default: // do nothing; 65 | break; 66 | } 67 | 68 | printf("*--------------------------------------------* \n"); 69 | printf(" Thread %s resumes its execution \n", thread_name); 70 | printf("*--------------------------------------------* \n"); 71 | fflush(stdout); 72 | } 73 | 74 | -------------------------------------------------------------------------------- /src/aadl/processors/processors-attiny.aadl: -------------------------------------------------------------------------------- 1 | -- This package defines some processors from the ATiny family of 2 | -- processor by AVR. For more details, see 3 | -- http://www.atmel.com/products/microcontrollers/avr/tinyAVR.aspx 4 | 5 | package Processors::ATtiny 6 | public 7 | 8 | with Data_Sheet, Memories, Processor_Properties; 9 | with Processors, ARINC653_Extended; 10 | 11 | ---------------- 12 | -- ATtiny45 -- 13 | ---------------- 14 | 15 | Processor ATtiny45 extends Processors::Generic_CPU 16 | features 17 | PB0 : in out event port; 18 | PB1 : in out event port; 19 | PB2 : in out event port; 20 | PB3 : in out event port; 21 | PB4 : in out event port; 22 | PB5 : in out event port; 23 | GND : in out event port; 24 | VCC : in out event port; 25 | properties 26 | Data_Sheet::UUID 27 | => "http://www.atmel.com/Images/doc2586.pdf"; 28 | end ATtiny45; 29 | 30 | Processor implementation ATtiny45.impl 31 | subcomponents 32 | Flash_Memory : memory Memories::Flash_Memory.impl 33 | {ARINC653_Extended::Memory_Kind => text;}; 34 | 35 | SRAM : memory Memories::SRAM.impl 36 | {ARINC653_Extended::Memory_Kind => data_seg;}; 37 | 38 | EEPROM : memory Memories::EEPROM.impl 39 | {ARINC653_Extended::Memory_Kind => data_seg;}; 40 | 41 | Properties 42 | Processor_Properties::Processor_Family => AVR; 43 | Processor_Properties::Word_Length => 8 bits; 44 | Processor_Properties::FPU_Present => False; 45 | Processor_Properties::MIPS => 24; 46 | Processor_Properties::Processor_Frequency => 16 Mhz; 47 | 48 | Memory_Size => 4_096 Bytes applies to Flash_Memory; 49 | Memory_Size => 256 Bytes applies to SRAM; 50 | Memory_Size => 256 Bytes applies to EEPROM; 51 | end ATtiny45.impl; 52 | 53 | end Processors::ATtiny; -------------------------------------------------------------------------------- /src/aadl/buses/buses-misc.aadl: -------------------------------------------------------------------------------- 1 | package Buses::Misc 2 | public 3 | with Electricity_Properties; 4 | 5 | ----------- 6 | -- TIMER -- 7 | ----------- 8 | 9 | bus TIMER_bus 10 | end TIMER_bus; 11 | 12 | bus implementation TIMER_bus.impl 13 | end TIMER_bus.impl; 14 | 15 | --------- 16 | -- PWM -- 17 | --------- 18 | 19 | bus PWM_bus 20 | end PWM_bus; 21 | 22 | bus implementation PWM_bus.impl 23 | end PWM_bus.impl; 24 | 25 | -- three_phases -- 26 | bus three_phases_bus 27 | end three_phases_bus; 28 | 29 | bus implementation three_phases_bus.impl 30 | end three_phases_bus.impl; 31 | 32 | ----------- 33 | -- Power -- 34 | ----------- 35 | 36 | -- These buses model power transmission element for electric power 37 | -- in embedded systems. 38 | 39 | bus power 40 | end power; 41 | 42 | bus implementation power.i 43 | end power.i; 44 | 45 | bus VBat_bus 46 | properties 47 | Electricity_Properties::Bus_Voltage_Range => 7.0 V .. 14.8 V; 48 | end VBat_bus; 49 | 50 | bus implementation VBat_bus.impl 51 | end VBat_bus.impl; 52 | 53 | bus V3v3_bus 54 | properties 55 | Electricity_Properties::Bus_Voltage_Range => 3.3 V .. 3.3 V; 56 | end V3v3_bus; 57 | 58 | bus implementation V3v3_bus.impl 59 | end V3v3_bus.impl; 60 | 61 | bus V5_bus 62 | properties 63 | Electricity_Properties::Bus_Voltage_Range => 5.0 V .. 5.0 V; 64 | end V5_bus; 65 | 66 | bus implementation V5_bus.impl 67 | end V5_bus.impl; 68 | 69 | bus V12_bus 70 | properties 71 | Electricity_Properties::Bus_Voltage_Range => 12.0 V .. 12.0 V; 72 | end V12_bus; 73 | 74 | bus implementation V12_bus.impl 75 | end V12_bus.impl; 76 | 77 | bus generic_bus 78 | end generic_bus; 79 | 80 | bus implementation generic_bus.impl 81 | end generic_bus.impl; 82 | 83 | end Buses::Misc; 84 | -------------------------------------------------------------------------------- /examples/mjpeg/COLOR_METRICS.cpp: -------------------------------------------------------------------------------- 1 | // *********************************************************************** 2 | // 3 | // Filename : COLOR_METRICS.cpp 4 | // 5 | // Author : SpaceStudio generation engine 6 | // 7 | // Creation date : Tue Sep 24 10:38:50 EDT 2013 8 | // 9 | // 10 | // *********************************************************************** 11 | 12 | #include "COLOR_METRICS.h" 13 | 14 | 15 | 16 | 17 | 18 | struct color_statistics { 19 | int minR, minG, minB, minA; 20 | int avgR, avgG, avgB, avgA; 21 | int maxR, maxG, maxB, maxA; 22 | }; 23 | 24 | #define BURST_SIZE 50 25 | 26 | void color() 27 | { 28 | int nb_blocks = 0; 29 | 30 | 31 | int minR = 255, minG = 255, minB = 255, minA = 255; 32 | int maxR = 0, maxG = 0, maxB = 0, maxA = 0; 33 | int sumR = 0, sumG = 0, sumB = 0, sumA = 0; 34 | 35 | color_statistics block_colors[BURST_SIZE]; 36 | 37 | Read(from_libu, block_colors, BURST_SIZE); 38 | 39 | for(int i=0; i block_colors[i].maxR) maxR = block_colors[i].maxR; 51 | if(maxG > block_colors[i].maxG) maxG = block_colors[i].maxG; 52 | if(maxB > block_colors[i].maxB) maxB = block_colors[i].maxB; 53 | if(maxA > block_colors[i].maxA) maxA = block_colors[i].maxA; 54 | 55 | 56 | nb_blocks += BURST_SIZE; 57 | 58 | //if(nb_blocks >= 100) { 59 | // sc_stop(); 60 | //} 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /examples/voter/voter.aadl: -------------------------------------------------------------------------------- 1 | -- This AADL model illustrates how to define a generic voter system 2 | 3 | package Voter 4 | public 5 | 6 | abstract Voting_Entity 7 | --features 8 | --Value : out data port; 9 | end Voting_Entity; 10 | 11 | abstract Voter 12 | prototypes 13 | Voter : abstract Voting_Entity; 14 | component : abstract; 15 | features 16 | Value : out data port; 17 | end Voter; 18 | 19 | abstract implementation Voter.Three 20 | subcomponents 21 | Voter_1 : abstract Voter; 22 | Voter_2 : abstract Voter; 23 | Voter_3 : abstract Voter; 24 | 25 | -- annex behavior_specification {** 26 | -- Should define here semantics for this policy 27 | -- e.g. on error from #1, activate #2 28 | --**}; 29 | end Voter.Three; 30 | 31 | ----------------------------------------------------------------------------- 32 | -- Example of use 33 | 34 | -- #1 Staying at an abstract level 35 | 36 | abstract Abstract_Function extends Voting_Entity 37 | end Abstract_Function; 38 | 39 | abstract Voter_Function extends Voter 40 | end Voter_Function; 41 | 42 | abstract implementation Voter_Function.i 43 | extends Voter.Three (Component => abstract Abstract_Function) 44 | end Voter_Function.i; 45 | 46 | -- # 2 we use the voting system with three instances of the same 47 | -- subprogram. 48 | 49 | -- XXX we should probably do N version programming, hence giving 50 | -- three different subprograms as parameters 51 | 52 | subprogram Concrete_Function extends Voting_Entity 53 | end Concrete_Function; 54 | 55 | thread Voter_Thread extends Voter 56 | end Voter_Thread; 57 | 58 | thread implementation Voter_Thread.i extends Voter.Three 59 | end Voter_Thread.i; 60 | 61 | thread implementation Voter_Thread.i2 62 | extends Voter.Three (Component => subprogram Concrete_Function) 63 | end Voter_Thread.i2; 64 | 65 | end Voter; 66 | -------------------------------------------------------------------------------- /src/aadl/boards/boards-gr_xc3s_1500.aadl: -------------------------------------------------------------------------------- 1 | -- This package models the GR-Rasta GR-XC3S-1500 LEON development 2 | -- board by AEROFlex Gaisler. 3 | 4 | package Boards::GR_XC3S_1500 5 | public 6 | with Processors::SPARC, Memories; 7 | with Buses::Ethernet, Buses::UART; 8 | with Deployment; 9 | with RTEMS5_UART; 10 | 11 | ------------------ 12 | -- GR_XC3S_1500 -- 13 | ------------------ 14 | 15 | -- The GR-XC3S-1500 by Gaisler is a low-cost LEON board, with two 16 | -- UARTs, one ethernet. 17 | 18 | system GR_XC3S_1500 19 | features 20 | UART_Bus_0 : requires bus access Buses::UART::UART.impl; 21 | UART_Bus_1 : requires bus access Buses::UART::UART.impl; 22 | 23 | Eth_Bus_0 : requires bus access Buses::Ethernet::Ethernet.impl; 24 | 25 | end GR_XC3S_1500; 26 | 27 | system implementation GR_XC3S_1500.impl 28 | subcomponents 29 | LEON_Core : processor Processors::SPARC::LEON2; 30 | SRAM : memory Memories::SRAM {Memory_size => 64 MByte;}; 31 | Eth_0 : device Buses::Ethernet::Generic_Ethernet; 32 | UART_1 : device Buses::UART::Generic_UART.impl; 33 | UART_2 : device Buses::UART::Generic_UART.impl; 34 | 35 | connections 36 | C1 : bus access UART_Bus_0 -> UART_1.UART; 37 | C2 : bus access UART_Bus_1 -> UART_2.UART; 38 | C3 : bus access Eth_Bus_0 -> Eth_0.Eth; 39 | 40 | end GR_XC3S_1500.impl; 41 | 42 | system implementation GR_XC3S_1500.rtems extends GR_XC3S_1500.impl 43 | subcomponents 44 | LEON_Core : refined to processor 45 | { Deployment::Execution_Platform => LEON_RTEMS;}; 46 | 47 | UART_1 : refined to device RTEMS5_UART::RTEMS5_APBUART.impl { Classifier_Substitution_Rule => Signature_Match;}; 48 | UART_2 : refined to device RTEMS5_UART::RTEMS5_APBUART.impl { Classifier_Substitution_Rule => Signature_Match;}; 49 | end GR_XC3S_1500.rtems; 50 | 51 | end Boards::GR_XC3S_1500; 52 | -------------------------------------------------------------------------------- /examples/behavior_annex/ba_example5.aadl: -------------------------------------------------------------------------------- 1 | -- This example gives a basic implementation of a stack data type 2 | -- associated with its access methods. The various corresponding AADL 3 | -- component specifications are encompassed within a same package to 4 | -- offer an Object-Oriented Class style. 5 | 6 | package BA_example5 7 | public 8 | with Base_Types; 9 | 10 | data stack 11 | features 12 | put : provides subprogram access push; 13 | get : provides subprogram access pop; 14 | end stack; 15 | 16 | data implementation stack.default 17 | subcomponents 18 | elems : data Base_Types::Integer [100]; 19 | sp : data Base_Types::Integer; 20 | end stack.default; 21 | 22 | subprogram push 23 | features 24 | v : in parameter Base_Types::Integer; 25 | this : requires data access stack.default; 26 | overflow : out event port; 27 | end push; 28 | 29 | subprogram pop 30 | features 31 | v : out parameter Base_Types::Integer; 32 | this : requires data access stack.default; 33 | underflow : out event port; 34 | end pop; 35 | 36 | subprogram implementation push.default 37 | -- annex behavior_specification {** 38 | -- states 39 | -- s0 : initial final state; 40 | -- transitions 41 | -- s0 -[ sp <= 100 ]-> s0 { this.elems[this.sp] :=v; this.sp := this.sp+1 }; 42 | -- s0 -[ this.sp <= 100 ]-> s0 { this.elems :=v; this.sp := 1 }; 43 | -- s0 -[ this.sp > 100 ]-> s0 { overflow! }; 44 | -- **}; 45 | end push.default; 46 | 47 | subprogram implementation pop.default 48 | -- annex behavior_specification {** 49 | -- states 50 | -- s0 : initial final state; 51 | -- transitions 52 | -- s0 -[ sp > 0 ]-> s0 { this.sp := this.sp - 1; v := this.elems[this.sp] }; 53 | -- s0 -[ this.sp > 0 ]-> s0 { this.sp := 1; v := this }; 54 | -- s0 -[ this.sp = 0 ]-> s0 { underflow! }; 55 | -- **}; 56 | end pop.default; 57 | 58 | end BA_example5; 59 | -------------------------------------------------------------------------------- /src/property_set/physical_properties.aadl: -------------------------------------------------------------------------------- 1 | property set Physical_Properties is 2 | 3 | ----------------- 4 | -- Power units -- 5 | ----------------- 6 | 7 | Power_Units: type units 8 | (W, 9 | KW => W * 1000, 10 | MW => KW * 1000, 11 | GW => MW * 1000, 12 | TW => GW * 1000); 13 | 14 | Max_Power: constant aadlinteger units Physical_Properties::Power_Units => 2#1#e32 W; 15 | Power : type aadlreal 0.0 W .. Physical_Properties::Max_Power units Physical_Properties::Power_Units; 16 | Power_Consume : Physical_Properties::Power 17 | applies to (processor, device, memory, system); 18 | Power_Provide : Physical_Properties::Power applies to (device); 19 | Total_Power : Physical_Properties::Power applies to (system); 20 | 21 | --------- 22 | -- EMC -- 23 | --------- 24 | 25 | Ionizing_Dose_Units : type units ( 26 | rad, 27 | Krad => rad * 1000, 28 | Mrad => Krad * 1000, 29 | Grad => Mrad * 1000, 30 | Trad => Grad * 1000); 31 | 32 | Max_Ionizing_Dose: constant aadlinteger units Physical_Properties::Ionizing_Dose_Units => 2#1#e32 rad; 33 | 34 | Ionizing_Type : type aadlinteger 35 | 0 rad .. Physical_Properties::Max_Ionizing_Dose units Physical_Properties::Ionizing_Dose_Units; 36 | 37 | TID : Physical_Properties::Ionizing_Type 38 | applies to (processor, device, memory); 39 | 40 | ---------------- 41 | -- Mass units -- 42 | ---------------- 43 | 44 | Mass_Units: type units (g, Kg => g * 1000, T => Kg * 1000); 45 | Maximum_Mass: constant aadlinteger units Physical_Properties::Mass_Units => 2#1#e32 g; 46 | Mass_Type : type aadlreal 0.0 g .. Physical_Properties::Maximum_Mass units Physical_Properties::Mass_Units; 47 | Mass : Physical_Properties::Mass_Type applies to (processor, device, memory, system); 48 | Max_Mass : Physical_Properties::Mass_Type 49 | applies to (processor, device, memory, system); 50 | 51 | end Physical_Properties; 52 | -------------------------------------------------------------------------------- /src/aadl/os.aadl: -------------------------------------------------------------------------------- 1 | -- This package is the root of the library of Operating Systems. 2 | 3 | package OS 4 | public 5 | 6 | with OS_Properties; 7 | 8 | -------------------- 9 | -- Root_Scheduler -- 10 | -------------------- 11 | 12 | virtual processor Root_Scheduler 13 | annex real_specification {** 14 | theorem check_model 15 | foreach s in local_set do 16 | requires (check_bare_board_system); 17 | check (1 = 1); 18 | end check_model; 19 | **}; 20 | end Root_Scheduler; 21 | 22 | -------------------------- 23 | -- Bare_Board_Scheduler -- 24 | -------------------------- 25 | 26 | virtual processor Bare_Board_Scheduler extends Root_Scheduler 27 | properties 28 | Scheduling_Protocol => (SporadicServer); 29 | Thread_Limit => 1; 30 | OS_Properties::Hierarchical_Scheduler => false; 31 | end Bare_Board_Scheduler; 32 | 33 | --------------------- 34 | -- POSIX_Scheduler -- 35 | --------------------- 36 | 37 | virtual processor POSIX_Scheduler extends Root_Scheduler 38 | properties 39 | Scheduling_Protocol => (RMS); 40 | OS_Properties::Hierarchical_Scheduler => false; 41 | -- Priority_Range => 0 .. 255; 42 | end POSIX_Scheduler; 43 | 44 | ------------------------- 45 | -- Ravenscar_Scheduler -- 46 | ------------------------- 47 | 48 | virtual processor Ravenscar_Scheduler extends Root_Scheduler 49 | -- This OS supports Ravenscar-like scheduler 50 | properties 51 | Scheduling_Protocol => (RMS); 52 | OS_Properties::Hierarchical_Scheduler => false; 53 | end Ravenscar_Scheduler; 54 | 55 | ------------------------ 56 | -- ARINC653_Scheduler -- 57 | ------------------------ 58 | 59 | virtual processor ARINC653_Scheduler extends Root_Scheduler 60 | -- This OS supports ARINC-like scheduler, i.e. hierarchical scheduling 61 | properties 62 | Scheduling_Protocol => (FixedTimeline); 63 | OS_Properties::Hierarchical_Scheduler => true; 64 | end ARINC653_Scheduler; 65 | 66 | end OS; 67 | -------------------------------------------------------------------------------- /examples/behavior_annex/ba_example3.aadl: -------------------------------------------------------------------------------- 1 | -- Copyright © 2008 SAE International 2 | 3 | -- Next example shows various dispatch conditions and transition actions. The 4 | -- timeout value is given by the Period property of the thread. States st and 5 | -- sf are complete states and thus outgoing transitions are triggered by 6 | -- dispatch conditions, whereas s1 and s2 are execute states and outgoing 7 | -- transitions are guarded by logical expressions. 8 | package BA_example3 public 9 | with Base_Types; 10 | 11 | thread sender 12 | features 13 | d: out event data port Base_Types::Integer; 14 | a: in event data port Base_Types::Integer; 15 | properties 16 | Dispatch_Protocol => Timed; 17 | Period => 10 ms; 18 | end sender; 19 | 20 | thread implementation sender.v1 21 | subcomponents 22 | v: data Base_Types::Integer; 23 | annex behavior_specification {** 24 | states 25 | st: initial complete state; 26 | sf: complete final state; 27 | s1, s2: state; 28 | transitions 29 | st -[on dispatch timeout]-> st { v := 1; d!(v) }; 30 | st -[on dispatch a ]-> s1; 31 | s1 -[a=1]-> sf; 32 | s1 -[a=0]-> st; 33 | sf -[on dispatch timeout]-> sf { v := 0; d!(v) }; 34 | sf -[on dispatch a ]-> s2; 35 | s2 -[a=0]-> st; 36 | s2 -[a=1]-> sf; 37 | **}; 38 | end sender.v1; 39 | 40 | -- In a second version, it is possible to eliminate the need to maintain 41 | -- state in the data component v. The state information is already reflected 42 | -- in the state automaton. 43 | thread implementation sender.v2 44 | annex behavior_specification {** 45 | states 46 | st: initial complete state; 47 | sf: complete final state; 48 | s1, s2: state; 49 | transitions 50 | st -[on dispatch timeout]-> st { d!(1) }; 51 | st -[on dispatch a ]-> s1; 52 | s1 -[a=1]-> sf; 53 | s1 -[a=0]-> st; 54 | sf -[on dispatch timeout]-> sf { d!(0) }; 55 | sf -[on dispatch a ]-> s2; 56 | s2 -[a=0]-> st; 57 | s2 -[a=1]-> sf; 58 | **}; 59 | end sender.v2; 60 | end BA_example3; -------------------------------------------------------------------------------- /examples/ping_spark/ping-local.aadl: -------------------------------------------------------------------------------- 1 | -- This model completes the PING example by adding deployment 2 | -- information. 3 | -- 4 | -- In this deployment, only one node is defined. 5 | -- 6 | -- $Id: ping-local.aadl 7043 2009-10-08 14:20:49Z hugues $ 7 | 8 | 9 | package PING_Local 10 | public 11 | with Software; 12 | with Deployment; 13 | 14 | --------------- 15 | -- Processor -- 16 | --------------- 17 | 18 | processor the_processor 19 | end the_processor; 20 | 21 | processor implementation the_processor.Impl 22 | properties 23 | Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); 24 | 25 | end the_processor.Impl; 26 | 27 | --------------- 28 | -- Processes -- 29 | --------------- 30 | 31 | process A 32 | end A; 33 | 34 | process implementation A.Impl 35 | subcomponents 36 | Pinger : thread Software::P.Impl; 37 | Ping_Me : thread Software::Q.Impl; 38 | connections 39 | port Pinger.Data_Source -> Ping_Me.Data_Sink; 40 | end A.Impl; 41 | 42 | ------------ 43 | -- System -- 44 | ------------ 45 | 46 | system PING 47 | end PING; 48 | 49 | system implementation PING.LEON 50 | subcomponents 51 | Node_A : process A.Impl; 52 | 53 | CPU : processor the_processor.Impl 54 | {Priority_Range => 0 .. 255; 55 | Deployment::Execution_Platform => LEON_ORK;}; 56 | properties 57 | actual_processor_binding => (reference (CPU)) applies to Node_A; 58 | end PING.LEON; 59 | 60 | system implementation PING.LEON_GNAT extends PING.LEON 61 | properties 62 | Deployment::Execution_Platform => LEON_GNAT applies to CPU; 63 | end PING.LEON_GNAT; 64 | 65 | system implementation PING.MARTE extends PING.LEON 66 | properties 67 | Deployment::Execution_Platform => MARTE_OS applies to CPU; 68 | end PING.MARTE; 69 | 70 | system implementation PING.Local extends PING.LEON 71 | properties 72 | Deployment::Execution_Platform => Native applies to CPU; 73 | end PING.Local; 74 | 75 | end PING_Local; 76 | --------------------------------------------------------------------------------