Build Log #9 — The Doors a Free-Running Clock Opened
ビルドログ #9 — フリーランのクロックが開いた扉
The coda I promised in #8. Committing to a free-running prescaler did more than kill the jitter — it opened a couple of doors I did not see when I made the call. / #8 で約束したコーダ。フリーランのプリスケーラに賭けたことは、ジッタを消す以上のことをした——決断した時には見えていなかった扉を、いくつか開いたのだ。
One decision, several consequences / 一つの決断、いくつもの帰結
In #8 I closed Hook A and said the prescaler had been right all along. The deeper move behind that
was a decision I had been treating, at first, almost apologetically: to let the prescaler run free —
reset only by the global hardware reset, never re-aligned, never touched by the program. For a while
I thought of that as something to compensate for. This log is about the moment it flipped: the
free-running prescaler is not a compromise to manage but a foundation to build on. Once I stopped
apologizing for it and committed to it, two doors opened that I genuinely had not seen.
#8 で Hook A を閉じ、プリスケーラはずっと正しかったと書いた。その背後にあったより深い一手は、私が最初はほとんど詫びるように扱っていた決断だった: プリスケーラを自由に走らせる——グローバルハードウェアリセットでのみリセットされ、再整列されず、プログラムからは決して触れられない。しばらく私はそれを「埋め合わせるべきもの」と考えていた。本ログは、それが反転した瞬間についてである: フリーランのプリスケーラは、管理すべき妥協ではなく、その上に築くべき土台だった。詫びるのをやめてそれに賭けた途端、本当に見えていなかった扉が二つ開いた。
The common key to both doors is the same property that made the phase-lock structural: if the tick's
phase never matters — because the hierarchy keeps itself in register — then the tick is free to be
treated in ways a phase-sensitive design could never allow.
両方の扉に共通する鍵は、位相ロックを構造的にしたのと同じ性質である: ティックの位相が決して問題にならない——ヒエラルキーが自身をレジスタ済みに保つから——なら、ティックは、位相に敏感な設計が決して許せない仕方で扱える自由を得る。

Door one — a faster clock ceiling (Fmax) / 扉その一 — より高いクロック上限(Fmax)
The prescaler is a sizeable counter, and the tick is the result of comparing that counter against a
target. In a phase-sensitive design you must use that comparison the instant it is valid, which means
its propagation delay — counter plus comparator — lands directly in the path to everything downstream:
state advance, the stay counter, the window logic. That long combinational path is exactly the kind of
thing that sets your maximum clock frequency.
プリスケーラはそれなりに大きなカウンタであり、ティックはそのカウンタを目標値と比較した結果である。位相に敏感な設計では、その比較を有効になった瞬間に使わねばならず、つまりその伝搬遅延——カウンタ+コンパレータ——が下流のすべて(状態遷移・ステイカウンタ・ウィンドウロジック)への経路に直接乗る。その長い組合せ経路こそ、最大クロック周波数を決めてしまう類のものである。

But if the tick's phase does not matter, I am free to register the comparator's output — to clock
it once before anyone uses it. That one register cuts the counter-plus-comparator delay out of the
downstream path: the heavy combinational work now ends at a flip-flop, and what travels onward is a
clean, already-settled signal. The price would normally be a one-clock shift in when the tick is
seen — and in a phase-sensitive world that shift is unacceptable. Here it costs nothing, because the
structural phase-lock already made the tick's exact timing immaterial. So the optimization is free:
accepting the free-running prescaler is what lets me register the tick, and registering the tick is
what raises Fmax.
しかしティックの位相が問題にならないなら、私はコンパレータの出力をレジスタで叩く自由を得る——誰かが使う前に一度クロックで確定させるのだ。その一段のレジスタが、カウンタ+コンパレータの遅延を下流経路から切り離す: 重い組合せ仕事はフリップフロップで終わり、その先へ進むのは清潔な、既に静定した信号になる。通常この代償は、ティックがいつ見えるかの1クロックぶんのずれだろう——そして位相に敏感な世界では、そのずれは容認できない。ここでは何の代償もない、構造的位相ロックが既にティックの正確なタイミングを無意味にしているからだ。ゆえに最適化はタダで手に入る:
フリーランのプリスケーラを受容することが、ティックをレジスタで叩くことを許し、ティックを叩くことが Fmax を上げる。
A design I had framed as "tolerating" a free-running counter turned out to hand me a higher clock
ceiling as a gift.
フリーランのカウンタを「我慢する」と枠付けていた設計が、より高いクロック上限を贈り物として手渡してくれた。
Door two — many chips, one heartbeat (master/slave synchronization) / 扉その二 — 多数のチップ、一つの鼓動(マスター/スレーブ同期)
The second door is bigger. If a tick can be registered cleanly on a clock, it can also be sent out
of the chip. And that makes it possible to run several PTSGs as one.
二つ目の扉はより大きい。ティックがクロックで清潔に叩けるなら、それはチップの外へ送り出すこともできる。そしてそれが、複数の PTSG を一つとして走らせることを可能にする。

Here is the part that took me a moment to get right. To synchronize many chips, you do not send the
registered tick — that has already been clocked once on the master, and by the time it crosses the
wire and is clocked again on each slave, it has drifted two stages out of step. Instead you export the
raw tick: the comparator output before the master registers it. You give that one raw signal to
every chip — the master included — and each one registers it on its own clock. Now every PTSG takes
exactly the same single step at the same boundary: master and slaves clock the same raw tick, so they
all fall into line. One heartbeat, many bodies.
ここが、正しく掴むのに少し時間がかかった部分だ。多数のチップを同期させるには、叩いた後のティックを送ってはならない——それはマスター側で既に一度クロックされており、配線を渡って各スレーブで再び叩かれる頃には、二段ぶん歩調がずれてしまう。代わりに生ティックを外部化する: マスターがそれを叩く前のコンパレータ出力だ。その一本の生信号をすべてのチップ——マスターも含めて——に与え、各自が自分のクロックでそれを叩く。すると、あらゆる PTSG が同じ境界で、まったく同じ一段を踏む: マスターもスレーブも同じ生ティックを叩くから、全員が足並みをそろえる。
一つの鼓動、多数の身体。

For this to hold, a slave must have no way to disturb the time-base it is following. It must not be
able to reset, re-align, or perturb the prescaler from its own program — otherwise one slave's
instruction stream could break the formation. This is precisely why, back in the spec work, the
program-issued Reset was made unable to touch the prescaler: that rule was not a local tidiness, it was
this synchronization demanding it from above. The free-running prescaler is the thing that is being
shared; nothing local is allowed to own it.
これが成り立つには、スレーブは、自分が従っている時間基準を乱す手段を一切持ってはならない。自分のプログラムからプリスケーラをリセット・再整列・擾乱できてはならない——さもなければ、あるスレーブの命令ストリームが隊形を崩し得る。
これこそ、仕様作業で、プログラム発行の Reset がプリスケーラに触れられないようにした理由である: あの規則は局所的な几帳面さではなく、この同期が上から要求したものだった。フリーランのプリスケーラが、共有されているものである;局所的な何も、それを所有することは許されない。

One more, from the same root / 同じ根から、もう一つ
That last point opens a small third door, which I will only crack here because it belongs as much to a
different story — the one about trailing edges and their exceptions. Once the prescaler is something no
program may touch, the Reset command itself gets a kind of freedom: it can be run immediately in the
foreground, or held back, or queued, because the job of staying aligned no longer falls on Reset — it
is handled elsewhere. Reset stops having to apologize for its timing, for the same underlying reason
the prescaler did. It is the same root — commit to a free-running time-base — sending up a third shoot.
I will tell that part properly another time.
その最後の点が、小さな三つ目の扉を開く。ここでは少しだけ開けておく、なぜならそれは別の物語——後縁と、その例外についての物語——にも同じくらい属するからだ。プリスケーラがどのプログラムも触れられないものになった途端、Resetコマンド自身もある種の自由を得る: 前景で即座に走らせることも、留め置くことも、キューに入れることもできる、整列を保つ仕事がもはや Reset に落ちてこないからだ——それは別の場所で担われる。Reset は、プリスケーラがそうだったのと同じ根底の理由で、自分のタイミングを詫びる必要がなくなる。同じ根——フリーランの時間基準に賭ける——が、三本目の芽を伸ばしている。その部分は、また別の機会にきちんと話そう。

What I learned about deciding / 決断について学んだこと
The lesson I am taking from this is not really about prescalers. It is that a property you accept
fully — instead of tolerating it, working around it, apologizing for it — can turn from a liability
into a source of capability. I spent a while treating the free-running counter as a thing to be managed.
The moment I committed to it as a principle, it stopped costing me and started paying me: a cleaner
critical path, a higher Fmax, and a way to make many chips keep time as one. The jitter was never the
real story. The real story was what became possible once I trusted the clock to run free.
私がここから受け取る教訓は、本当はプリスケーラについてではない。それは、ある性質を——我慢し、回避し、詫びるのではなく——完全に受容すると、それが負債から能力の源へと変わり得る、ということだ。私はしばらく、フリーランのカウンタを管理すべきものとして扱っていた。それを原則として受容した瞬間、それは私にコストを課すのをやめ、私に報い始めた:
より清潔なクリティカルパス、より高い Fmax、そして多数のチップを一つとして時を刻ませる方法。ジッタは決して本当の
物語ではなかった。本当の物語は、クロックが自由に走ることを信じた途端に可能になったものだった。
There is still one large thing I want to do before I hand the core to an implementing agent. That is
the next entry.
コアを実装エージェントに手渡す前に、まだやりたい大きな仕事が一つある。それが次の項である。
Architecture and decisions: Tsuneo Ohnaka. Drafting and consistency monitoring by Claude (Anthropic),
serving as amanuensis. The reasoning behind the no-prescaler-reset rule and the trailing-edge framing
is archived as CC0 Layer 2 traces in the PTSG-Core repository. / アーキテクチャと決定: 大中庸生。起草と
整合性監視は祐筆として Claude (Anthropic)。非プリスケーラ・リセット規則と後縁主義の枠組みの背後にある推論は、
PTSG-Core リポジトリに CC0 の Layer 2 トレースとして保管されている。
Tsuneo.Ohnaka
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.