UNIX v6とv7の挙動の相違の原因を調べるのは中断して、そもそもバスサイクルのstretchedとnon stretchedがどうやって決定されているのか調べてみました。DCJ11 UG 3-6によると、以下のように定義されています。
A Bus Read cycle will stretch if any of the following conditions exist:
- BS<1:0> does not equal 00 during the first part of the cycle (anything other than a memory reference)
- BS<1:0> does not equal 00 during the second part of the cycle (a cache memory force miss or a cache bypass)
- MAP is asserted during the second part of the cycle (a DMA grant)
- MISS is asserted during the second part of the cycle (a cache miss)
- ABORT is asserted by the DCJ1l during an instruction stream demand read, data stream read, or read-modify-write cycle
Otherwise, a Bus Read cycle will execute in four clock periods.
BS<1:0>信号を用いてstretchedかどうかを判断しているので、BS0, BS1を観測するように変更してデータを取ってみました。
BS<1:0>に着目すると、v6では'10;、v7では'00'なので、v7はnon stretchedサイクルとなり、SCTL信号などがアサートされません。よって、ABORT信号はCONT信号に頼らずにネゲートする必要があります。
non stretchedサイクルの場合にいつABORT信号をネゲートすべきかの記述を探してみたのですが見つかりませんでした。また、現在のPCBではBS信号は接続されていません。そこで、一定時間後にネゲートすることにしました。
「一定時間」と書きましたが、仕様書の以下の二つの規定を考慮して、2 clockとしました。
- non stretchedサイクルの長さは4 clockである
- ABORT信号の最短パルス幅は tABW = 40 + tCLKH (ns)である
リグレッションテストもパスしたので、現在の暫定実装を公開リポジトリに入れました。原理試作コード
私はVerilog HDLなどのHDLに関しては全くの門外漢なので、実装の拙さについては目をつぶってください。


0 件のコメント:
コメントを投稿