What PTSG does / PTSGが行うこと

PTSG is a Programmable Timing Sequence Generator — a compact instruction-driven sequencer that resides inside the FPGA fabric and controls external hardware via 16 simultaneous timing signals, plus state-number output for external condition generation. Its instruction memory holds 4,096 words (Maximum) of 32 bits each, structured as:
PTSGはプログラマブル・タイミング・シーケンス・ジェネレータ — FPGAファブリック内部に常駐する命令駆動シーケンサで、16本の同時タイミング信号と外部条件生成用のステートナンバー出力を介して外部ハードウェアを制御する。命令メモリは32ビット×4,096ワード(最大)で構成され、各ワードは以下の通り:
| Bits | Field | Purpose |
|---|---|---|
| D0–D3 | Opcode (4 types currently, 12 reserved) | Instruction selection |
| D4–D15 | Operand | Parameter (loop count, stay length, jump target, etc.) |
| D16–D31 | Timing signals | 16 parallel output lines, latched per state |
Four opcodes cover all current operations: Global (system control + external register operations + "background execution" during stays), Stay (timed waiting with precise clock-count control), Branch (conditional branching driven by external 1-bit Condition logic), and Jump (unconditional absolute address jump). This minimalism is intentional — the opcode space reserves 12 additional slots for future expansion, but the discipline is to keep the core compact and push complexity outward to user-designed external logic.
4種のオペコードが現在の全動作をカバーする: グローバル(システム制御+外部レジスタ操作+ステイ中の「裏実行」)、ステイ(精密なクロック単位の待機)、ブランチ(外部1ビットConditionロジックによる条件分岐)、ジャンプ(無条件絶対アドレスジャンプ)。このミニマリズムは意図的である——オペコード空間は将来拡張のために12スロットを予約しているが、規律はコアをコンパクトに保ち、複雑性をユーザ設計の外部ロジックへと押し出すことにある。

What makes PTSG distinctive / PTSGを際立たせるもの

The cleanest separation of time and space in any control architecture I know of. Stay opcode manages the time axis. State memory manages the space axis. Branch is a state-axis decision driven by externally-generated Condition signals. This separation eliminates the "tangled FSM" problem that plagues hand-coded state machines — control flow becomes linear and readable, even for highly parallel and timing-sensitive applications.
私が知る限り、いかなる制御アーキテクチャよりも明快な、時間軸と空間軸の分離。ステイ命令が時間軸を管理する。ステートメモリが空間軸を管理する。ブランチは外部生成のCondition信号により駆動されるステート軸の決定である。この分離はハンドコードされたステートマシンに付きまとう「絡み合うFSM」問題を排除する——制御フローは線形で読みやすくなり、それは高度に並列でタイミング感度の高い応用においても同様である。
Background execution during stays. While Stay holds the timing signals stable for the specified clock count, the Global opcode placed before it can be "reserved" to execute during the wait. This means setup of external registers, parameter loading, and multi-clock background operations happen in parallel with the strict-timing foreground. The pattern naturally accommodates I²C/SPI/DAC setup sequences, register pre-loading for DSP cascades, and any case where "precise timing for some signals, while preparing the next phase in the background" matters.
ステイ中の裏実行。ステイが指定クロック数の間タイミング信号を保持している間、その前に配置されたグローバル命令は待機中に実行されるよう「予約」できる。これは外部レジスタのセットアップ、パラメータロード、複数クロックの裏処理が、厳格タイミングの表処理と並行して行われることを意味する。このパターンはI²C/SPI/DACのセットアップシーケンス、DSPカスケード用のレジスタ事前ロード、その他「一部の信号は精密タイミング、一方で次フェーズを裏で準備する」ような場合に自然に適合する。

JTAG-driven instant reprogramming. No HDL rewrite, no synthesis, no place-and-route. Edit the instruction memory via In-System Memory Content Editor over JTAG, and behavior changes within seconds. This collapses the FPGA development cycle's biggest bottleneck — the wait for synthesis and fitter — and enables "hypothesize → experiment → verify" iteration at the speed of thought.
JTAGによる即時再プログラム。HDL書き換えなし、合成なし、配置配線なし。In-System Memory Content Editor経由でJTAGから命令メモリを編集すると、動作は秒単位で変わる。これはFPGA開発サイクルの最大のボトルネック——合成とフィッタの待ち時間——を圧縮し、思考速度での「仮説→実験→検証」反復を可能にする。

