Commit e33cfc8d authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix parsing the queue size

For some reason a single method can not be used to parse the properties
of an interface if it is declared at different places

Ellidiss'interface view define the queue size like this:
SUBPROGRAM PI_doSomething
PROPERTIES
  Taste::Associated_Queue_Size => 5;
END PI_doSomething;

while Space Creator defines it like this:
FEATURES
   PI_doSomething : PROVIDES SUBPROGRAM ACCESS interfaceview::IV:: Blah:: PI_doSomething.others {
      Taste::Associated_Queue_Size => 5;
   }

It seems the same but no..The first one does not appear in the list of
properties of the interface and requires a weird method to parse it.
parent b4a9d929
......@@ -469,17 +469,25 @@ package body TASTE.Interface_View is
-- Keep compatibility with 1.2 models for the interface name
Result.Name := (if Name = No_Name then US (AIN_Case (If_I)) else
US (Get_Name_String (Name)));
Result.Queue_Size := (if Kind (If_I) = K_Subcomponent_Access_Instance
and then Is_Defined_Property
(CI, "taste::associated_queue_size")
then Just (Get_Integer_Property
(CI, "taste::associated_queue_size"))
else Option_ULL.Nothing);
Result.Queue_Size := -- Ellidiss property
(if Kind (If_I) = K_Subcomponent_Access_Instance
and then Is_Defined_Property (CI, "taste::associated_queue_size")
then
Just (Get_Integer_Property (CI, "taste::associated_queue_size"))
else Option_ULL.Nothing);
Result.RCM := Get_RCM_Operation_Kind (If_I);
Result.Period_Or_MIAT := Get_RCM_Period (If_I);
Result.WCET_ms := Get_Upper_WCET (If_I);
Result.User_Properties := Get_Properties_Map (If_I);
-- Get the queue size from the properties (space creator property)
for P of Result.User_Properties loop
if P.Name = "Taste::Associated_Queue_Size" then
Result.Queue_Size :=
Just (Unsigned_Long_Long'Value (To_String (P.Value)));
exit;
end if;
end loop;
-- Parameters:
if not Is_Empty (AIN.Features (Sub_I)) then
Param_I := AIN.First_Node (AIN.Features (Sub_I));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment