Skip to content

Commit 4756a4d

Browse files
committed
doc: Collector IO
1 parent c19e61a commit 4756a4d

2 files changed

Lines changed: 35 additions & 9 deletions

File tree

docs/issue.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,30 @@ Operand collector consists of the following components:
378378
The (2) condition may not always hold when e.g. instruction mix is skewed
379379
and a single FU-type collector bank runs out of space.
380380

381+
TODO: elaborate why a simple duplicate-bank regfile design requires collector
382+
logic.
383+
384+
### IO
385+
386+
The collector provides latency-insensitive interface for operand read/writes,
387+
so that the RS can make issue-scheduling decisions in a timing-decoupled way.
388+
389+
See [src/main/scala/radiance/muon/Collector.scala] for the implementation.
390+
391+
* `readReq`: Requests the collector to initiate an operand read and expose it
392+
to the `readData` port.
393+
* `readResp`: Indicates the requested operand will be available at the
394+
collector bank port (`readData`) *at the next cycle*. RS uses this to
395+
arbitrate among eligible, all-collected instructions and expose it to the issue
396+
port at the next cycle, lining up with the collector data.
397+
* `writeReq`/`writeResp`: Same as `readReq`/`readResp` but for writes.
398+
* `writeReq`/`writeResp`: Same as `readReq`/`readResp` but for writes. Normally
399+
the response has a 1-cycle latency because writes don't cause bank conflicts.
400+
* `readData`: Port that serves the operand data to EX. Its member `req` tells
401+
to the collector which bank entry to be read, and `resp` exposes the full
402+
register vector-data stored at that entry to the port. `resp` is
403+
combinational-read.
404+
381405
### Collector banking strategies
382406

383407
#### Source-register-banked collectors

src/main/scala/radiance/muon/ReservationStation.scala

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ class ReservationStation(implicit p: Parameters) extends CoreModule()(p) {
6767
}
6868
}
6969
def collFiredTable(row: Int): Vec[Bool] = collFiredTable(row.U)
70-
// where the operand lives in the collector banks
70+
// where the operand lives in the collector banks. RS uses this to allocate a
71+
// spot in the collector & feed the correct data to EX upon issue.
7172
val collPtrTable = Mem(numEntries, Vec(Isa.maxNumRegs, UInt(collEntryWidth.W)))
72-
val collAllReadyTable = Wire(Vec(numEntries, Bool()))
73+
val collNeedAllReadyTable = Wire(Vec(numEntries, Bool()))
7374
// mostly for debugging
7475
val eligibleTable = WireDefault(VecInit.fill(numEntries)(false.B))
7576
dontTouch(eligibleTable)
@@ -128,10 +129,10 @@ class ReservationStation(implicit p: Parameters) extends CoreModule()(p) {
128129
// select a single entry for collection
129130
// TODO: @perf: currently a simple priority encoder; might introduce fairness
130131
// problem
131-
val collBitvec = WireDefault(VecInit(needCollects.map(_._1)))
132-
collAllReadyTable := VecInit(needCollects.map(_._3))
133-
dontTouch(collBitvec)
134-
dontTouch(collAllReadyTable)
132+
val collNeedTable = WireDefault(VecInit(needCollects.map(_._1)))
133+
collNeedAllReadyTable := VecInit(needCollects.map(_._3))
134+
dontTouch(collNeedTable)
135+
dontTouch(collNeedAllReadyTable)
135136

136137
// don't allow early-firing collector requests for partial operands of an
137138
// instruction. Partial collects may result in a deadlock with insufficient
@@ -148,9 +149,9 @@ class ReservationStation(implicit p: Parameters) extends CoreModule()(p) {
148149
// that, we need some kind of bookkeeping in the collector for the
149150
// partial-collect uops, which is what the collector banks are meant for,
150151
// which are expensive.
151-
val allReadyExists = collAllReadyTable.reduce(_ || _)
152-
val firstAllReadyRow = PriorityEncoder(collAllReadyTable)
153-
val firstNeedRow = PriorityEncoder(collBitvec)
152+
val allReadyExists = collNeedAllReadyTable.reduce(_ || _)
153+
val firstAllReadyRow = PriorityEncoder(collNeedAllReadyTable)
154+
val firstNeedRow = PriorityEncoder(collNeedTable)
154155
val collRow = Mux(!allowPartialCollect.B || allReadyExists,
155156
firstAllReadyRow, firstNeedRow)
156157
dontTouch(collRow)
@@ -428,6 +429,7 @@ class ReservationStation(implicit p: Parameters) extends CoreModule()(p) {
428429
cf"hasOp:${hasOpTable(i)(0)}${hasOpTable(i)(1)}${hasOpTable(i)(2)} | " +
429430
cf"opReady:${opReadyTable(i)(0)}${opReadyTable(i)(1)}${opReadyTable(i)(2)} | " +
430431
cf"busy:${busyTable(i)(0)}${busyTable(i)(1)}${busyTable(i)(2)} | " +
432+
cf"collNeed:${collNeedAllReadyTable(i)} | " +
431433
cf"collFired:${collFiredTable(i)(0)}${collFiredTable(i)(1)}${collFiredTable(i)(2)} | " +
432434
cf"eligible:${eligibleTable(i)}" +
433435
cf"\n")

0 commit comments

Comments
 (0)