package central_control_unit public with deployment; with software_components; with hardware_components; with rover_data; ------------------------- -- Hardware components -- ------------------------- device camera_device features video_input: in data port rover_data::camera_data; video_output: out data port rover_data::camera_data; end camera_device; device gps_device features location_input: in data port rover_data::gps_data; location_output: out data port rover_data::gps_data; end gps_device; ----------------- -- Subprograms -- ----------------- subprogram camera_spg properties source_language => (C); source_name => "camera_spg"; source_text => ("c-code/camera.c"); end camera_spg; subprogram gps_spg properties source_language => (C); source_name => "gps_spg"; source_text => ("c-code/gps.c"); end gps_spg; ------------- -- Threads -- ------------- thread camera_thread extends software_components::periodic_thread end camera_thread; thread gps_thread extends software_components::periodic_thread end gps_thread; thread implementation camera_thread.impl calls c : { s : subprogram camera_spg; }; properties Period => 1000 ms; Priority => 100; Compute_Execution_Time => 1 ms .. 1 ms; end camera_thread.impl; thread implementation gps_thread.impl calls c : { s : subprogram gps_spg; }; properties Period => 1000 ms; Priority => 200; Compute_Execution_Time => 1 ms .. 1 ms; end gps_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 payload_software end payload_software; process implementation payload_software.impl subcomponents gps : thread gps_thread.impl; end payload_software.impl; process image_processing_software end image_processing_software; process implementation image_processing_software.impl subcomponents -- How many cameras do we have? -- Do we need to model cameras as AADL devices ? camera : thread camera_thread.impl; end image_processing_software.impl; ------------ -- System -- ------------ system central features eth_connected : requires bus access hardware_components::ethernet_switch; end central; system implementation central.impl subcomponents software1 : process payload_software.impl; software2 : process image_processing_software.impl; ark1 : processor cpu.impl; ark2 : processor cpu.impl; connections C1 : bus access eth_connected -> ark1.eth_connected; C2 : bus access eth_connected -> ark2.eth_connected; properties Actual_Processor_Binding => (reference (ark1)) applies to software1; Actual_Processor_Binding => (reference (ark2)) applies to software2; end central.impl; end central_control_unit;