Repository navigation
[fpga] feat: 支持 Toy/Linux Flash 固化与断电自主启动 - #7
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能与两种使用场景
原来的 JTAG 配置和串口加载流程中,FPGA SRAM 与 DDR 内容只在持续供电时保留;断电后需要重新下载位流和软件。本 PR 增加可选的板载 Flash 固化流程,保存 FPGA 配置和原 OpenSBI/Linux 启动映像,重新上电后自主启动。CPU、Sv39 虚拟内存、FPU、Gemmini 8×8 和原 Linux 软件均保留。
本 PR 接续已合并的 #6。两种流程各有场景,并非互相替代:
上次“不断电流程”指已下载状态依赖持续供电,并不是禁止关机。Flash 中保存的是启动映像;运行中的 DDR 内容及 initramfs 文件改动仍不持久化。Flash 目标通过
SW0=1后按BTN0保留串口恢复入口;正常自主启动使用JP1短接、SW0=0。实现与复现
TLROM;其他核心逻辑与原 Linux payload 保持不变。0x000000开始,软件区从0x400000开始;原 17,409,032 字节软件压缩为 3,636,031 字节。实际 Flash 为 S25FL128S(JEDEC012018)。backup_flash.tcl、make_flash_image.tcl、program_flash.tcl和对应 host 入口。烧写前完整备份 16 MiB,随后擦除/烧写/验证,再从 Flash 重新配置。工具保留一小时超时。入口文档:Flash 固化与启动指南;证据:实现与实物验证档案。此次已有英文文档保留,后续新增文档使用中文。
核验结果
xc7a100tcsg324-1,25 MHz 核心,Vivado 2024.1 整板布局布线完成:53,944 LUT、15,618/15,850 Slice、35,645 FF、31 BRAM、117 DSP;WNS/WHS 为 +1.276/+0.015 ns,布线错误 0,严重 CDC/DRC 检查通过,构建 1,391.1 秒。git diff --check通过;公开文件 Gitleaks 8.30.1 扫描未发现泄漏。首次观察器对 CRCRLF 结束符的识别已修正;原始日志和中断记录保留,后续冷启动观察器正常完成。构建后 XDC 只增加非 Flash 配置下缺失同步器的查询保护;Flash 模式实际约束不变,精确构建输入已归档。
当前边界
只余 232 个 Slice 位置,仍是工程验证目标。PCB revision 未确认,Gemmini 算子实物回归、完整 DDR 扫描、长期稳定性及功耗测试尚未完成;本 PR 不将首次启动成功等同于完成全部硬件验收。