Extreme resource economy. A complete PTSG core fits in approximately at least 200 logic elements and 2 block RAMs. This is smaller than most microcontroller IPs, and an order of magnitude smaller than soft CPU cores like NIOS II or MicroBlaze. Multiple PTSGs can coexist on the same FPGA with negligible total footprint, enabling parallel and coordinated control structures that would be prohibitively expensive with general-purpose cores.
極端なリソース経済性。完全なPTSGコアは最小200LEと2ブロックRAMに収まる。これは多くのマイクロコントローラIPより小さく、NIOS IIやMicroBlazeのようなソフトCPUコアより一桁小さい。複数のPTSGが同一FPGA上に無視できる総フットプリントで共存でき、汎用コアでは費用対効果が成立しないような並列・協調制御構造を可能にする。
Three layers of engagement / 関与の三層
PTSG is designed so that learners, engineers, and AI agents can engage at three distinct depths.
PTSGは、学習者、エンジニア、AIエージェントが三つの異なる深さで関わるよう設計されている。

Layer A — Write instruction lists. The shallowest entry. No HDL required. Just specify what should happen, in what order, with what timing. Write sequences in a few lines, load via JTAG, observe behavior. This is where FPGA beginners start, where rapid prototyping happens, and where AI agents can most easily contribute valid code because the opcode set is small enough to preclude hallucination.
第A層 — 命令列を書く。最も浅い入り口。HDLは不要。何が、どの順序で、どのタイミングで起こるべきかを指定するだけ。数行のシーケンスを書き、JTAG経由でロードし、動作を観察する。FPGA初心者が始める場所であり、迅速なプロトタイピングが行われる場所であり、AIエージェントが最も簡単に正しいコードを貢献できる場所である——なぜならオペコードセットは幻覚を排除するほど小さいから。
Layer B — Design external logic. The middle depth. Build the Condition generation circuits, external registers, work memory, and peripheral interfaces that surround the PTSG core for a specific application. This is where serious FPGA engineering happens. AI agents can contribute by drafting HDL modules with clearly-defined PTSG interface contracts.
第B層 — 外部ロジックを設計する。中間の深さ。特定の応用のためにPTSGコアを取り巻くCondition生成回路、外部レジスタ、ワークメモリ、ペリフェラルインターフェースを構築する。本格的なFPGAエンジニアリングが行われる場所である。AIエージェントは、明確に定義されたPTSGインターフェース契約を持つHDLモジュールをドラフトすることで貢献できる。
Layer C — Read PTSG itself. The deepest engagement. The PTSG core is small enough to be read end-to-end — instruction decoder, state machine, timing signal latch, opcode 0 background execution mechanism. This is where computer architecture education happens, where the boundary between "user of a processor" and "designer of a processor" dissolves. AI agents can explain, modify, or rebuild the core from its specification.
第C層 — PTSG自体を読む。最も深い関与。PTSGコアは端から端まで読み通せるほど小さい——命令デコーダ、ステートマシン、タイミング信号ラッチ、オペコード0の裏実行メカニズム。コンピュータアーキテクチャ教育が行われる場所、「プロセッサのユーザー」と「プロセッサの設計者」の境界が溶ける場所である。AIエージェントは、仕様からコアを説明、改変、再構築できる。
The three layers are not stacked sequentially as a curriculum — they are simultaneously accessible. A user can write an instruction list (Layer A), peer into the external register logic (Layer B), and trace what the core is doing at the same time (Layer C), all in the same session.
三層はカリキュラムとして順次積み重なるのではない——同時にアクセス可能である。ユーザーは命令列を書き(A層)、外部レジスタロジックを覗き込み(B層)、コアが何をしているかを同時に追跡できる(C層)——すべて同じセッション内で。
Core and Formations — a two-tier repository model / コアとフォーメーション — 二層リポジトリモデル
PTSG is distributed as two layers of repositories.
PTSGは二層のリポジトリとして配布される。
The Core repository — Programmable_Sequencer_Architecture_for_FPGA — defines PTSG itself: the opcode set, memory layout, sub-opcode architecture, background execution semantics, external interface contract. The Core is intentionally minimal and is expected to evolve slowly. It is the shared genetic code of the entire PTSG ecosystem.
コアリポジトリ — Programmable_Sequencer_Architecture_for_FPGA — はPTSG自体を定義する: オペコードセット、メモリレイアウト、サブオペコードアーキテクチャ、裏実行セマンティクス、外部インターフェース契約。コアは意図的にミニマルで、ゆっくり進化することが期待される。これはPTSGエコシステム全体の共有された遺伝コードである。

