跳到正文
Skillpedia
API 与服务器(后端)12k · #11503

fprime-topology-development

它能做什么

它指导 AI 编辑拓扑文件,这些文件定义了 F Prime 系统中运行哪些组件以及它们如何连接。适用于组装 F Prime 部署的工程师。

适用场景

  • ✓当你要把新组件添加到现有 F Prime 部署中时。
  • ✓当你修改拓扑中的实例、连接或速率组时。
  • ✓当你需要在部署中创建或修改子拓扑时。

技能链接

https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-topology-development/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/nasa/fprime/blob/devel/.github/skills/fprime-topology-development/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请把我的新传感器组件添加到 F Prime 拓扑中,并将其连接到速率组。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会编辑实例定义和拓扑连接,使定义与成员关系保持一致,然后检查拓扑能否成功构建。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Skill: F Prime Topology Development

Covers everything between "a component exists" and "a deployment runs". Most work here extends an existing topology rather than creating one from scratch. Component-level work belongs to fprime-component-development; CMake and build-cache mechanics belong to fprime-cmake-build-system.

Canonical references: building the topology, port/component/topology overview, autocoded functions. Working exemplar: TestDeploymentsProject/Ref/Top/.


1 — Anatomy of a Top/ directory

File Holds
instances.fpp Instance definitions: type, base id, queue/stack/priority/cpu
topology.fpp Topology membership, pattern graphs, connection graphs, packet include
system.fpp system <Name>: <Topology> — the deployment entry point
<Dep>Packets.fppi telemetry packets + omit { ... } list
<Dep>TopologyDefs.hpp TopologyState struct, PingEntries constants
<Dep>Topology.cpp setupTopology / teardownTopology, project-specific configureTopology

Definition and membership are separate: an instance defined in instances.fpp only joins the topology when named by instance <name> inside deployment topology <Name> { ... }. Defined-but-unused instances are legal and are neither constructed nor started.

2 — Instance definitions

  • Passive: instance posixTime: Svc.PosixTime base id 0x10020000
  • Queued: add queue size ...
  • Active: add queue size ..., stack size ..., priority ..., and cpu ... where affinity matters.

Base IDs must be unique and non-overlapping across the whole deployment, including subtopologies. Ref uses 0xDSSCCxxx (deployment / subtopology / component / reserved low 12 bits for the instance's own events, commands, channels) — see the header comment in instances.fpp. Subtopologies offset from a configurable BASE_ID constant.

Thread priorities, stack sizes and affinities are project- and platform-specific; take them from the project's own conventions rather than from a generic default.

3 — Connections

Pattern graphs — one specifier per service wires the whole deployment's command, event, telemetry, text-event, parameter, time, and health ports, each naming the serving instance, e.g. telemetry connections instance CdhCore.tlmSend. Prefer these over hand-wiring service ports.

Direct graphs — named blocks connections <Name> { a.out -> b.in }. Group by subsystem or by instance pair; port arrays are indexed, and indices should come from an FPP enum (e.g. Ports_RateGroups) rather than bare integers.

Matched ports — match <a> with <b> in the component model forces parallel arrays to be connected at identical indices; FPP errors when they are not. See common port patterns.

Rate group scheduling — a timer drives rateGroupDriverComp.CycleIn; each CycleOut[<group>] drives one ActiveRateGroup.CycleIn, whose RateGroupMemberOut[<slot>] ports call each member's schedIn-style port synchronously, in slot order. Rates come from the DividerSet passed to RateGroupDriver::configure in the topology .cpp. See rate groups.

Unconnected output ports assert when invoked. A port that is optional by design can be guarded with isConnected_<port>_OutputPort(portNum) in the C++ implementation.

4 — Phased initialization

setupTopology calls autocoded functions in a fixed order: initComponents → setBaseIds → connectComponents → configComponents → project configureTopology → regCommands → loadParameters → startTasks. Teardown reverses it: stopTasks → freeThreads → tearDownComponents → deinitComponents. Never start tasks or register commands before connections exist.

Per-instance C++ can be attached in FPP instead of the .cpp, via init specifiers on an instance body:

instance $health: Svc.Health base id CdhCoreConfig.BASE_ID + 0x002000 \
  queue size CdhCoreConfig.QueueSizes.$health \
{
  phase Fpp.ToCpp.Phases.configComponents """
  CdhCore::health.setPingEntries(...);
  """
}

Phases are mandatory inside subtopologies; d

常见问题

实例在哪里定义?

它们定义在 instances.fpp 中,而 topology.fpp 决定其中哪些实例加入部署。

它涵盖组件本身的构建吗?

不涵盖。组件设计和代码属于组件开发技能的范围。

有可以参考的示例吗?

有。该技能指向 TestDeploymentsProject 参考拓扑,作为可运行的示例。

详情

作者的原始描述

Develop and evolve an F Prime deployment topology: FPP instance definitions, base IDs, queue/stack/priority, connection graphs, rate group scheduling, phased initialization, subtopologies, and wiring a new or changed component into an existing deployment. Use whenever a task touches a `Top/` directory, `instances.fpp`, `topology.fpp`, a `*TopologyDefs.hpp`, or a subtopology. Keywords: F Prime, topology, deployment, instance, base id, connections, rate group, subtopology, phases, ping entries.

repo: nasa/fprime

热度

GitHub 星标
12k
排名
#11503
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能