litex icon indicating copy to clipboard operation
litex copied to clipboard

SoCBusHandler.add_peripheral does not work

Open jwise opened this issue 1 year ago • 1 comments

Attempting to use SoCBusHandler.add_peripheral, which seems to be a more pleasant name to access the same interface as SoCBusHandler.add_slave, chokes in the following way:

Traceback (most recent call last):
  File "/storage/home/joshua/work/xxx/gateware/./bridge.py", line 234, in <module>
    main()
  File "/storage/home/joshua/work/xxx/gateware/./bridge.py", line 224, in main
    build_with_platform(platform,
  File "/storage/home/joshua/work/xxx/gateware/./bridge.py", line 206, in build_with_platform
    soc = BaseSoC(**{'platform': platform, **soc_args})
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/storage/home/joshua/work/xxx/gateware/./bridge.py", line 203, in __init__
    self.bus.add_peripheral(name = "csirx0", peripheral = self.csirx0.bus, region = self.bus.alloc_region("csirx0", 64 * 4, cached = False))
  File "/storage/home/joshua/work/xxx/litex/litex/litex/soc/integration/soc.py", line 530, in add_peripheral
    self.add_slave(self, name=name, slave=peripheral, region=region)
TypeError: SoCBusHandler.add_slave() got multiple values for argument 'name'

It seems that the first self there is unnecessary.

(I would submit this as a PR instead of an Issue but my tree is a total mess right now :) )

jwise avatar Aug 29 '24 01:08 jwise

Thanks @jwise, this should be done with https://github.com/enjoy-digital/litex/commit/61b54aa49175817a0c9147330c11c0b292bf8b79.

enjoy-digital avatar Aug 30 '24 10:08 enjoy-digital