Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMA Axi connection is not working #1557

Closed
mohammadshahidzade opened this issue Jan 6, 2023 · 1 comment
Closed

DMA Axi connection is not working #1557

mohammadshahidzade opened this issue Jan 6, 2023 · 1 comment

Comments

@mohammadshahidzade
Copy link

Hi, I believe that you have not updated the axis connection of DMA and it is not working. When I try to connect it to the axis it gives me an error like this.

  File "litex_sim.py", line 1259, in <module>
    main()
  File "litex_sim.py", line 1219, in main
    soc = SimSoC(
  File "litex_sim.py", line 248, in __init__
    self.submodules.mm2s = mm2s = LiteDRAMDMAReader(axi_port_mm2s,fifo_buffered=True,with_csr=True)
  File "/home/mohammad/Desktop/fpga_dnn/litex/litedram/litedram/frontend/dma.py", line 107, in __init__
    rdata.connect(fifo.sink, omit={"id", "resp"}),
  File "/home/mohammad/Desktop/fpga_dnn/litex/migen/migen/genlib/record.py", line 165, in connect
    r += self_e.connect(getattr(slave, field), keep=keep, omit=omit)
  File "/home/mohammad/Desktop/fpga_dnn/litex/migen/migen/genlib/record.py", line 158, in connect
    r += [getattr(slave, field).eq(self_e) for slave in slaves]
  File "/home/mohammad/Desktop/fpga_dnn/litex/migen/migen/genlib/record.py", line 158, in <listcomp>
    r += [getattr(slave, field).eq(self_e) for slave in slaves]
AttributeError: 'Record' object has no attribute 'dest'

Then, I changed "dma.py" line 107 to rdata.connect(fifo.sink, omit={"id","resp","dest","user"}). it is working now, but it gives me a wrong answer so I believe there is more to it than adding,"dest","user". When I looked at the waveforms it was giving me all zeros not sure where the problem is.
Here is my code:

user_port_mm2s = self.sdram.crossbar.get_port(data_width=sdram_data_width)
axi_port_mm2s  = LiteDRAMAXIPort(
    data_width    = user_port_mm2s.data_width,
    address_width = user_port_mm2s.address_width + log2_int(user_port_mm2s.data_width//8),
    id_width      = 1)
axi2native_mm2s = LiteDRAMAXI2Native(
    port  = user_port_mm2s,
    axi  = axi_port_mm2s,
    # with_read_modify_write = port.get("ecc", False)
)
self.submodules += axi2native_mm2s 
self.submodules.mm2s = mm2s = LiteDRAMDMAReader(axi_port_mm2s,with_csr=True)
self.add_csr("mm2s")

it also works correctly when I make a native connection like this:
self.submodules.mm2s = mm2s = LiteDRAMDMAReader(user_port_mm2s,with_csr=True)

@enjoy-digital
Copy link
Owner

Thanks a lot @mohammadshahidzade for reporting and suggested fixed. This code was indeed not up to date and your fix has been applied with enjoy-digital/litedram@d95c1fc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants