Currently, csr.Builder works around this by casting array indices to strings calling MemoryMap.add_resource().
Repro:
from amaranth import *
from amaranth_soc import csr
class FooRegister(csr.Register, access="r"):
a: csr.Field(csr.action.R, unsigned(8))
regs = csr.Builder(addr_width=1, data_width=8)
for n in range(2):
with regs.Index(n):
regs.add("foo", FooRegister())
for reg, reg_name, reg_range in regs.as_memory_map().resources():
print(reg_name)
Currently,
csr.Builder
works around this by casting array indices to strings callingMemoryMap.add_resource()
.Repro:
Current output:
Expected output: