Closed bocchino closed 2 years ago
@LeStarch FYI. Let me know if you need other framework dependency info.
Guarded inputs/commands as these need a dependency on Os. Everything else should not cause issues if including in a global list.
Note: the Ai XML representation is here: https://github.com/nasa/fprime/blob/devel/cmake/support/parser/ai_parser.py this has all the details broken out, although we decided we can live with larger aggregates.
@timcanham also put in a "packets" setup, but I think for now that will still be an XML definition as it is a custom autocoder.
Sounds good. I think coarsening the dependencies at this stage is a good idea, to simplify and reduce coupling, if it works OK. Eventually we will need even finer-grained dependencies (FPP symbol --> framework header file) to do C++ code gen, but we can't do that analysis in fpp-depend.
I think the coarsening should work fine, since the performance bottleneck is dependency analysis, not compiling a few extra small C++ files in the framework here and there.
I agree that FPP analysis can't do anything with telemetry packets at this stage. BTW I notice that Svc_TlmPacketizer
is not represented in DEPENDENCY_ORDER
-- is this a bug?
My plan is to have the tool print out these dependencies, in the correct (reversed) order:
Fw_Comp
Os
Fw_CompQueued
If needed we can add more later. But it looks like we can just make the others unconditional and place them all before these ones.
place them all before
By which, of course, I mean place after (because of the reversal).
BTW I notice that Svc_TlmPacketizer is not represented in DEPENDENCY_ORDER -- is this a bug?
OK, it looks like any dependency not in DEPENDENCY_ORDER goes at the end.
@LeStarch Can you see if the changes on this branch
https://github.com/fprime-community/fpp/tree/issue-101-fwk-depend
are doing what you need? I added an -f option to fpp-depend. It's documented on the wiki and in the User's Guide on this branch. You can see it by installing from this branch and running fpp-depend --help
.
Example:
[I] bocchino@MT-306179 ~/J/T/f/d/users-guide (issue-101-fwk-depend)> fpp-depend -f fwk.txt
active component C { }
passive component D {
guarded input port p: P
}
[I] bocchino@MT-306179 ~/J/T/f/d/users-guide (issue-101-fwk-depend)> cat fwk.txt
Fw_CompQueued
Os
Fw_Comp
Yes, I can take a look tomorrow!
@bocchino this seems to always generate an empty file. I am running it on FileManager.fpp, which has an active component and thus should depend on Fw_CompQueued...but generates an empty file.
@bocchino I see two bugs on this branch:
module Svc { --defined here -- }
) then this fails.Fw_CompQueued
but it should report Fw_CompQueued
and Os
... although this is a moot point because the Os dependency is done inside Fw_CompQueue
too @bocchino here is a patch that fixes the first bug. The second is, again, inconsequential.
index ae01eb0d..63503d9f 100644
--- a/compiler/lib/src/main/scala/analysis/ComputeDependencies/Framework/ComputeFrameworkDependencies.scala
+++ b/compiler/lib/src/main/scala/analysis/ComputeDependencies/Framework/ComputeFrameworkDependencies.scala
@@ -20,6 +20,15 @@ object ComputeFrameworkDependencies extends AstStateVisitor {
visitList(s + d, data.members, matchComponentMember)
}
+ override def defModuleAnnotatedNode(
+ s: State,
+ aNode: Ast.Annotated[AstNode[Ast.DefModule]]
+ ) = {
+ val (_, node, _) = aNode
+ val data = node.data
+ visitList(s, data.members, matchModuleMember)
+ }
+
Thanks, good catch! I fixed both issues.
Here is my current understanding of the framework dependency rules: https://github.com/fprime-community/fpp/wiki/fpp-depend
I'll go ahead and merge the branch to main. Let me know if you see any other issues.
Done in commit d029d357c0e8900f07e2c6b0be864e4a724f974d.
For reporting framework dependencies to CMake. Known dependencies are