diff --git a/compiler/tools/fpp-to-cpp/test/top/CommandsTopologyAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/top/CommandsTopologyAc.ref.cpp index d0769a297..a6a4d6986 100644 --- a/compiler/tools/fpp-to-cpp/test/top/CommandsTopologyAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/top/CommandsTopologyAc.ref.cpp @@ -22,6 +22,12 @@ namespace M { } +namespace M { + + M::NoCommands c3(FW_OPTIONAL_NAME("c3")); + +} + namespace M { // ---------------------------------------------------------------------- @@ -31,6 +37,7 @@ namespace M { void initComponents(const TopologyState& state) { M::c1.init(InstanceIds::M_c1); M::c2.init(InstanceIds::M_c2); + M::c3.init(InstanceIds::M_c3); } void configComponents(const TopologyState& state) { @@ -40,6 +47,7 @@ namespace M { void setBaseIds() { M::c1.setIdBase(BaseIds::M_c1); M::c2.setIdBase(BaseIds::M_c2); + M::c3.setIdBase(BaseIds::M_c3); } void connectComponents() { @@ -168,4 +176,40 @@ namespace M { } +namespace M { + + bool NoCommandsComponentBase::isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const { + FW_ASSERT( + (0 <= portNum) && (portNum < NUM_CMDREGOUT_OUTPUT_PORTS), + static_cast(portNum), + static_cast(NUM_CMDREGOUT_OUTPUT_PORTS) + ); + bool result = false; + const auto instance = this->getInstance(); + switch (instance) { + default: + FW_ASSERT(0, static_cast(instance)); + break; + } + return result; + } + + bool NoCommandsComponentBase::isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const { + FW_ASSERT( + (0 <= portNum) && (portNum < NUM_CMDRESPONSEOUT_OUTPUT_PORTS), + static_cast(portNum), + static_cast(NUM_CMDRESPONSEOUT_OUTPUT_PORTS) + ); + bool result = false; + const auto instance = this->getInstance(); + switch (instance) { + default: + FW_ASSERT(0, static_cast(instance)); + break; + } + return result; + } + +} + #endif diff --git a/compiler/tools/fpp-to-cpp/test/top/CommandsTopologyAc.ref.hpp b/compiler/tools/fpp-to-cpp/test/top/CommandsTopologyAc.ref.hpp index 9f0fc4378..1c86f1db4 100644 --- a/compiler/tools/fpp-to-cpp/test/top/CommandsTopologyAc.ref.hpp +++ b/compiler/tools/fpp-to-cpp/test/top/CommandsTopologyAc.ref.hpp @@ -9,6 +9,7 @@ #include "C.hpp" #include "CommandsTopologyDefs.hpp" +#include "NoCommands.hpp" // ---------------------------------------------------------------------- // Component instances @@ -28,6 +29,13 @@ namespace M { } +namespace M { + + //! c3 + extern M::NoCommands c3; + +} + namespace M { // ---------------------------------------------------------------------- @@ -38,6 +46,7 @@ namespace M { enum { M_c1 = 0x100, M_c2 = 0x200, + M_c3 = 0x300, }; } @@ -45,6 +54,7 @@ namespace M { enum { M_c1, M_c2, + M_c3, }; } diff --git a/compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/Commands/NoCommands.hpp b/compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/Commands/NoCommands.hpp new file mode 100644 index 000000000..1fa868e79 --- /dev/null +++ b/compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/Commands/NoCommands.hpp @@ -0,0 +1,34 @@ +#ifndef M_NoCommands_HPP +#define M_NoCommands_HPP + +#include "NoCommandsComponentAc.hpp" + +namespace M { + + class NoCommands : + public NoCommandsComponentBase + { + + public: + + NoCommands(const char* name) { + + } + + void init(U32 instanceId) { + + } + + void regCommandsSpecial() { + + } + + void NoCommands_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) { + + } + + }; + +} + +#endif diff --git a/compiler/tools/fpp-to-cpp/test/top/commands.fpp b/compiler/tools/fpp-to-cpp/test/top/commands.fpp index 71df64936..16cf0000d 100644 --- a/compiler/tools/fpp-to-cpp/test/top/commands.fpp +++ b/compiler/tools/fpp-to-cpp/test/top/commands.fpp @@ -12,6 +12,16 @@ module M { } + passive component NoCommands { + + command recv port cmdOut + + command reg port cmdRegOut + + command resp port cmdResponseOut + + } + instance c1: C base id 0x100 { phase Phases.regCommands """ @@ -22,10 +32,13 @@ module M { instance c2: C base id 0x200 + instance c3: NoCommands base id 0x300 + topology Commands { instance c1 instance c2 + instance c3 }