----------- -- Data -- ---------- data Integer_Type properties Data_Model::Data_Representation => integer; end Integer_Type; data String_Type properties Data_Model::Data_Representation => string; Data_Model::Dimension => (100); end String_Type; ----------------- -- Subprograms -- ----------------- subprogram Check_Validity_Spg features NumCard : in parameter Integer_Type; Valid : out parameter String_Type; NotValid : out parameter String_Type; end Check_Validity_Spg; subprogram Check_Code_Spg features NumCard : in parameter Integer_Type; Code : in parameter Integer_Type; OK : out parameter String_Type; RestoreCode : out parameter String_Type; RejectedCard : out parameter String_Type; end Check_Code_Spg; subprogram Check_Spg features NumCard : in parameter Integer_Type; Valid : out parameter String_Type; NotValid : out parameter String_Type; Code : in parameter Integer_Type; OK : out parameter String_Type; RestoreCode : out parameter String_Type; RejectedCard : out parameter String_Type; end Check_Spg; subprogram implementation Check_Validity_Spg.Impl properties source_language => Ada95; source_name => "Bank.Check_Validity_Spg"; end Check_Validity_Spg.Impl; subprogram implementation Check_Code_Spg.Impl properties source_language => Ada95; source_name => "Bank.Check_Code_Spg"; end Check_Code_Spg.Impl; subprogram implementation Check_Spg.Impl calls{ CV_Spg : subprogram Check_Validity_Spg.Impl; CC_Spg : subprogram Check_Code_Spg.Impl; }; connections parameter NumCard -> CV_Spg.NumCard; parameter NumCard -> CC_Spg.NumCard; parameter CV_Spg.Valid -> Valid; parameter CV_Spg.NotValid -> NotValid; parameter Code -> CC_Spg.Code; parameter CC_Spg.OK -> OK; parameter CC_Spg.RestoreCode -> RestoreCode; parameter CC_Spg.RejectedCard -> RejectedCard; end Check_Spg.Impl; subprogram Operation_Spg features SessionID : in parameter Integer_Type; Cmd : in parameter Integer_Type; Amount : in parameter Integer_Type; Result : out parameter String_Type; end Operation_Spg; subprogram implementation Operation_Spg.Impl properties source_language => RTSJ; source_name => "Bank.Op_Spg"; end Operation_Spg.Impl; subprogram FindSession_Spg features SessionID : out parameter Integer_Type; Numcard : in parameter Integer_Type; end FindSession_Spg; subprogram implementation FindSession_Spg.Impl properties source_language => RTSJ; source_name => "Bank.FindSession_Spg"; end FindSession_Spg.Impl; ----------------- -- Threads -- ----------------- thread PingerTh features NumCard_out_P : out event data port Integer_Type; end PingerTh; thread implementation PingerTh.Impl properties Initialize_Entrypoint => "Msgs.Welcome_Pinger_TH"; Dispatch_Protocol => Periodic; Period => 5 Ms; Cheddar_Properties::Fixed_Priority => 1; end PingerTh.Impl; thread ValidationTh features NumCard_in_V : in event data port Integer_Type; Code_in_V : in event data port Integer_Type; NumCard_out_V : out event data port Integer_Type; OK_out_V : out event data port String_Type; RestoreCode_out_V : out event data port String_Type; RejectedCard_out_V : out event data port String_Type; Valid_out_V : out event data port String_Type; NotValid_out_V : out event data port String_Type; end ValidationTh; thread implementation ValidationTh.Impl calls { C_Spg : subprogram Check_Spg.Impl; }; connections parameter NumCard_in_V -> C_Spg.NumCard; parameter C_Spg.Valid -> Valid_out_V; parameter C_Spg.NotValid -> NotValid_out_V; parameter Code_in_V -> C_Spg.Code; parameter C_Spg.OK -> OK_out_V; parameter C_Spg.RestoreCode -> RestoreCode_out_V; parameter C_Spg.RejectedCard -> RejectedCard_out_V; properties Initialize_Entrypoint => "Msgs.Welcome_Validation_TH"; Dispatch_Protocol => Sporadic; Period => 1000 Ms; Compute_Execution_time => 0 ms .. 3 ms; Deadline => 1000 ms; Cheddar_Properties::Fixed_Priority => 2; end ValidationTh.Impl; thread GUITh features OK_in_G : out event data port String_Type; RestoreCode_in_G : out event data port String_Type; RejectedCard_in_G : out event data port String_Type; Valid_in_G : out event data port String_Type; NotValid_in_G : out event data port String_Type; Result_in_G : in event data port String_Type; SessionID_in_G : in event data port Integer_Type; SessionID_out_G : out event data port Integer_Type; Code_out_G : out event data port Integer_Type; Cmd_out_G : out event data port Integer_Type; Amount_out_G : out event data port Integer_Type; end GUITh; thread implementation GUITh.Impl properties Initialize_Entrypoint => "Msgs.Welcome_GUI_TH"; Dispatch_Protocol => Sporadic; Period => 1000 Ms; Compute_Execution_time => 0 ms .. 3 ms; Deadline => 1000 ms; Cheddar_Properties::Fixed_Priority => 3; end GUITh.Impl; thread AccountTh features Result_out_AT : out event data port String_Type; SessionID_in_AT : in event data port Integer_Type; Cmd_in_AT : in event data port Integer_Type; Amount_in_AT : in event data port Integer_Type; end AccountTh; thread implementation AccountTh.Impl calls { Op_Spg : subprogram Operation_Spg.Impl; }; connections parameter Op_Spg.Result_out-> Result_out_AT; parameter SessionID_in_AT-> Op_Spg.SessionID_in; parameter Cmd_in_AT-> Op_Spg.Cmd_in; parameter Amount_in_AT-> Op_Spg.Amount_in; properties Initialize_Entrypoint => "Msgs.Welcome_Account_TH"; Dispatch_Protocol => Sporadic; Period => 1000 Ms; Compute_Execution_time => 0 ms .. 3 ms; Deadline => 1000 ms; Cheddar_Properties::Fixed_Priority => 1; end AccountTh.Impl; thread AccountDataTh features Result_out_AT : out event data port String_Type; SessionID_in_AT : in event data port Integer_Type; Cmd_in_AT : in event data port Integer_Type; Amount_in_AT : in event data port Integer_Type; end AccountDataTh; thread implementation AccountDataTh.Impl calls { FS_Spg : subprogram FindSession_Spg.Impl; }; connections parameter Numcard_in_ADT -> FS_Spg.Numcard_in; parameter FS_Spg.SessionID_out -> SessionID_out_ADT; properties Initialize_Entrypoint => "Msgs.Welcome_AccountData_TH"; Dispatch_Protocol => Sporadic; Period => 1000 Ms; Compute_Execution_time => 0 ms .. 3 ms; Deadline => 1000 ms; Cheddar_Properties::Fixed_Priority => 1; end AccountDataTh.Impl; ----------------- -- processes -- ----------------- process Customer features SessionID_in_C : in event data port Integer_Type; Result_in_C : in event data port String_Type; NumCard_out_C : out event data port Integer_Type; Amount_out_C : out event data port Integer_Type; Cmd_out_C : out event data port Integer_Type; SessionID_out_C : out event data port Integer_Type; end Customer; process implementation Customer.Impl subcomponents P : thread PingerTh.Impl; Val : thread ValidationTh.Impl; G : thread GUITh.Impl; connections event data port SessionID_in_C -> G.SessionID_in_G; event data port Result_in_C -> G.Result_in_G; event data port Val.NumCard_out_V -> NumCard_out_C; event data port G.Amount_out_G -> Amount_out_C; event data port G.Cmd_out_G -> Cmd_out_C; event data port G.SessionID_out_G -> SessionID_out_C; end Customer.Impl; process AccountData features SessionID_out_AD : out event data port Integer_Type; Numcard_in_AD : in event data port Integer_Type; end AccountData; process implementation AccountData.Impl subcomponents ad : thread AccountDataTh.Impl; connections event data port Numcard_in_AD -> ad.Numcard_in_ADT; event data port ad.SessionID_out_ADT -> SessionID_out_AD; end AccountData.Impl; process Account features Result_out_A : out event data port String_Type; SessionID_in_A : in event data port Integer_Type; Cmd_in_A : in event data port Integer_Type; Amount_in_A : in event data port Integer_Type; end Account; process implementation Account.Impl subcomponents ac : thread AccountTh.Impl; connections event data port ac.Result_out_AT -> Result_out_A; event data port SessionID_in_A -> ac.SessionID_in_AT; event data port Cmd_in_A -> ac.Cmd_in_AT; event data port Amount_in_A -> ac.Amount_in_AT; end Account.Impl; --------------- -- Processor -- --------------- processor the_processor end the_processor; processor implementation the_processor.Impl properties Scheduling_Protocol => (Posix_1003_Highest_Priority_First_Protocol); Cheddar_Properties::Scheduler_Quantum => 0 Ms; Cheddar_Properties::Preemptive_Scheduler => true; end the_processor.Impl; system Bank end Bank; system implementation Bank.others subcomponents customer : process Customer.Impl {Deployment::Channel_Address => 2; Deployment::Process_Id => 1200;}; account : process Account.Impl {Deployment::Channel_Address => 3; Deployment::Process_Id => 1300;}; accountdata : process AccountData.Impl{Deployment::Channel_Address => 4; Deployment::Process_Id => 1400;}; CPU : processor the_processor.Impl {Deployment::Execution_Platform => LEON_ORK;}; connections event data port customer.NumCard_C -> accountdata.NumCard_In_AD; event data port accountdata.SessionID_out_AD -> customer.SessionID_in_C; event data port customer.SessionID_out_C -> account.SessionID_in_A; event data port customer.Cmd_out_C -> account.Cmd_in_A; event data port customer.Amount_out_C -> account.Amount_in_A; event data port account.Result_out_A -> customer.Result_in_C; properties actual_processor_binding => reference CPU applies to customer; END Bank.others;