enjoy-digital / litex

Build your hardware, easily!
Other
3.02k stars 571 forks source link

build: io: add multibit/bus variants of SDR and DDR #2105

Open maass-hamburg opened 1 month ago

maass-hamburg commented 1 month ago

add bus variants of SDR and DDR, which support more than one pin.

enjoy-digital commented 4 weeks ago

Thanks @maass-hamburg for the different PRs! Would you mind explaining the use-cases in the PR to be able to review the PR having the use-cases in mind?

maass-hamburg commented 3 weeks ago

@enjoy-digital for example in the sdr phy in litespi this:

            for i in range(len(pads.dq)):
                self.specials += SDRTristate(
                    io = pads.dq[i],
                    o  = dq_o[i],
                    oe = dq_oe[i],
                    i  = dq_i[i],
                )

could be replaced with:

            self.specials += SDRTristateBus(
                    io = pads.dq,
                    o  = dq_o,
                    oe = dq_oe,
                    i  = dq_i,
                )
maass-hamburg commented 1 week ago

@enjoy-digital IMO the prefered way to go instead of this would be to have the regular SDR/DDR variants support longer lengths than 1, just like the migen Tristate, but that would need changes to all vendor-specific implementations. But I also don't know, if that's the way litex should go.

enjoy-digital commented 1 week ago

@maass-hamburg: That's indeed what I also tought when having a first look at the PR. If it's too much work to do it for all vendor initially, we could also just have assert in implementations to only build for the supported cases.

maass-hamburg commented 1 week ago

@enjoy-digital I implemented this now also for all of the other vendors, but in a generic way, which should function, but might not be the most efficient way for that platform.