[Acceleo] Netlist Generation (nested loops+ variables?) [message #1690179] |
Wed, 25 March 2015 15:08  |
Frank W. Messages: 10 Registered: March 2015 |
Junior Member |
|
|
Hi,
I am basically trying to generate a net list from my implementation in the internal block diagram. It should look like this for two modules with ref_src1 being a part out the name of the port and iref the name of the connection and so on:
ref_src ref_src1("ref_src1", ref_val, t_step);
ref_src1.out(iref);
diff diff1("diff1");
diff1.ref(iref);
diff1.meas(imeas);
diff1.err(ierr);
Now I basically have the problem that when i am in between the for loops I can access certain elements which I cannot access in different parts of my uml model iterations.
My Code looks like this:
[comment Connections/]
[for (p:Package | aModel.eContents(Package))]
[if (p.name = 'Testbenches')]
[for (c:Class | p.eContents(Class))]
[for (parts:Property | c.eContents(Property))]
[let myPartsName : String = parts.name]
[for (p:Package | aModel.eContents(Package))]
[if (p.name = 'scp_comlib')]
[for (cl:Class | p.eContents(Class))]
[if parts.type.name = cl.name]
[for (property :Property | cl.ownedElement->select(p | p.oclIsKindOf(Port)))]
[myPartsName/].[property.name/]([property./])
[/for]
[/if]
[/for]
[/if]
[/for]
[/let]
[/for]
[/for]
[/if]
[/for]
My Output of this code is this:
ref_src1.out()
diff1.ref()
diff1.err()
diff1.meas()
So I put one 'let' in there so that the instance name gets repeated. But when I want to check the connections I am in a different for loop from which I loose the control of the other parameters. And the let scope is limited.
Like this:
[for (p:Package | aModel.eContents(Package))]
[if (p.name = 'Testbenches')]
[for (c:Class | p.eContents(Class))]
[for (property :Feature | c.ownedElement->select(p |
p.oclIsKindOf(Connector)))]
[property.name/]
[for (cend:ConnectorEnd | property.eContents(ConnectorEnd))]
How can I solve this?
If you have some code example, that would be great.
Or maybe someone has already set up a net list generation.
-Frank
[Updated on: Wed, 25 March 2015 15:23] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.01983 seconds