package autopilot public with deployment; with software_components; with hardware_components; with rover_data; ------------------------- -- Hardware components -- ------------------------- device temperature_device features temperature_input: in data port rover_data::temperature_data; temperature_output: out data port rover_data::temperature_data; end temperature_device; device magnetometer_device features magnetometer_input: in data port rover_data::magnetometer_data; magnetometer_output: out data port rover_data::magnetometer_data; end magnetometer_device; device tube_sensor_device features tube_input: in data port rover_data::tube_sensor_data; tube_output: out data port rover_data::tube_sensor_data; end tube_sensor_device; device pressure_device features pressure_input: in data port rover_data::pressure_data; pressure_output: out data port rover_data::pressure_data; end pressure_device; device lights_device features lights_input: in data port rover_data::lights_data; lights_output: out data port rover_data::lights_data; end lights_device; device power_sensing_module_device features power_input: in data port rover_data::power_sensing_module_data; power_output: out data port rover_data::power_sensing_module_data; end power_sensing_module_device; device esc_device features esc_input: in data port rover_data::esc_data; esc_output: out data port rover_data::esc_data; end esc_device; device thrusters_device features thrusters_input: in data port rover_data::thrusters_data; thrusters_output: out data port rover_data::thrusters_data; end thrusters_device; ----------------- -- Subprograms -- ----------------- subprogram temperature_spg properties source_language => (C); source_name => "temperature_spg"; source_text => ("c-code/temperature.c"); end temperature_spg; subprogram magnetometer_spg properties source_language => (C); source_name => "magnetometer_spg"; source_text => ("c-code/magnetometer.c"); end magnetometer_spg; subprogram tube_sensor_spg properties source_language => (C); source_name => "tube_sensor_spg"; source_text => ("c-code/tube_sensor.c"); end tube_sensor_spg; subprogram pressure_spg properties source_language => (C); source_name => "pressure_spg"; source_text => ("c-code/pressure.c"); end pressure_spg; subprogram lights_spg properties source_language => (C); source_name => "lights_spg"; source_text => ("c-code/lights.c"); end lights_spg; subprogram power_sensing_module_spg properties source_language => (C); source_name => "power_sensing_module_spg"; source_text => ("c-code/power_sensing_module.c"); end power_sensing_module_spg; subprogram esc_spg properties source_language => (C); source_name => "esc_spg"; source_text => ("c-code/propulsion.c"); end esc_spg; subprogram thrusters_spg properties source_language => (C); source_name => "thrusters_spg"; source_text => ("c-code/propulsion.c"); end thrusters_spg; ------------- -- Threads -- ------------- thread temperature_thread extends software_components::periodic_thread end temperature_thread; thread magnetometer_thread extends software_components::periodic_thread end magnetometer_thread; thread tube_sensor_thread extends software_components::periodic_thread end tube_sensor_thread; thread pressure_thread extends software_components::periodic_thread end pressure_thread; thread lights_thread extends software_components::periodic_thread -- should be "aperiodic_thread" (!?), but Ocarina returns an error end lights_thread; thread power_sensing_module_thread extends software_components::periodic_thread -- should be "aperiodic_thread" (!?), but Ocarina returns an error end power_sensing_module_thread; thread esc_thread extends software_components::periodic_thread end esc_thread; thread thrusters_thread extends software_components::periodic_thread end thrusters_thread; thread implementation temperature_thread.impl calls c : { s : subprogram temperature_spg; }; properties Period => 1000 ms; Priority => 100; Compute_Execution_Time => 1 ms .. 1 ms; end temperature_thread.impl; thread implementation magnetometer_thread.impl calls c : { s : subprogram magnetometer_spg; }; properties Compute_Execution_Time => 1 ms .. 1 ms; Period => 1000 ms; Priority => 50; end magnetometer_thread.impl; thread implementation tube_sensor_thread.impl calls c : { s : subprogram tube_sensor_spg; }; properties Period => 1000 ms; Compute_Execution_Time => 1 ms .. 1 ms; Priority => 50; end tube_sensor_thread.impl; thread implementation pressure_thread.impl calls c : { s : subprogram pressure_spg; }; properties Period => 1000 ms; Compute_Execution_Time => 1 ms .. 1 ms; Priority => 40; end pressure_thread.impl; thread implementation lights_thread.impl calls c : { s : subprogram lights_spg; }; properties -- Should be removed!? Period => 1000 ms; -- Here because it is Priority => 10; -- periodic temporarily! Compute_Execution_Time => 1 ms .. 1 ms; end lights_thread.impl; thread implementation power_sensing_module_thread.impl calls c : { s : subprogram power_sensing_module_spg; }; properties -- Should be removed!? Period => 1000 ms; -- Here because it is Priority => 85; -- periodic temporarily! Compute_Execution_Time => 1 ms .. 1 ms; end power_sensing_module_thread.impl; thread implementation esc_thread.impl calls c : { s : subprogram esc_spg; }; properties Period => 1000 ms; Compute_Execution_Time => 1 ms .. 1 ms; Priority => 150; end esc_thread.impl; thread implementation thrusters_thread.impl calls c : { s : subprogram thrusters_spg; }; properties Period => 1000 ms; Compute_Execution_Time => 1 ms .. 1 ms; Priority => 155; end thrusters_thread.impl; --------------- -- Processor -- --------------- processor cpu extends hardware_components::rov_processor --properties -- Deployment::Execution_Platform => native; end cpu; processor implementation cpu.impl properties Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); end cpu.impl; --------------- -- Processes -- --------------- process autopilot_software end autopilot_software; process implementation autopilot_software.impl subcomponents temperature : thread temperature_thread.impl; magnetometer : thread magnetometer_thread.impl; tube_sensor : thread tube_sensor_thread.impl; pressure : thread pressure_thread.impl; lights : thread lights_thread.impl; power_sensing_module : thread power_sensing_module_thread.impl; esc : thread esc_thread.impl; thrusters : thread thrusters_thread.impl; end autopilot_software.impl; ------------ -- System -- ------------ system autopilot features eth_connected : requires bus access hardware_components::ethernet_switch; end autopilot; system implementation autopilot.impl subcomponents software : process autopilot_software.impl; autopilot_cpu : processor cpu.impl; connections C1 : bus access eth_connected -> autopilot_cpu.eth_connected; properties Actual_Processor_Binding => (reference (autopilot_cpu)) applies to software; end autopilot.impl; end autopilot;