nasa / fpp

F Prime Prime: A modeling language for F Prime
https://fprime.jpl.nasa.gov
Apache License 2.0
49 stars 31 forks source link

Phase 1 state machines #493

Closed garthwatney closed 1 month ago

garthwatney commented 2 months ago

This pull request adds the Phase 1 of state machines to the FPP language. In phase 1 the state machine behavior is specified outside FPP but the state machine definition names and instance names are specified in FPP and the appropriate support code is generated in the component base class. There are also some incidental cleanup like the key words (ask Rob)

bocchino commented 2 months ago

We held an in-person review on 8/20/24. At that review we agreed on the following changes:

We agreed to meet again to finish the review.

garthwatney commented 2 months ago

All issues from the 8/20 review should be fixed.

bocchino commented 2 months ago

Great! I confirmed that the check-cpp tests pass.

As discussed, let's exercise a few more capabilities in the state machines in the unit tests.

bocchino commented 2 months ago

I confirmed that the check-cpp tests pass.

Scratch that, I forgot to pull the latest. It looks like the STARS-generated code needs to be updated in this repo in order for the fpp-check compilation to work.

bocchino commented 2 months ago

After the updates, I ran fpp-check against this F Prime branch: https://github.com/garthwatney/fprime/commit/08d8135b341daf5531a0ed1c1c06bad6bfe636f5. I'm seeing this compilation error in fpp-to-cpp/test/component/impl:

In file included from ActiveStateMachines.cpp:7:
./ActiveStateMachines.hpp:40:17: error: use of undeclared identifier 'S2_Interface'
          const S2_Interface::S2_Signals signal, //!< The state machine signal
                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
bocchino commented 2 months ago

fpp-check is now passing.