ocarina icon indicating copy to clipboard operation
ocarina copied to clipboard

whether can ignore 'source_text' in subprogram?

Open ibertli opened this issue 2 years ago • 4 comments

Hello Sir, i have a question asking for your help. Based on my understanding,we cannot ignore 'source_text' in subprogram, but i found in '/ocarina-build/ocarina/doc/source/ping/devices.aadl' at line21 where the special subprogram has no 'source_text'. It confused me. thanks for your replay!

ibertli avatar Apr 10 '23 09:04 ibertli

What do you mean by "we cannot ignore source_text in source program"? A model is perfectly valid if subprograms do not define source_text. However it may not be correct for a specific model processing if absent. For instance, scheduling analysis does not need this property defined, but code generation does. Since code generation may not consider device, it is fine.

yoogx avatar Apr 10 '23 11:04 yoogx

What do you mean by "we cannot ignore source_text in source program"? A model is perfectly valid if subprograms do not define source_text. However it may not be correct for a specific model processing if absent. For instance, scheduling analysis does not need this property defined, but code generation does. Since code generation may not consider device, it is fine.

I do not understand. If i do code generation work use software component without 'source_text' in subprogram, how can i confirm which file to execute when call a subprogram and where is the function 'subprogram_b'? Example like this:


SUBPROGRAM subprogram_b features subb_port: in parameter Base_Types::integer; PROPERTIES SOURCE_LANGUAGE => (C); SOURCE_NAME => "subprogram_b"; END subprogram_b;


ibertli avatar Apr 11 '23 03:04 ibertli

I suggest you study the provided examples.

As I said;

  • your example is perfectly valid if you perform scheduling. The Source_Text property is not necessar.
  • your example is invalid for code generation: the name of the C file is missing and you cannot complete code generation

yoogx avatar Apr 11 '23 11:04 yoogx

I know what's your mean. Aimed at code geration, i cannot ignore 'source_text'。Thanks very much!

ibertli avatar Apr 12 '23 01:04 ibertli