Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whether can ignore 'source_text' in subprogram? #313

Open
ibertli opened this issue Apr 10, 2023 · 4 comments
Open

whether can ignore 'source_text' in subprogram? #313

ibertli opened this issue Apr 10, 2023 · 4 comments
Assignees
Labels

Comments

@ibertli
Copy link

ibertli commented Apr 10, 2023

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!

@yoogx
Copy link
Contributor

yoogx commented Apr 10, 2023

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 yoogx added the question label Apr 10, 2023
@yoogx yoogx self-assigned this Apr 10, 2023
@ibertli
Copy link
Author

ibertli commented Apr 11, 2023

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;


@yoogx
Copy link
Contributor

yoogx commented Apr 11, 2023

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

@ibertli
Copy link
Author

ibertli commented Apr 12, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants