Revise top tests

This commit is contained in:
Rob Bocchino 2025-12-04 20:41:05 -08:00
parent ef97fdc1e6
commit 7b6456b879
8 changed files with 47 additions and 43 deletions

View File

@ -1,22 +1,5 @@
#!/bin/sh -e
echo ' removing old files'
./clean
. `dirname $0`/../check_topology.sh
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
check_topology params Params

View File

@ -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),

View 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
}
}

View File

@ -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 """

View File

@ -36,8 +36,8 @@ no_namespace()
params()
{
cd $TOP_DIR
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
}

View File

@ -36,8 +36,8 @@ no_namespace()
params()
{
cd $TOP_DIR
update "-i builtin.fpp -p $PWD" params
cd $TOP_DIR/params
update "-p $PWD -i $FPRIME_DEPS,../phases.fpp,components.fpp" topology
move_cpp ParamsTopology
}