timvideos / litex-buildenv

An environment for building LiteX based FPGA designs. Makes it easy to get everything you need!
BSD 2-Clause "Simplified" License
211 stars 79 forks source link

litex-buildenv: CSRField "btn_ev" name is already used in CSR register #747

Open wuhanstudio opened 2 years ago

wuhanstudio commented 2 years ago

Hi,

I try to build zephyr on vexriscv using litex-buildenv on Ubuntu 20.04:

$ gti clone https://github.com/timvideos/litex-buildenv
$ export CPU=vexriscv
$ export CPU_VARIANT=full
$ export FIRMWARE=zephyr
$ ./scripts/download-env.sh
$ source scripts/enter-env.sh
$ ZEPHYR_APP=hello_world ./scripts/build-zephyr.sh

And received an error from litex/litex/soc/interconnect/csr.py:

INFO:SoC:--------------------------------------------------------------------------------
INFO:SoCBusHandler:io0 Region added at Origin: 0x80000000, Size: 0x80000000, Mode: RW, Cached: False Linker: False.
INFO:SoC:CPU overriding rom mapping from 0x0 to 0x0.
INFO:SoC:CPU overriding sram mapping from 0x1000000 to 0x10000000.
INFO:SoC:CPU overriding main_ram mapping from 0x40000000 to 0x40000000.
INFO:SoCBusHandler:cpu_bus0 added as Bus Master.
INFO:SoCBusHandler:cpu_bus1 added as Bus Master.
INFO:SoCIRQHandler:uart IRQ allocated at Location 0.
INFO:SoCIRQHandler:timer0 IRQ allocated at Location 1.
Traceback (most recent call last):
  File "./make.py", line 185, in <module>
    main()
  File "./make.py", line 123, in main
    soc = get_soc(args, platform)
  File "./make.py", line 57, in get_soc
    soc = SoC(platform, ident=SoC.__name__, **soc_sdram_argdict(args), **dict(args.target_option))
  File "/home/wuhanstudio/Desktop/litex-buildenv/targets/icebreaker/base.py", line 87, in __init__
    self.submodules.cas = cas.ControlAndStatus(platform, clk_freq)
  File "/home/wuhanstudio/Desktop/litex-buildenv/gateware/cas.py", line 98, in __init__
    self.buttons_ev.finalize()
  File "/home/wuhanstudio/Desktop/litex-buildenv/third_party/migen/migen/fhdl/module.py", line 157, in finalize
    self.do_finalize(*args, **kwargs)
  File "/home/wuhanstudio/Desktop/litex-buildenv/third_party/litex/litex/soc/interconnect/csr_eventmanager.py", line 183, in do_finalize
    self.status = CSRStatus(n, description=desc, fields=fields)
  File "/home/wuhanstudio/Desktop/litex-buildenv/third_party/litex/litex/soc/interconnect/csr.py", line 291, in __init__
    self.fields = CSRFieldAggregate(fields, CSRAccess.ReadOnly)
  File "/home/wuhanstudio/Desktop/litex-buildenv/third_party/litex/litex/soc/interconnect/csr.py", line 209, in __init__
    self.check_names(fields)
  File "/home/wuhanstudio/Desktop/litex-buildenv/third_party/litex/litex/soc/interconnect/csr.py", line 229, in check_names
    raise ValueError("CSRField \"{}\" name is already used in CSR register".format(field.name))
ValueError: CSRField "btn_ev" name is already used in CSR register

real    0m2.375s
user    0m0.351s
sys 0m0.025s
make: *** [Makefile:308: firmware-cmd] Error 1
(LX P=icebreaker C=vexriscv.full F=zephyr) wuhanstudio@wuhanstudio-Macmini:~/Desktop/litex-buildenv$ 

The same error occurs for Renore:

$ ./scripts/build-renode.sh

https://github.com/enjoy-digital/litex/issues/1031

zeeshan3534 commented 2 years ago

I also got the same error if u got any solution so please let me know..