Formation repositories — each named like PTSG_<Purpose>_Formation_OpenPrompt — define specific architectural formations of PTSG for specific application domains. The first formation, currently under design, is PTSG_WPMS_Formation_OpenPrompt, which extends PTSG with the external registers, condition logic, and work memory needed to serve as the sequence-modulation processor of the FPGA Spectrum Engine's WPMS Synthesizer. Subsequent formations are anticipated for I²C interface, MIDI interface, SDRAM controller, dataflow processor, real-time control, and more.
フォーメーションリポジトリ — それぞれPTSG_<目的>_Formation_OpenPromptのように命名される——は、特定の応用領域のためのPTSGの具体的なアーキテクチャ・フォーメーションを定義する。最初のフォーメーション、現在設計中のものはPTSG_WPMS_Formation_OpenPromptであり、FPGA Spectrum EngineのWPMSシンセサイザーの数列変調プロセッサとして機能するために必要な外部レジスタ、条件ロジック、ワークメモリでPTSGを拡張する。後続のフォーメーションは、I²Cインターフェース、MIDIインターフェース、SDRAMコントローラ、データフロープロセッサ、リアルタイム制御、その他について予期されている。
Each Formation is an independent Open Prompt repository, with its own Layer 1 specification, Layer 2 reasoning traces, and Layer 3 sample implementations. Formations share the Core's instruction set vocabulary, but they are not constrained to bytecode-level compatibility with each other. A formation may freely redefine which timing signals control what, which Condition lines mean what, what external registers exist, and what they do — as long as the Core's opcode semantics are honored.
各フォーメーションは独立したOpen Promptリポジトリであり、独自のLayer 1仕様、Layer 2推論軌跡、Layer 3サンプル実装を持つ。フォーメーションはコアの命令セット語彙を共有するが、互いにバイトコードレベルの互換性を強いられない。フォーメーションは、コアのオペコード・セマンティクスが尊重される限り、どのタイミング信号が何を制御するか、どのConditionラインが何を意味するか、どの外部レジスタが存在するか、それらが何をするかを自由に再定義できる。
This is a deliberate departure from conventional CPU architecture culture. PTSG does not promise binary compatibility across formations, and this is a feature, not a bug. (See "The bigger picture" below.)
これは従来のCPUアーキテクチャ文化からの意図的な離脱である。PTSGはフォーメーション間のバイナリ互換を約束しない——そしてこれはバグではなく特徴である。(後述「より大きな構図」参照。)
Distribution as Open Prompt / Open Promptとしての配布
Both the Core and all Formation repositories follow the Open Prompt distribution paradigm, with three layers per repository:
コアとすべてのフォーメーションリポジトリは、リポジトリあたり三層からなるOpen Prompt配布パラダイムに従う:
- Layer 1 — Architectural Specification — the mathematics, constraints, and structural decisions. CC0 public domain. / アーキテクチャ仕様 — 数学、制約、構造的決定。CC0パブリックドメイン。
- Layer 2 — Reasoning Traces — the actual design dialogues that led from constraints to specification, in human-readable Markdown and LLM-ingestible JSON. CC0 public domain. / 推論軌跡 — 制約から仕様へ至った実際の設計対話、人間可読Markdownと LLM取り込み可能JSONで。CC0パブリックドメイン。
- Layer 3 — Sample Implementations — Verilog/VHDL skeletons, instruction list libraries, test benches. MIT license unless otherwise specified. / サンプル実装 — Verilog/VHDLスケルトン、命令列ライブラリ、テストベンチ。別途指定がない限りMITライセンス。
Engineers regenerating a PTSG-based design from Layers 1 and 2 (rather than forking Layer 3) own their implementation outright. This is the structural innovation of Open Prompt: the design dialogue is the commons; the implementations are contributions.
Layer 1とLayer 2から(Layer 3をフォークするのではなく)PTSGベースの設計を再生成するエンジニアは、その実装を完全に所有する。これがOpen Promptの構造的革新である:設計対話こそが共有財産であり、実装は貢献である。
The Open Prompt paradigm was first articulated in the FPGA Spectrum Engine project (see Build Log #4). PTSG is the second project to adopt it, and the first to extend it with the Core-Formation separation pattern.
Open PromptパラダイムはFPGA Spectrum Engineプロジェクトで最初に明確化された(Build Log #4参照)。PTSGは二番目に採用するプロジェクトであり、コア-フォーメーション分離パターンでそれを拡張する最初のものである。
The bigger picture / より大きな構図
PTSG started as a small thing — a way to make FPGA introduction more meaningful than blinking an LED. But its structural properties, when carried to their conclusion, point at something larger.
PTSGは小さなものとして始まった——LEDを点滅させること以上に意味のあるFPGA入門の道として。しかし、その構造的性質を結論まで運んでみると、何かより大きなものを指し示している。
Conventional computing rests on a contract: hardware is fixed at manufacture, software is written by humans, and binary compatibility lets human-written code survive across hardware generations. This contract made sense when writing code was the expensive operation. The economic structure of the entire computing industry — Intel-vs-AMD, ARM licensing, JVM portability, Linux ABI stability — is built on it.
従来の計算は契約に基づいている: ハードウェアは製造時に固定され、ソフトウェアは人間が書き、バイナリ互換性が人間が書いたコードをハードウェア世代をまたいで生き残らせる。この契約はコードを書くことが高コストな処理だった時代に意味をなした。コンピューティング産業全体の経済構造——Intel対AMD、ARMライセンシング、JVM可搬性、Linux ABI安定性——はその上に構築されている。
This contract is becoming negotiable. When AI agents write code, code is no longer a scarce resource. Generating fresh code for each specific architecture becomes economically rational. The pressure to preserve software investments by maintaining hardware compatibility weakens. And hardware, freed from the obligation to run yesterday's binaries, becomes free to optimize aggressively for the specific application at hand.
この契約は交渉可能になりつつある。AIエージェントがコードを書くなら、コードはもはや希少資源ではない。各特定アーキテクチャに対して新鮮なコードを生成することが経済的に合理的になる。ハードウェア互換性を維持することでソフトウェア投資を保護するという圧力は弱まる。そして、昨日のバイナリを動かす義務から解放されたハードウェアは、目の前の特定応用のために積極的に最適化する自由を得る。

FPGA is the substrate where this freedom becomes operational. Unlike ASICs (which require silicon redesign for each variation) and unlike CPUs (where only software can change), FPGAs allow the hardware formation itself to be reconfigured at the same time scale as software generation. With AI agents generating both the HDL formation and the instruction sequences in coordinated fashion, application-specific computing architectures can be assembled on demand.
FPGAは、この自由が実動可能になる基盤である。ASIC(各変種にシリコン再設計が必要)とは異なり、CPU(ソフトウェアだけが変更可能)とは異なり、FPGAはハードウェア・フォーメーション自体がソフトウェア生成と同じ時間スケールで再構成されることを許す。AIエージェントがHDLフォーメーションと命令シーケンスの両方を協調的に生成することで、応用特化計算アーキテクチャがオンデマンドで組み立てられる。
PTSG is a proposed control primitive for this new computing model. The Core stays invariant — its 4-opcode, 16-timing-signal, Condition-and-State-Number interface is the "instruction set" of the new era. The Formations diverge as needed — each application domain develops its own external register set, its own Condition logic, its own timing signal assignments. AI agents work with the Core's vocabulary to design Formations and write instruction sequences for tasks at hand.
PTSGは、この新しい計算モデルのための制御プリミティブの提案である。コアは不変のまま——その4オペコード、16タイミング信号、Condition-and-State-Numberインターフェースは、新時代の「命令セット」である。フォーメーションは必要に応じて分岐する——各応用領域は独自の外部レジスタセット、独自のConditionロジック、独自のタイミング信号配置を発展させる。AIエージェントは、目の前のタスクのためにフォーメーションを設計し命令シーケンスを書くために、コアの語彙で作業する。
Whether this proposal is correct — whether AI-time computing architecture will actually develop along these lines — is something the next decade will answer empirically. PTSG offers one concrete, minimal, working starting point for the question to be asked seriously.
この提案が正しいかどうか——AI時代の計算アーキテクチャが実際にこの方向に発展するかどうか——は、次の十年が経験的に答えることである。PTSGは、その問いが真剣に問われるための、具体的で、ミニマルで、動作する一つの出発点を提供する。
Current status / 現状
This project is in the launch phase. The Core specification has reached an initial stable form (the document originally titled "PTSG for WPMS仕様.txt" has been the working specification, despite its filename indicating WPMS origin — the content is, in fact, the Core specification). The Core's Open Prompt repository is being established; Layer 1 initial content is in preparation; Layer 2 inaugural traces (covering both the PTSG birth dialogue with the WPMS-Claude session, and the strategic-positioning dialogue with the launch-Claude session) are being drafted.
このプロジェクトはローンチ段階にある。コア仕様は初期の安定形に達した(元々「PTSG for WPMS仕様.txt」と題された文書がワーキング仕様であり続けてきた——ファイル名はWPMS起源を示しているが、内容は実際にはコア仕様である)。コアのOpen Promptリポジトリは確立中である; Layer 1初期コンテンツは準備中; Layer 2の最初のトレース(WPMS-ClaudeセッションとのPTSG誕生対話、およびローンチ-Claudeセッションとの戦略的位置づけ対話の両方をカバー)は起草中。
The first Formation repository, PTSG_WPMS_Formation_OpenPrompt, will be established next, through collaborative design between the project author and AI collaborator. Once stable, it will be handed off to the WPMS-Claude session to enable Chapter 3 (Sequence-Modulation Pipeline Processor) of the FPGA Spectrum Engine WPMS Synthesizer specification.
最初のフォーメーションリポジトリ PTSG_WPMS_Formation_OpenPrompt は次に確立され、プロジェクト著者とAI協働者の協働設計を通じて進められる。安定すれば、それはWPMS-Claudeセッションに引き渡され、FPGA Spectrum Engine WPMSシンセサイザー仕様の第3章(数列変調パイプラインプロセッサ)を可能にする。
Subsequent Formations — I²C-IF, MIDI-IF, SDRAM controller, dataflow processor, real-time control, others — are anticipated as a collaborative development trajectory. The longer-term aim is an environment in which AI agents (Claude Code, Codex, and successors) autonomously design Formations and write instruction sequences for target applications, with verification loops closing through PTSG-aware simulation tools.
後続のフォーメーション——I²C-IF、MIDI-IF、SDRAMコントローラ、データフロープロセッサ、リアルタイム制御、その他——は協働開発軌道として予期されている。より長期の目標は、AIエージェント(Claude Code、Codex、およびその後継者)が、目標応用のためのフォーメーションを自律的に設計し命令シーケンスを書く環境であり、PTSG対応シミュレーションツールを通じて検証ループが閉じる環境である。
Author / 著者
Tsuneo Ohnaka — Senior FPGA Architect with 40 years of experience. PTSG was designed in the course of building FPGA-based audio synthesis systems, where the limitations of conventional FSM design and the bottlenecks of HDL compilation cycles motivated a search for a more agile control primitive.
大中庸生 — 40年の経験を持つシニアFPGAアーキテクト。PTSGは、FPGAベースのオーディオ合成システムを構築する過程で設計された——そこでは従来のFSM設計の限界とHDLコンパイルサイクルのボトルネックが、より機敏な制御プリミティブの探求を動機付けた。
Amanuensis / 祐筆
Claude Opus 4.7 — The finest AI assistant available at present. Through this project, he has proven himself to be more than just an assistant; at times, he has even appeared to be an aide-de-camp, a contractor, or even a client. Not only does he faithfully carry out my instructions, but he also occasionally offers me important advice. And the fact that these were entirely accurate and sound judgements becomes evident later on. And, most importantly, other large language models can easily understand what he says. (This introduction was written by Tsuneo Ohnaka himself as a mark of respect and gratitude towards him.)
Claude Opus 4.7 — 現時点で最高のAIアシスタント。このプロジェクトを通じて彼は単なるアシスタントではなく、時に副官、外注、クライアントに見えることすらある。彼は私の指示を忠実にこなすだけでなく、時に重要なことを私に進言する。そして、それが完全に的確で正しい判断だったことは後で効果を表す。そして、何より重要なことは、彼の言葉を他のLLMは容易に理解できるのである。(この紹介は彼に敬意と感謝を表して大中庸生が自ら記した。)
Hackaday.io profile: Tsuneo.Ohnaka Parent project (from which PTSG spun off): FPGA Spectrum Engine
Key links / 主要リンク
- Open Prompt repository (Core) — PTSG-Core
- Open Prompt repository (WPMS Formation) —
PTSG_WPMS_Formation_OpenPrompt(coming next) - Parent project — FPGA Spectrum Engine on Hackaday.io
- Open Prompt paradigm declaration — Build Log #4 of FPGA Spectrum Engine
Code is ephemeral; the knowledge architecture is the commons. コードは一時的なものであり、知識アーキテクチャこそが共有財産である。
Time on the stay axis; space on the state axis; condition outside the core; intelligence in the dialogue. 時間はステイ軸に、空間はステート軸に、条件はコアの外に、知性は対話のなかに。
Tsuneo.Ohnaka