OpenAADL / ocarina

AADL model processor: mappings to code (C, Ada); Petri Nets; scheduling tools (MAST, Cheddar); WCET; REAL
http://www.openaadl.org
Other
64 stars 29 forks source link

how to import custom Property Set? #315

Closed ibertli closed 1 year ago

ibertli commented 1 year ago

hello sir, i got a problem want to ask for your help. When i import a custom property set use 'with' statement, and run ocarina, it throw an error "can not open file xx.aadl",i have try some different methods, for example: move 'my_pro.aadl' to the path same to 'Data_Model.aadl', or use '-I ARG', but all of that are useless. i want to know how to correctly import custom property set. demo like this:


-- my_pro.aadl property set my_prois CoreNum: aadlinteger applies to (thread); end my_pro;

-- test1.aadl PACKAGE rmaaadl PUBLIC WITH deployment; with Data_Model; with Base_Types; with my_pro; ... end rmaaadl


Thanks for your reply!

yoogx commented 1 year ago

How do you use Ocarina? which command line argument do you pass?

1/ Check this example: https://github.com/OpenAADL/AADLib/blob/master/examples/rosace/rosace-posix.aadl, it shows how to do multicore systems

2/ Check the provided makefile, it shows how to use command line parameters to achieve what you want. You want to use -aadlv2 -f -y , see --help for details

ibertli commented 1 year ago

I use ocarina in Ubuntu 20.04, and test1.aadl only has one system named 'rma.c', i use the command to generate C code like this: "./ocarina -aadlv2 /home/ubuntu/Documents/ocarina-build/ocarina_install/share/ocarina/AADLv2/ -f -disable-annexes=all -r rmaaadl::rma.c -g polyorb_hi_c -o /home/ubuntu/Documents/aadl_demo/ /home/ubuntu/Documents/aadl_demo/test.aadl"

If i do not import 'my_pro' use "with my_pro" statement in 'test1.aadl', ocarina can generate C code successfully, but if i try to import 'my_pro' and run ocarina with command like this:


"./ocarina -aadlv2 /home/ubuntu/Documents/ocarina-build/ocarina_install/share/ocarina/AADLv2/ -f -y -disable-annexes=all -r rmaaadl::rma.c -g polyorb_hi_c -o /home/ubuntu/Documents/aadl_demo/ /home/ubuntu/Documents/aadl_demo/test.aadl"


it will throw an error "undefined cannot find file my_pro.aadl". It seems that ocarina not find the file in a special path.

yoogx commented 1 year ago

From --help -I ARG Add ARG to the directory search list

I guess you should have done this

"./ocarina -aadlv2 -I /home/ubuntu/Documents/ocarina-build/ocarina_install/share/ocarina/AADLv2/ -f -y -disable-annexes=all -r rmaaadl::rma.c -g polyorb_hi_c -o /home/ubuntu/Documents/aadl_demo/ /home/ubuntu/Documents/aadl_demo/test.aadl"

ibertli commented 1 year ago

Actually, i have tried like this, but still got an error "cannot find file my_pro.aadl"。Do you use the command line above without reporting any errors?

sei-jhugues commented 1 year ago

Yes

Both files are in the same directory

➜ issue_315 ocarina -v -y -aadlv2 test1.aadl Ocarina v2017.1-510-gf2c500f (Working Copy from rf2c500fe) Copyright (c) 2003-2009 Telecom ParisTech, 2010-2019 ESA & ISAE , 2019-2021 OpenAADL Build date: Feb 26 2021 13:15:24 Loading file test1.aadl Loading file my_pro.aadl Loading of all files done Model parsing: completed

➜ issue_315 cat *.aadl
property set my_pro is CoreNum: aadlinteger applies to (thread); end my_pro; PACKAGE test1 PUBLIC with my_pro;

end test1;

Files in different directories

➜ issue_315 ocarina -v -y -aadlv2 -I./ps test1.aadl Ocarina v2017.1-510-gf2c500f (Working Copy from rf2c500fe) Copyright (c) 2003-2009 Telecom ParisTech, 2010-2019 ESA & ISAE , 2019-2021 OpenAADL Build date: Feb 26 2021 13:15:24 Loading file test1.aadl Loading file my_pro.aadl Loading of all files done Model parsing: completed

➜ issue_315 find . . ./test1.aadl ./ps ./ps/my_pro.aadl

sei-jhugues commented 1 year ago

Actually, i have tried like this, but still got an error "cannot find file my_pro.aadl"。Do you use the command line above without reporting any errors?

In the command above, add -v to see what Ocarina does. Note that the search directories are 1/ the directory from which you invoke Ocarina, 2/ the directory of default property sets, 3/ whatever is specified in -I flags.

ibertli commented 1 year ago

Actually, i have tried like this, but still got an error "cannot find file my_pro.aadl"。Do you use the command line above without reporting any errors?

In the command above, add -v to see what Ocarina does. Note that the search directories are 1/ the directory from which you invoke Ocarina, 2/ the directory of default property sets, 3/ whatever is specified in -I flags.

Thanks very much, i have resolved the problem base on your suggestion!