mirror of
https://github.com/nasa/fpp.git
synced 2025-12-10 00:40:22 -06:00
Compare commits
15 Commits
5c29272470
...
f26251c8a4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f26251c8a4 | ||
|
|
d6d8da96be | ||
|
|
bcda8999a5 | ||
|
|
f78728c2be | ||
|
|
65e2ca9467 | ||
|
|
9a0cd8e473 | ||
|
|
48b8afab20 | ||
|
|
7b6456b879 | ||
|
|
ef97fdc1e6 | ||
|
|
f93a3ee2d6 | ||
|
|
a86606c2b6 | ||
|
|
cdbe834ea2 | ||
|
|
6847034e67 | ||
|
|
0e50a7da7d | ||
|
|
7d107720d8 |
@ -1,8 +0,0 @@
|
||||
ActiveComponentAc.cpp
|
||||
ActiveComponentAc.hpp
|
||||
BasicTopologyAc.cpp
|
||||
BasicTopologyAc.hpp
|
||||
PPortAc.cpp
|
||||
PPortAc.hpp
|
||||
PassiveComponentAc.cpp
|
||||
PassiveComponentAc.hpp
|
||||
@ -0,0 +1,2 @@
|
||||
BasicTopologyAc.cpp
|
||||
BasicTopologyAc.hpp
|
||||
17
compiler/tools/fpp-to-cpp/test/top/basic/components.fpp
Normal file
17
compiler/tools/fpp-to-cpp/test/top/basic/components.fpp
Normal file
@ -0,0 +1,17 @@
|
||||
module M {
|
||||
|
||||
port P
|
||||
|
||||
active component Active {
|
||||
|
||||
async input port p: P
|
||||
|
||||
}
|
||||
|
||||
passive component Passive {
|
||||
|
||||
output port p: P
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,21 +1,3 @@
|
||||
module M {
|
||||
|
||||
port P
|
||||
|
||||
active component Active {
|
||||
|
||||
async input port p: P
|
||||
|
||||
}
|
||||
|
||||
passive component Passive {
|
||||
|
||||
output port p: P
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
instance active1: M.Active base id 0x100 \
|
||||
at "Active.hpp" \
|
||||
queue size 10 stack size 1024 priority 1 cpu 0
|
||||
@ -1,24 +0,0 @@
|
||||
module Fw {
|
||||
port Cmd
|
||||
port CmdReg
|
||||
port CmdResponse
|
||||
port PrmGet
|
||||
port PrmSet
|
||||
port Time
|
||||
port Tlm
|
||||
}
|
||||
|
||||
enum Phases {
|
||||
configConstants
|
||||
configObjects
|
||||
instances
|
||||
initComponents
|
||||
configComponents
|
||||
regCommands
|
||||
readParameters
|
||||
loadParameters
|
||||
startTasks
|
||||
stopTasks
|
||||
freeThreads
|
||||
tearDownComponents
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
echo ' removing old files'
|
||||
./clean
|
||||
|
||||
echo ' generating C++'
|
||||
(
|
||||
cd ../..;
|
||||
fpp_to_cpp=../../../../bin/fpp-to-cpp
|
||||
fprime_dir=../fprime
|
||||
$fpp_to_cpp -p $PWD -i $fprime_dir/config/FpConfig.fpp,$fprime_dir/Platform/PlatformTypes.fpp,$fprime_dir/Fw/Prm/Prm.fpp,phases.fpp \
|
||||
$fprime_dir/Fw/Cmd/Cmd.fpp -d check-cpp-dir/Basic basic.fpp
|
||||
)
|
||||
|
||||
fprime_gcc=../../../../../../scripts/fprime-gcc
|
||||
flags="-I.. -I../../../fprime -I../../../fprime/config -Wno-unused-parameter -c"
|
||||
echo ' compiling C++'
|
||||
for variable_flags in '' '-DFW_DIRECT_PORT_CALLS'
|
||||
do
|
||||
echo " variable_flags=$variable_flags"
|
||||
$fprime_gcc $variable_flags $flags BasicTopologyAc.cpp
|
||||
done
|
||||
@ -1,6 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for file in `find . -name '*~' -or -name '*Ac.*' -or -name '*Ai.xml' -or -name '*.o'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
@ -1,22 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
echo ' removing old files'
|
||||
./clean
|
||||
|
||||
echo ' generating C++'
|
||||
(
|
||||
cd ../..;
|
||||
fpp_to_cpp=../../../../bin/fpp-to-cpp
|
||||
fprime_dir=../fprime
|
||||
$fpp_to_cpp -p $PWD -i $fprime_dir/config/FpConfig.fpp,$fprime_dir/Platform/PlatformTypes.fpp,$fprime_dir/Fw/Prm/Prm.fpp,phases.fpp \
|
||||
$fprime_dir/Fw/Cmd/Cmd.fpp -d check-cpp-dir/Commands commands.fpp
|
||||
)
|
||||
|
||||
fprime_gcc=../../../../../../scripts/fprime-gcc
|
||||
flags="-I.. -I../../../fprime -I../../../fprime/config -Wno-unused-parameter -c"
|
||||
echo ' compiling C++'
|
||||
for variable_flags in '' '-DFW_DIRECT_PORT_CALLS'
|
||||
do
|
||||
echo " variable_flags=$variable_flags"
|
||||
$fprime_gcc $variable_flags $flags CommandsTopologyAc.cpp
|
||||
done
|
||||
@ -1,6 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for file in `find . -maxdepth 1 -name '*~' -or -name '*Ac.*' -or -name '*Ai.xml' -or -name '*.o'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
@ -1,22 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
echo ' removing old files'
|
||||
./clean
|
||||
|
||||
echo ' generating C++'
|
||||
(
|
||||
cd ../..;
|
||||
fpp_to_cpp=../../../../bin/fpp-to-cpp
|
||||
fprime_dir=../fprime
|
||||
$fpp_to_cpp -p $PWD -i $fprime_dir/config/FpConfig.fpp,$fprime_dir/Platform/PlatformTypes.fpp,$fprime_dir/Fw/Prm/Prm.fpp,phases.fpp \
|
||||
$fprime_dir/Fw/Cmd/Cmd.fpp -d check-cpp-dir/Health health.fpp
|
||||
)
|
||||
|
||||
fprime_gcc=../../../../../../scripts/fprime-gcc
|
||||
flags="-I.. -I../../../fprime -I../../../fprime/config -Wno-unused-parameter -c"
|
||||
echo ' compiling C++'
|
||||
for variable_flags in '' '-DFW_DIRECT_PORT_CALLS'
|
||||
do
|
||||
echo " variable_flags=$variable_flags"
|
||||
$fprime_gcc $variable_flags $flags HealthTopologyAc.cpp
|
||||
done
|
||||
@ -1,6 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for file in `find . -name '*~' -or -name '*Ac.*' -or -name '*Ai.xml' -or -name '*.o'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
@ -1,22 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
echo ' removing old files'
|
||||
./clean
|
||||
|
||||
echo ' generating C++'
|
||||
(
|
||||
cd ../..;
|
||||
fpp_to_cpp=../../../../bin/fpp-to-cpp
|
||||
fprime_dir=../fprime
|
||||
$fpp_to_cpp -p $PWD -i $fprime_dir/config/FpConfig.fpp,$fprime_dir/Platform/PlatformTypes.fpp,$fprime_dir/Fw/Prm/Prm.fpp,phases.fpp \
|
||||
$fprime_dir/Fw/Cmd/Cmd.fpp -d check-cpp-dir/Params params.fpp
|
||||
)
|
||||
|
||||
fprime_gcc=../../../../../../scripts/fprime-gcc
|
||||
flags="-I.. -I../../../fprime -I../../../fprime/config -Wno-unused-parameter -c"
|
||||
echo ' compiling C++'
|
||||
for variable_flags in '' '-DFW_DIRECT_PORT_CALLS'
|
||||
do
|
||||
echo " variable_flags=$variable_flags"
|
||||
$fprime_gcc $variable_flags $flags ParamsTopologyAc.cpp
|
||||
done
|
||||
@ -1,6 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for file in `find . -maxdepth 1 -name '*~' -or -name '*Ac.*' -or -name '*Ai.xml' -or -name '*.o'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
@ -1,46 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
fpp_to_cpp=../../../../../../bin/fpp-to-cpp
|
||||
fprime_gcc=../../../../../../scripts/fprime-gcc
|
||||
|
||||
echo ' removing old files'
|
||||
./clean
|
||||
|
||||
dir=`cd ../..; echo $PWD`
|
||||
|
||||
tops="
|
||||
<NoInstances>
|
||||
<OneInstance>
|
||||
<TwoInstances>
|
||||
"
|
||||
|
||||
echo ' generating C++'
|
||||
$fpp_to_cpp -p $dir -i ../../builtin.fpp ../../tlm_packets.fpp
|
||||
for suffix in hpp cpp
|
||||
do
|
||||
top_acs=`echo $tops | sed -e "s;<;../../;g" -e "s;>;TopologyAc.ref.$suffix;g"`
|
||||
for file in ../../*TlmPacketsAc.ref.$suffix $top_acs
|
||||
do
|
||||
base=`basename $file .ref.$suffix`
|
||||
cp $file $base.$suffix
|
||||
done
|
||||
done
|
||||
|
||||
echo ' compiling C++'
|
||||
top_cpps=`echo $tops | sed -e "s;<;;g" -e "s;>;TopologyAc.cpp;g"`
|
||||
for file in *TlmPacketsAc.cpp $top_cpps
|
||||
do
|
||||
include_paths="
|
||||
-I..
|
||||
-I../../../fprime
|
||||
-I../../../fprime/config
|
||||
-I../../../fprime/Fw/Time
|
||||
-I../../../fprime/Fw/Tlm
|
||||
"
|
||||
echo " compiling $file"
|
||||
for variable_flags in '' '-DFW_DIRECT_PORT_CALLS'
|
||||
do
|
||||
echo " variable_flags=$variable_flags"
|
||||
$fprime_gcc $variable_flags $include_paths -Wno-unused-parameter -c $file
|
||||
done
|
||||
done
|
||||
@ -1,6 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for file in `find . -name '*~' -or -name '*Ac.*' -or -name '*Ai.xml' -or -name '*.o'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
@ -1,27 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
fpp_to_cpp=../../../../../../bin/fpp-to-cpp
|
||||
fprime_gcc=../../../../../../scripts/fprime-gcc
|
||||
|
||||
echo ' removing old files'
|
||||
./clean
|
||||
|
||||
base_dir=`cd ../..; echo $PWD`
|
||||
src_dir=$base_dir/typed_ports_active
|
||||
|
||||
echo ' generating C++'
|
||||
$fpp_to_cpp -p $base_dir,$src_dir $src_dir/components.fpp \
|
||||
$src_dir/topology.fpp
|
||||
|
||||
for suffix in hpp cpp
|
||||
do
|
||||
cp $src_dir/TypedPortsActiveTopologyAc.ref.$suffix TypedPortsActiveTopologyAc.$suffix
|
||||
done
|
||||
|
||||
flags="-I.. -I../../../fprime -I../../../fprime/config -Wno-unused-parameter -c"
|
||||
echo ' compiling C++'
|
||||
for variable_flags in '' '-DFW_DIRECT_PORT_CALLS'
|
||||
do
|
||||
echo " variable_flags=$variable_flags"
|
||||
$fprime_gcc $variable_flags $flags TypedPortsActiveTopologyAc.cpp
|
||||
done
|
||||
@ -1,27 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
fpp_to_cpp=../../../../../../bin/fpp-to-cpp
|
||||
fprime_gcc=../../../../../../scripts/fprime-gcc
|
||||
|
||||
echo ' removing old files'
|
||||
./clean
|
||||
|
||||
base_dir=`cd ../..; echo $PWD`
|
||||
src_dir=$base_dir/typed_ports_passive
|
||||
|
||||
echo ' generating C++'
|
||||
$fpp_to_cpp -p $base_dir,$src_dir $src_dir/components.fpp \
|
||||
$src_dir/topology.fpp
|
||||
|
||||
for suffix in hpp cpp
|
||||
do
|
||||
cp $src_dir/TypedPortsPassiveTopologyAc.ref.$suffix TypedPortsPassiveTopologyAc.$suffix
|
||||
done
|
||||
|
||||
flags="-I.. -I../../../fprime -I../../../fprime/config -Wno-unused-parameter -c"
|
||||
echo ' compiling C++'
|
||||
for variable_flags in '' '-DFW_DIRECT_PORT_CALLS'
|
||||
do
|
||||
echo " variable_flags=$variable_flags"
|
||||
$fprime_gcc $variable_flags $flags TypedPortsPassiveTopologyAc.cpp
|
||||
done
|
||||
@ -1,27 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
fpp_to_cpp=../../../../../../bin/fpp-to-cpp
|
||||
fprime_gcc=../../../../../../scripts/fprime-gcc
|
||||
|
||||
echo ' removing old files'
|
||||
./clean
|
||||
|
||||
base_dir=`cd ../..; echo $PWD`
|
||||
src_dir=$base_dir/typed_ports_queued
|
||||
|
||||
echo ' generating C++'
|
||||
$fpp_to_cpp -p $base_dir,$src_dir $src_dir/components.fpp \
|
||||
$src_dir/topology.fpp
|
||||
|
||||
for suffix in hpp cpp
|
||||
do
|
||||
cp $src_dir/TypedPortsQueuedTopologyAc.ref.$suffix TypedPortsQueuedTopologyAc.$suffix
|
||||
done
|
||||
|
||||
flags="-I.. -I../../../fprime -I../../../fprime/config -Wno-unused-parameter -c"
|
||||
echo ' compiling C++'
|
||||
for variable_flags in '' '-DFW_DIRECT_PORT_CALLS'
|
||||
do
|
||||
echo " variable_flags=$variable_flags"
|
||||
$fprime_gcc $variable_flags $flags TypedPortsQueuedTopologyAc.cpp
|
||||
done
|
||||
@ -1,7 +1,11 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for dir in `cat subdirs.txt`
|
||||
cd `dirname $0`
|
||||
|
||||
. ./check_topology.sh
|
||||
|
||||
for dir in `find . -mindepth 1 -type d`
|
||||
do
|
||||
echo "checking $dir"
|
||||
(cd $dir; ./check)
|
||||
(cd $dir; check_topology)
|
||||
done
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
check_topology()
|
||||
{
|
||||
|
||||
if test -z "$1"
|
||||
then
|
||||
src_dir=`basename $PWD`
|
||||
else
|
||||
src_dir=$1
|
||||
fi
|
||||
|
||||
dir=`dirname $0`
|
||||
dir=`cd $dir; pwd`
|
||||
|
||||
cd $dir/../..
|
||||
. ./defs.sh
|
||||
cd $dir
|
||||
|
||||
echo ' removing old files'
|
||||
./clean
|
||||
|
||||
echo ' generating C++'
|
||||
(
|
||||
cd $dir/../../$src_dir;
|
||||
$FPP_TO_CPP -p $PWD -i $FPRIME_DEPS,../phases.fpp -d $dir components.fpp topology.fpp
|
||||
)
|
||||
|
||||
options="
|
||||
-I..
|
||||
-I$FPRIME_DIR
|
||||
-I$FPRIME_DIR/config
|
||||
-I$FPRIME_DIR/Fw/Time
|
||||
-I$FPRIME_DIR/Fw/Tlm
|
||||
-Wno-unused-parameter
|
||||
-c
|
||||
"
|
||||
|
||||
#flags="-I$FPRIME_DIR -I$FPRIME_DIR/config -Wno-unused-parameter -c"
|
||||
top_files=`find . -maxdepth 1 -name '*TopologyAc.cpp'`
|
||||
for top_file in $top_files
|
||||
do
|
||||
top_name=`echo $top_file | sed -e 's;^\./;;' -e 's/TopologyAc\.cpp$//'`
|
||||
echo ' compiling C++ for '$top_name
|
||||
for variable_flags in '' '-DFW_DIRECT_PORT_CALLS'
|
||||
do
|
||||
echo " variable_flags=$variable_flags"
|
||||
$FPRIME_GCC $variable_flags $options $top_name'TopologyAc.cpp'
|
||||
done
|
||||
done
|
||||
|
||||
tlm_packet_files=`find . -maxdepth 1 -name '*TlmPacketsAc.cpp'`
|
||||
for tlm_packet_file in $tlm_packet_files
|
||||
do
|
||||
echo " compiling $tlm_packet_file"
|
||||
for variable_flags in '' '-DFW_DIRECT_PORT_CALLS'
|
||||
do
|
||||
echo " variable_flags=$variable_flags"
|
||||
$FPRIME_GCC $variable_flags $options $tlm_packet_file
|
||||
done
|
||||
done
|
||||
|
||||
}
|
||||
@ -1,12 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
echo "removing Ac files"
|
||||
for file in `find . -name '*Ac.*'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
|
||||
for dir in `cat subdirs.txt`
|
||||
for dir in `find . -mindepth 1 -type d`
|
||||
do
|
||||
(cd $dir; echo "cleaning $PWD"; ./clean)
|
||||
done
|
||||
|
||||
6
compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/params/clean
Executable file
6
compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/params/clean
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for file in `find . -name '*~' -or -name '*Ac.*' -or -name '*.o'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
@ -1,8 +0,0 @@
|
||||
Basic
|
||||
Commands
|
||||
Health
|
||||
Params
|
||||
TlmPackets
|
||||
TypedPortsActive
|
||||
TypedPortsPassive
|
||||
TypedPortsQueued
|
||||
6
compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/tlm_packets/clean
Executable file
6
compiler/tools/fpp-to-cpp/test/top/check-cpp-dir/tlm_packets/clean
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for file in `find . -name '*~' -or -name '*Ac.*' -or -name '*.o'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
@ -0,0 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for file in `find . -name '*~' -or -name '*Ac.*' -or -name '*.o'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
@ -0,0 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for file in `find . -name '*~' -or -name '*Ac.*' -or -name '*.o'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
@ -0,0 +1,6 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
for file in `find . -name '*~' -or -name '*Ac.*' -or -name '*.o'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
clean
|
||||
rm -f default-tests.sh default-update-ref.sh
|
||||
for file in `find . -name '*o' -or -name '*Ac.hpp' -or -name '*Ac.cpp'`
|
||||
for file in `find . -name '*o' -or -name '*Ac.hpp' -or -name '*Ac.cpp' -or -name '*.names.txt'`
|
||||
do
|
||||
rm $file
|
||||
done
|
||||
|
||||
@ -146,7 +146,10 @@ namespace M {
|
||||
return result;
|
||||
}
|
||||
|
||||
void CComponentBase::cmdRegOut_out(FwIndexType portNum) const {
|
||||
void CComponentBase::cmdRegOut_out(
|
||||
FwIndexType portNum,
|
||||
FwOpcodeType opCode
|
||||
) const {
|
||||
FW_ASSERT(
|
||||
(0 <= portNum) && (portNum < NUM_CMDREGOUT_OUTPUT_PORTS),
|
||||
static_cast<FwAssertArgType>(portNum),
|
||||
@ -160,7 +163,12 @@ namespace M {
|
||||
}
|
||||
}
|
||||
|
||||
void CComponentBase::cmdResponseOut_out(FwIndexType portNum) const {
|
||||
void CComponentBase::cmdResponseOut_out(
|
||||
FwIndexType portNum,
|
||||
FwOpcodeType opCode,
|
||||
U32 cmdSeq,
|
||||
const Fw::CmdResponse& response
|
||||
) const {
|
||||
FW_ASSERT(
|
||||
(0 <= portNum) && (portNum < NUM_CMDRESPONSEOUT_OUTPUT_PORTS),
|
||||
static_cast<FwAssertArgType>(portNum),
|
||||
@ -22,24 +22,4 @@ module M {
|
||||
|
||||
}
|
||||
|
||||
instance c1: C base id 0x100 {
|
||||
|
||||
phase Phases.regCommands """
|
||||
M::c1.regCommandsSpecial();
|
||||
"""
|
||||
|
||||
}
|
||||
|
||||
instance c2: C base id 0x200
|
||||
|
||||
instance c3: NoCommands base id 0x300
|
||||
|
||||
topology Commands {
|
||||
|
||||
instance c1
|
||||
instance c2
|
||||
instance c3
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
23
compiler/tools/fpp-to-cpp/test/top/commands/topology.fpp
Normal file
23
compiler/tools/fpp-to-cpp/test/top/commands/topology.fpp
Normal file
@ -0,0 +1,23 @@
|
||||
module M {
|
||||
|
||||
instance c1: C base id 0x100 {
|
||||
|
||||
phase Phases.regCommands """
|
||||
M::c1.regCommandsSpecial();
|
||||
"""
|
||||
|
||||
}
|
||||
|
||||
instance c2: C base id 0x200
|
||||
|
||||
instance c3: NoCommands base id 0x300
|
||||
|
||||
topology Commands {
|
||||
|
||||
instance c1
|
||||
instance c2
|
||||
instance c3
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
9
compiler/tools/fpp-to-cpp/test/top/defs.sh
Normal file
9
compiler/tools/fpp-to-cpp/test/top/defs.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
export COMPILER_ROOT=`cd ../../../..; pwd`
|
||||
|
||||
export TOP_DIR=$PWD
|
||||
export FPRIME_DIR=`cd ../fprime; pwd`
|
||||
export FPRIME_DEPS="$FPRIME_DIR/config/FpConfig.fpp,$FPRIME_DIR/Platform/PlatformTypes.fpp,$FPRIME_DIR/Fw/Prm/Prm.fpp,$FPRIME_DIR/Fw/Cmd/Cmd.fpp,$FPRIME_DIR/Fw/Time/Time.fpp,$FPRIME_DIR/Fw/Tlm/Tlm.fpp"
|
||||
export FPRIME_GCC=$COMPILER_ROOT/scripts/fprime-gcc
|
||||
export FPP_TO_CPP=$COMPILER_ROOT/bin/fpp-to-cpp
|
||||
@ -15,16 +15,4 @@ module M {
|
||||
output port pingOut: Svc.Ping
|
||||
}
|
||||
|
||||
instance $health: Svc.Health base id 0x100
|
||||
|
||||
instance c1: C base id 0x200
|
||||
instance c2: C base id 0x300
|
||||
|
||||
topology Health {
|
||||
instance $health
|
||||
instance c1
|
||||
instance c2
|
||||
health connections instance $health
|
||||
}
|
||||
|
||||
}
|
||||
15
compiler/tools/fpp-to-cpp/test/top/health/topology.fpp
Normal file
15
compiler/tools/fpp-to-cpp/test/top/health/topology.fpp
Normal file
@ -0,0 +1,15 @@
|
||||
module M {
|
||||
|
||||
instance $health: Svc.Health base id 0x100
|
||||
|
||||
instance c1: C base id 0x200
|
||||
instance c2: C base id 0x300
|
||||
|
||||
topology Health {
|
||||
instance $health
|
||||
instance c1
|
||||
instance c2
|
||||
health connections instance $health
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
module M {
|
||||
|
||||
module N {
|
||||
|
||||
module O {
|
||||
|
||||
passive component C {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,19 +1,3 @@
|
||||
module M {
|
||||
|
||||
module N {
|
||||
|
||||
module O {
|
||||
|
||||
passive component C {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
instance c: M.N.O.C base id 0x100
|
||||
|
||||
module M {
|
||||
@ -171,7 +171,10 @@ namespace M {
|
||||
return result;
|
||||
}
|
||||
|
||||
void CComponentBase::cmdRegOut_out(FwIndexType portNum) const {
|
||||
void CComponentBase::cmdRegOut_out(
|
||||
FwIndexType portNum,
|
||||
FwOpcodeType opCode
|
||||
) const {
|
||||
FW_ASSERT(
|
||||
(0 <= portNum) && (portNum < NUM_CMDREGOUT_OUTPUT_PORTS),
|
||||
static_cast<FwAssertArgType>(portNum),
|
||||
@ -185,7 +188,12 @@ namespace M {
|
||||
}
|
||||
}
|
||||
|
||||
void CComponentBase::cmdResponseIn_out(FwIndexType portNum) const {
|
||||
void CComponentBase::cmdResponseIn_out(
|
||||
FwIndexType portNum,
|
||||
FwOpcodeType opCode,
|
||||
U32 cmdSeq,
|
||||
const Fw::CmdResponse& response
|
||||
) const {
|
||||
FW_ASSERT(
|
||||
(0 <= portNum) && (portNum < NUM_CMDRESPONSEIN_OUTPUT_PORTS),
|
||||
static_cast<FwAssertArgType>(portNum),
|
||||
@ -199,21 +207,31 @@ namespace M {
|
||||
}
|
||||
}
|
||||
|
||||
void CComponentBase::prmGetOut_out(FwIndexType portNum) const {
|
||||
Fw::ParamValid CComponentBase::prmGetOut_out(
|
||||
FwIndexType portNum,
|
||||
FwPrmIdType id,
|
||||
Fw::ParamBuffer& val
|
||||
) const {
|
||||
FW_ASSERT(
|
||||
(0 <= portNum) && (portNum < NUM_PRMGETOUT_OUTPUT_PORTS),
|
||||
static_cast<FwAssertArgType>(portNum),
|
||||
static_cast<FwAssertArgType>(NUM_PRMGETOUT_OUTPUT_PORTS)
|
||||
);
|
||||
const auto instance = this->getInstance();
|
||||
Fw::ParamValid _result = {};
|
||||
switch (instance) {
|
||||
default:
|
||||
FW_ASSERT(0, static_cast<FwAssertArgType>(instance));
|
||||
break;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
|
||||
void CComponentBase::prmSetOut_out(FwIndexType portNum) const {
|
||||
void CComponentBase::prmSetOut_out(
|
||||
FwIndexType portNum,
|
||||
FwPrmIdType id,
|
||||
Fw::ParamBuffer& val
|
||||
) const {
|
||||
FW_ASSERT(
|
||||
(0 <= portNum) && (portNum < NUM_PRMSETOUT_OUTPUT_PORTS),
|
||||
static_cast<FwAssertArgType>(portNum),
|
||||
19
compiler/tools/fpp-to-cpp/test/top/params/components.fpp
Normal file
19
compiler/tools/fpp-to-cpp/test/top/params/components.fpp
Normal file
@ -0,0 +1,19 @@
|
||||
module M {
|
||||
|
||||
passive component C {
|
||||
|
||||
command recv port cmdOut
|
||||
|
||||
command reg port cmdRegOut
|
||||
|
||||
command resp port cmdResponseIn
|
||||
|
||||
param P: U32
|
||||
|
||||
param get port prmGetOut
|
||||
|
||||
param set port prmSetOut
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,21 +1,5 @@
|
||||
module M {
|
||||
|
||||
passive component C {
|
||||
|
||||
command recv port cmdOut
|
||||
|
||||
command reg port cmdRegOut
|
||||
|
||||
command resp port cmdResponseIn
|
||||
|
||||
param P: U32
|
||||
|
||||
param get port prmGetOut
|
||||
|
||||
param set port prmSetOut
|
||||
|
||||
}
|
||||
|
||||
instance c1: C base id 0x100 {
|
||||
|
||||
phase Phases.readParameters """
|
||||
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
export COMPILER_ROOT=../../../..
|
||||
. ./defs.sh
|
||||
|
||||
sh ../scripts/run.sh
|
||||
|
||||
@ -1,43 +1,50 @@
|
||||
basic()
|
||||
{
|
||||
run_test "-i builtin.fpp -n basic.names.txt -p $PWD" basic && \
|
||||
cd $TOP_DIR/basic
|
||||
run_test "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp -n basic.names.txt" topology && \
|
||||
diff -u basic.names.txt basic.names.ref.txt && \
|
||||
diff_cpp BasicTopology
|
||||
}
|
||||
|
||||
commands()
|
||||
{
|
||||
run_test "-i builtin.fpp -p $PWD" commands && \
|
||||
cd $TOP_DIR/commands
|
||||
run_test "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp" topology && \
|
||||
diff_cpp CommandsTopology
|
||||
}
|
||||
|
||||
health()
|
||||
{
|
||||
run_test "-i builtin.fpp -p $PWD" health && \
|
||||
cd $TOP_DIR/health
|
||||
run_test "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp" topology && \
|
||||
diff_cpp HealthTopology
|
||||
}
|
||||
|
||||
nested_namespaces()
|
||||
{
|
||||
run_test "-p $PWD" nested_namespaces && \
|
||||
cd $TOP_DIR/nested_namespaces
|
||||
run_test "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp" topology && \
|
||||
diff_cpp NestedNamespacesTopology
|
||||
}
|
||||
|
||||
no_namespace()
|
||||
{
|
||||
run_test "-p $PWD" no_namespace && \
|
||||
cd $TOP_DIR/no_namespace
|
||||
run_test "-p $PWD -i $FPRIME_DEPS,../phases.fpp" topology && \
|
||||
diff_cpp NoNamespaceTopology
|
||||
}
|
||||
|
||||
params()
|
||||
{
|
||||
run_test "-i builtin.fpp -p $PWD" params && \
|
||||
cd $TOP_DIR/params
|
||||
run_test "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp" topology && \
|
||||
diff_cpp ParamsTopology
|
||||
}
|
||||
|
||||
tlm_packets()
|
||||
{
|
||||
run_test "-i builtin.fpp -p $PWD" tlm_packets && \
|
||||
cd $TOP_DIR/tlm_packets
|
||||
run_test "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp" topology && \
|
||||
diff_cpp NoInstancesTopology && \
|
||||
diff_cpp NoInstances_P1TlmPackets && \
|
||||
diff_cpp NoInstances_P2TlmPackets && \
|
||||
@ -51,6 +58,7 @@ tlm_packets()
|
||||
|
||||
typed_ports_active()
|
||||
{
|
||||
cd $TOP_DIR
|
||||
src_dir=$PWD/typed_ports_active
|
||||
run_test "-d $src_dir -p $PWD,$src_dir -i $src_dir/components.fpp" \
|
||||
$src_dir/topology && \
|
||||
@ -59,6 +67,7 @@ typed_ports_active()
|
||||
|
||||
typed_ports_passive()
|
||||
{
|
||||
cd $TOP_DIR
|
||||
src_dir=$PWD/typed_ports_passive
|
||||
run_test "-d $src_dir -p $PWD,$src_dir -i $src_dir/components.fpp" \
|
||||
$src_dir/topology && \
|
||||
@ -67,6 +76,7 @@ typed_ports_passive()
|
||||
|
||||
typed_ports_queued()
|
||||
{
|
||||
cd $TOP_DIR
|
||||
src_dir=$PWD/typed_ports_queued
|
||||
run_test "-d $src_dir -p $PWD,$src_dir -i $src_dir/components.fpp" \
|
||||
$src_dir/topology && \
|
||||
|
||||
@ -128,7 +128,10 @@ bool CComponentBase::isConnected_tlmOut_OutputPort(FwIndexType portNum) const {
|
||||
return result;
|
||||
}
|
||||
|
||||
void CComponentBase::timeGetOut_out(FwIndexType portNum) const {
|
||||
void CComponentBase::timeGetOut_out(
|
||||
FwIndexType portNum,
|
||||
Fw::Time& time
|
||||
) const {
|
||||
FW_ASSERT(
|
||||
(0 <= portNum) && (portNum < NUM_TIMEGETOUT_OUTPUT_PORTS),
|
||||
static_cast<FwAssertArgType>(portNum),
|
||||
@ -142,7 +145,12 @@ void CComponentBase::timeGetOut_out(FwIndexType portNum) const {
|
||||
}
|
||||
}
|
||||
|
||||
void CComponentBase::tlmOut_out(FwIndexType portNum) const {
|
||||
void CComponentBase::tlmOut_out(
|
||||
FwIndexType portNum,
|
||||
FwChanIdType id,
|
||||
Fw::Time& timeTag,
|
||||
Fw::TlmBuffer& val
|
||||
) const {
|
||||
FW_ASSERT(
|
||||
(0 <= portNum) && (portNum < NUM_TLMOUT_OUTPUT_PORTS),
|
||||
static_cast<FwAssertArgType>(portNum),
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user