# 在 FPGA 上运行 CPython 字节码

Original title: Running CPython Bytecode on an FPGA

> Hacker News story 50688534 · language: zh · submitted 2026-11-29
> Web version: https://zeli.app/zh/story/50688534
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 19 · by [llazzaro](<https://news.ycombinator.com/user?id=llazzaro>) · 💬 7
[original](<https://www.lazzaro.com.ar/post/2026-11-29-running-cpython-bytecode-on-an-fpga/>) · [HN discussion](<https://news.ycombinator.com/item?id=50688534>)

## Summary

我开源了 FPGA Python 项目，这是一个实验性处理器，能在 FPGA 逻辑中直接执行一小部分 Python 字节码。主机使用 CPython 3.14.4 编译函数，将字节码原样上传至 FPGA，由硬件直接执行指令并返回结果，无需在 FPGA 内运行软 CPU 或 CPython 解释器。目前该实现支持整数加法、局部变量读取及有限的函数调用，已通过了 88 项测试和物理硬件验证。虽然距离完整的 Python 运行时还有很长的路要走，但这证明了在硬件层面直接复用 CPython 指令集是可行的。

## Key quote

> 将完整的 Python 支持视为缺失指令的列表是诱人的，但像 BINARY_OP 这样的操作码背后隐藏着庞大的运行时机制。

## HN discussion (7 comments)

### [danudey](<https://news.ycombinator.com/item?id=50720979>)

> 我大学的一位朋友（大概是 2003 年左右）曾做过一个类似的项目；他们当时正在编程让 FPGA 原生运行 Java 字节码，想看看是否可能/可行实现 Java 的“原生”运行。真不知道那个项目后来怎么样了。

### [nobodywasishere](<https://news.ycombinator.com/item?id=50719645>)

> 相关资源：https://amaranth-lang.org/docs/amaranth/latest/

### [Neywiny](<https://news.ycombinator.com/item?id=50718388>)

> 开发者们都在怀念 Jazelle。我实在看不出这有什么实际用途，不过我敢肯定这是个很棒的学习练习。

---

## Cite

- Page: https://zeli.app/zh/story/50688534
- Date: 2026-11-29
- Source: lazzaro.com.ar (https://www.lazzaro.com.ar/post/2026-11-29-running-cpython-bytecode-on-an-fpga/)
- Hacker News: https://news.ycombinator.com/item?id=50688534

## Other languages

- en: https://zeli.app/story/50688534 · markdown: https://zeli.app/story/50688534.md
- ja: https://zeli.app/ja/story/50688534 · markdown: https://zeli.app/ja/story/50688534.md
- ko: https://zeli.app/ko/story/50688534 · markdown: https://zeli.app/ko/story/50688534.md
- de: https://zeli.app/de/story/50688534 · markdown: https://zeli.app/de/story/50688534.md
- es: https://zeli.app/es/story/50688534 · markdown: https://zeli.app/es/story/50688534.md
- ru: https://zeli.app/ru/story/50688534 · markdown: https://zeli.app/ru/story/50688534.md
