Add assert to check that chip id pin is wide enough

This commit is contained in:
Ella Schwarz
2024-01-14 14:47:12 -08:00
parent 67faf0c3e3
commit 47322af3c0

View File

@@ -252,9 +252,9 @@ class WithSimTSIOverSerialTL extends HarnessBinder({
} }
}) })
//TODO: Set with chipId argument to harness binder, hardcoding is temporary hack
class WithDriveChipIdPin extends HarnessBinder({ class WithDriveChipIdPin extends HarnessBinder({
case (th: HasHarnessInstantiators, port: ChipIdPort, chipId: Int) => { case (th: HasHarnessInstantiators, port: ChipIdPort, chipId: Int) => {
assert(chipId < math.pow(2, port.io.getWidth), "ID Pin is not wide enough")
port.io := chipId.U port.io := chipId.U
} }
}) })