SpinalHDL / NaxRiscv

MIT License
255 stars 39 forks source link

Failing to reproduce the NaxRiscv/Debian setup #69

Open newinnovations opened 9 months ago

newinnovations commented 9 months ago

I am trying to reproduce the NaxRiscv/Debian setup as described here and am running into some issues.

Steps I have untertaken:

python3 -m litex_boards.targets.digilent_nexys_video --build --no-compile-gateware \
    --cpu-type=naxriscv \
    --bus-standard axi-lite \
    --with-video-framebuffer \
    --with-spi-sdcard \
    --with-ethernet \
    --xlen=64 --scala-args='rvc=true,rvf=true,rvd=true' \
    --csr-csv $HOME/build/csr.csv \
    --csr-json $HOME/build/csr.json
openFPGALoader -b nexysVideo --freq 15M digilent_nexys_video.bin

First issue

The fist issue I ran into is a "hang" after printing the memory write speed. Pressing reset the first time leads to a "hang" at the same spot. After pressing reset a second time the boot continues and I am running into the second issue.

        __   _ __      _  __
       / /  (_) /____ | |/_/
      / /__/ / __/ -_)>  <
     /____/_/\__/\__/_/|_|
   Build your hardware, easily!

 (c) Copyright 2012-2023 Enjoy-Digital
 (c) Copyright 2007-2015 M-Labs

 BIOS built on Nov 15 2023 07:56:26
 BIOS CRC passed (70194846)

 LiteX git sha1: 6d9cacd4

--=============== SoC ==================--
CPU:            NaxRiscv @ 100MHz
BUS:            AXI-LITE 32-bit @ 4GiB
CSR:            32-bit data
ROM:            128.0KiB
SRAM:           8.0KiB
L2:             8.0KiB
SDRAM:          512.0MiB 16-bit @ 800MT/s (CL-7 CWL-5)
MAIN-RAM:       512.0MiB

--========== Initialization ============--
Ethernet init...
Initializing SDRAM @0x40000000...
Switching SDRAM to software control.
Read leveling:
  m0, b00: |00000000000000000000000000000000| delays: -
  m0, b01: |00000000000000000000000000000000| delays: -
  m0, b02: |01111111111111100000000000000000| delays: 07+-06
  m0, b03: |00000000000000000011111111111110| delays: 24+-06
  m0, b04: |00000000000000000000000000000000| delays: -
  m0, b05: |00000000000000000000000000000000| delays: -
  m0, b06: |00000000000000000000000000000000| delays: -
  m0, b07: |00000000000000000000000000000000| delays: -
  best: m0, b02 delays: 07+-06
  m1, b00: |00000000000000000000000000000000| delays: -
  m1, b01: |00000000000000000000000000000000| delays: -
  m1, b02: |01111111111111100000000000000000| delays: 08+-06
  m1, b03: |00000000000000000001111111111110| delays: 24+-05
  m1, b04: |00000000000000000000000000000000| delays: -
  m1, b05: |00000000000000000000000000000000| delays: -
  m1, b06: |00000000000000000000000000000000| delays: -
  m1, b07: |00000000000000000000000000000000| delays: -
  best: m1, b02 delays: 08+-06
Switching SDRAM to hardware control.
Memtest at 0x40000000 (2.0MiB)...
  Write: 0x40000000-0x40200000 2.0MiB
   Read: 0x40000000-0x40200000 2.0MiB
Memtest OK
Memspeed at 0x40000000 (Sequential, 2.0MiB)...
  Write speed: 164.7MiB/s
<<<HANGS>>>

Second issue

When the boot continues, files are loaded from the sd-card into memory, OpenSBI and the kernel are starting. However the kernel gets hung up on litespi_rxtx, see the logs below.

        __   _ __      _  __
       / /  (_) /____ | |/_/
      / /__/ / __/ -_)>  <
     /____/_/\__/\__/_/|_|
   Build your hardware, easily!

 (c) Copyright 2012-2023 Enjoy-Digital
 (c) Copyright 2007-2015 M-Labs

 BIOS built on Nov 15 2023 07:56:26
 BIOS CRC passed (70194846)

 LiteX git sha1: 6d9cacd4

--=============== SoC ==================--
CPU:            NaxRiscv @ 100MHz
BUS:            AXI-LITE 32-bit @ 4GiB
CSR:            32-bit data
ROM:            128.0KiB
SRAM:           8.0KiB
L2:             8.0KiB
SDRAM:          512.0MiB 16-bit @ 800MT/s (CL-7 CWL-5)
MAIN-RAM:       512.0MiB

--========== Initialization ============--
Ethernet init...
Initializing SDRAM @0x40000000...
Switching SDRAM to software control.
Read leveling:
  m0, b00: |00000000000000000000000000000000| delays: -
  m0, b01: |00000000000000000000000000000000| delays: -
  m0, b02: |01111111111111100000000000000000| delays: 07+-06
  m0, b03: |00000000000000000011111111111110| delays: 24+-06
  m0, b04: |00000000000000000000000000000000| delays: -
  m0, b05: |00000000000000000000000000000000| delays: -
  m0, b06: |00000000000000000000000000000000| delays: -
  m0, b07: |00000000000000000000000000000000| delays: -
  best: m0, b02 delays: 07+-06
  m1, b00: |00000000000000000000000000000000| delays: -
  m1, b01: |00000000000000000000000000000000| delays: -
  m1, b02: |01111111111111100000000000000000| delays: 08+-06
  m1, b03: |00000000000000000001111111111110| delays: 24+-05
  m1, b04: |00000000000000000000000000000000| delays: -
  m1, b05: |00000000000000000000000000000000| delays: -
  m1, b06: |00000000000000000000000000000000| delays: -
  m1, b07: |00000000000000000000000000000000| delays: -
  best: m1, b02 delays: 08+-06
Switching SDRAM to hardware control.
Memtest at 0x40000000 (2.0MiB)...
  Write: 0x40000000-0x40200000 2.0MiB
   Read: 0x40000000-0x40200000 2.0MiB
Memtest OK
Memspeed at 0x40000000 (Sequential, 2.0MiB)...
  Write speed: 163.7MiB/s
   Read speed: 215.4MiB/s

--============== Boot ==================--
Booting from serial...
Press Q or ESC to abort boot completely.
sL5DdSMmkekro
             Timeout
Booting from SDCard in SPI-Mode...
Booting from boot.json...
Copying Image to 0x41000000 (15451440 bytes)...
[########################################]
Copying linux.dtb to 0x46000000 (2615 bytes)...
[########################################]
Copying opensbi.bin to 0x40f00000 (49992 bytes)...
[########################################]
Executing booted program at 0x40f00000

--============= Liftoff! ===============--

OpenSBI v0.9
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : LiteX / VexRiscv-SMP
Platform Features         : timer,mfdeleg
Platform HART Count       : 8
Firmware Base             : 0x40f00000
Firmware Size             : 124 KB
Runtime SBI Version       : 0.2

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*,1*,2*,3*,4*,5*,6*,7*
Domain0 Region00          : 0x0000000040f00000-0x0000000040f1ffff ()
Domain0 Region01          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000041000000
Domain0 Next Arg1         : 0x0000000046000000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcsu
Boot HART Features        : scounteren,mcounteren,time
Boot HART PMP Count       : 0
Boot HART PMP Granularity : 0
Boot HART PMP Address Bits: 0
Boot HART MHPM Count      : 4
Boot HART MHPM Count      : 4
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109
[    0.000000] Linux version 5.14.0 (rawrr@rawrr) (riscv64-unknown-linux-gnu-gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.37) #2 SMP Mon Sep 12 12:04:51 CEST 2022
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000041000000-0x000000005fffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000041000000-0x000000005fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000041000000-0x000000005fffffff]
[    0.000000] SBI specification v0.2 detected
[    0.000000] SBI implementation ID=0x1 Version=0x9
[    0.000000] SBI TIME extension detected
[    0.000000] SBI IPI extension detected
[    0.000000] SBI RFENCE extension detected
[    0.000000] SBI v0.2 HSM extension detected
[    0.000000] riscv: ISA extensions acdfim
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: Embedded 13 pages/cpu s23448 r0 d29800 u53248
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 125240
[    0.000000] Kernel command line: console=hvc0 earlycon=sbi root=/dev/mmcblk0p2 rootfstype=ext4 rw swiotlb=noforce rootwait rcupdate.rcu_cpu_stall_timeout=2
[    0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 483724K/507904K available (4928K kernel code, 4778K rwdata, 2048K rodata, 2118K init, 300K bss, 24180K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000]  RCU CPU stall warnings timeout set to 2 (rcu_cpu_stall_timeout).
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@f0c00000: mapped 32 interrupts with 1 handlers for 2 contexts.
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
[    0.000004] sched_clock: 64 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns
[    0.008818] Console: colour dummy device 80x25
[    0.012702] printk: console [hvc0] enabled
[    0.012702] printk: console [hvc0] enabled
[    0.021105] printk: bootconsole [sbi0] disabled
[    0.021105] printk: bootconsole [sbi0] disabled
[    0.030499] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=1000000)
[    0.040882] pid_max: default: 32768 minimum: 301
[    0.046431] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.053007] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.072016] ASID allocator disabled
[    0.075342] rcu: Hierarchical SRCU implementation.
[    0.083957] smp: Bringing up secondary CPUs ...
[    0.087537] smp: Brought up 1 node, 1 CPU
[    0.094079] devtmpfs: initialized
[    0.101869] random: get_random_u32 called from bucket_table_alloc.isra.0+0x4a/0x136 with crng_init=0
[    0.105057] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.123237] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.132339] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.184340] raid6: skip pq benchmark and using algorithm int64x8
[    0.189536] raid6: using intx1 recovery algorithm
[    0.196563] SCSI subsystem initialized
[    0.200932] FPGA manager framework
[    0.207691] clocksource: Switched to clocksource riscv_clocksource
[    0.215405] simple-framebuffer 40c00000.framebuffer: framebuffer at 0x40c00000, 0x1d4c00 bytes
[    0.223097] simple-framebuffer 40c00000.framebuffer: format=a8b8g8r8, mode=800x600x32, linelength=3200
[    0.305815] Console: switching to colour frame buffer device 100x37
[    0.384229] simple-framebuffer 40c00000.framebuffer: fb0: simplefb registered!
[    0.441975] NET: Registered PF_INET protocol family
[    0.446871] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.459625] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.467251] TCP established hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.475330] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.482671] TCP: Hash tables configured (established 4096 bind 4096)
[    0.489546] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.495315] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.503544] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.515132] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[    0.555244] fuse: init (API version 7.34)
[    0.560510] 9p: Installing v9fs 9p2000 file system support
[    0.566846] xor: measuring software checksum speed
[    0.608650]    8regs           :   260 MB/sec
[    0.650044]    8regs_prefetch  :   258 MB/sec
[    0.691152]    32regs          :   260 MB/sec
[    0.732624]    32regs_prefetch :   257 MB/sec
[    0.735798] xor: using function: 32regs (260 MB/sec)
[    0.741194] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    0.753083] LiteX SoC Controller driver initialized
[    0.761742] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.778495] f0001000.serial: ttyLXU0 at MMIO 0x0 (irq = 0, base_baud = 0) is a liteuart
[    0.793789] loop: module loaded
[    0.843602] libphy: Fixed MDIO Bus: probed
[    0.850846] liteeth f0002000.mac eth0: irq 1 slots: tx 2 rx 2 size 2048
[   24.097454] watchdog: BUG: soft lockup - CPU#0 stuck for 22s! [swapper/0:1]
[   24.103504] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.14.0 #2
[   24.109484] epc : litespi_rxtx+0xe4/0x2b4
[   24.113561]  ra : spi_transfer_one_message+0x1ee/0x37e
[   24.118771] epc : ffffffff8037bc90 ra : ffffffff80379360 sp : ffffffd00040ba70
[   24.126062]  gp : ffffffff80ebc150 tp : ffffffe001078000 t0 : 0000000000000000
[   24.133354]  t1 : 0000000000000000 t2 : ffffffff80a02350 s0 : ffffffe00117e000
[   24.140647]  s1 : ffffffe001350708 a0 : ffffffff80eee1c0 a1 : ffffffe0012523c0
[   24.147940]  a2 : ffffffe001350708 a3 : ffffffe001333801 a4 : ffffffe00117e4b0
[   24.155232]  a5 : 0000000000000000 a6 : ffffffff8080d420 a7 : 0000000000000801
[   24.162526]  s2 : ffffffe001350798 s3 : 0000000000000001 s4 : ffffffe00117e390
[   24.169819]  s5 : ffffffe001286a50 s6 : 0000000000000000 s7 : ffffffe001286800
[   24.177111]  s8 : 00000000ffffffff s9 : ffffffe00117e300 s10: 00000000000186a0
[   24.184404]  s11: 0000000000000000 t3 : 0000000000000000 t4 : 000000000000033d
[   24.191698]  t5 : 0000000000000000 t6 : 0000000000000019
[   24.197080] status: 0000000200000120 badaddr: 0000000000000000 cause: 8000000000000005
[   24.205072] [<ffffffff8037bc90>] litespi_rxtx+0xe4/0x2b4
[   24.210461] [<ffffffff80377e8a>] spi_controller_transfers_show+0x50/0x54
[   24.217230] [<ffffffff80378f92>] __spi_pump_messages+0x284/0x446
[   24.223303] [<ffffffff80377e8a>] spi_controller_transfers_show+0x50/0x54
[   24.230077] [<ffffffff80379cde>] __spi_sync+0x1c0/0x1e6
[   24.235378] [<ffffffff803a58ac>] mmc_spi_readbytes+0x2c/0x58
[   24.241100] [<ffffffff803a5fe8>] mmc_spi_set_ios+0xb2/0x1f0
[   24.246749] [<ffffffff80396a08>] mmc_power_up.part.0+0xe2/0x164
[   24.252736] [<ffffffff80397966>] mmc_start_host+0x80/0x8c
[   24.258204] [<ffffffff80398cf0>] mmc_add_host+0x28/0x3c
[   24.263501] [<ffffffff803a5cc6>] mmc_spi_probe+0x2e8/0x558
[   24.269057] [<ffffffff8060007e>] rdinit_setup+0x28/0x2c
[   24.274357] [<ffffffff80348e06>] really_probe.part.0+0x54/0x22c
[   24.280344] [<ffffffff803490b2>] driver_probe_device+0x26/0xf0
[   24.286249] [<ffffffff80349386>] __driver_attach+0x86/0x150
[   24.291889] [<ffffffff803492fc>] __device_attach_driver+0xfc/0x100
[   24.298141] [<ffffffff803476d2>] bus_for_each_dev+0x3c/0x64
[   24.303786] [<ffffffff80347d4c>] bus_add_driver+0xd2/0x180
[   24.309343] [<ffffffff80349d38>] driver_register+0x46/0xd8
[   24.314898] [<ffffffff80615da2>] mmc_blk_init+0x10c/0x110
[   24.320367] [<ffffffff80600c9e>] do_one_initcall+0x5e/0x110
[   24.326012] [<ffffffff8060007e>] rdinit_setup+0x28/0x2c
[   24.331310] [<ffffffff80600f5c>] kernel_init_freeable+0x1a8/0x226
[   24.337475] [<ffffffff804cacb4>] rest_init+0xc8/0xcc
[   24.342505] [<ffffffff804cacce>] kernel_init+0x16/0xfe
[   24.347714] [<ffffffff804cacb4>] rest_init+0xc8/0xcc
[   24.352750] [<ffffffff80001c94>] ret_from_syscall_rejected+0x8/0xc
[   48.097457] watchdog: BUG: soft lockup - CPU#0 stuck for 44s! [swapper/0:1]
[   48.103467] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G             L    5.14.0 #2
[   48.110839] epc : litespi_rxtx+0xd4/0x2b4
[   48.114916]  ra : spi_transfer_one_message+0x1ee/0x37e
[   48.120125] epc : ffffffff8037bc80 ra : ffffffff80379360 sp : ffffffd00040ba70
[   48.127417]  gp : ffffffff80ebc150 tp : ffffffe001078000 t0 : 0000000000000000
[   48.134710]  t1 : 0000000000000000 t2 : ffffffff80a02350 s0 : ffffffe00117e000
[   48.142004]  s1 : ffffffe001350708 a0 : ffffffff80eee1c0 a1 : ffffffe0012523c0
[   48.149296]  a2 : ffffffe001350708 a3 : ffffffe001333801 a4 : ffffffe00117e4b0
[   48.156588]  a5 : 0000000000000000 a6 : ffffffff8080d420 a7 : 0000000000000801
[   48.163881]  s2 : ffffffe001350798 s3 : 0000000000000001 s4 : ffffffe00117e390
[   48.171175]  s5 : ffffffe001286a50 s6 : 0000000000000000 s7 : ffffffe001286800
[   48.178467]  s8 : 00000000ffffffff s9 : ffffffe00117e300 s10: 00000000000186a0
[   48.185760]  s11: 0000000000000000 t3 : 0000000000000000 t4 : 000000000000033d
[   48.193053]  t5 : 0000000000000000 t6 : 0000000000000019
[   48.198437] status: 0000000200000120 badaddr: 0000000000000000 cause: 8000000000000005
[   48.206427] [<ffffffff8037bc80>] litespi_rxtx+0xd4/0x2b4
[   48.211813] [<ffffffff80377e8a>] spi_controller_transfers_show+0x50/0x54
[   48.218584] [<ffffffff80378f92>] __spi_pump_messages+0x284/0x446
[   48.224659] [<ffffffff80377e8a>] spi_controller_transfers_show+0x50/0x54
[   48.231432] [<ffffffff80379cde>] __spi_sync+0x1c0/0x1e6
[   48.236733] [<ffffffff803a58ac>] mmc_spi_readbytes+0x2c/0x58
[   48.242456] [<ffffffff803a5fe8>] mmc_spi_set_ios+0xb2/0x1f0
[   48.248106] [<ffffffff80396a08>] mmc_power_up.part.0+0xe2/0x164
[   48.254092] [<ffffffff80397966>] mmc_start_host+0x80/0x8c
[   48.259560] [<ffffffff80398cf0>] mmc_add_host+0x28/0x3c
[   48.264856] [<ffffffff803a5cc6>] mmc_spi_probe+0x2e8/0x558
[   48.270412] [<ffffffff8060007e>] rdinit_setup+0x28/0x2c
[   48.275711] [<ffffffff80348e06>] really_probe.part.0+0x54/0x22c
[   48.281700] [<ffffffff803490b2>] driver_probe_device+0x26/0xf0
[   48.287605] [<ffffffff80349386>] __driver_attach+0x86/0x150
[   48.293245] [<ffffffff803492fc>] __device_attach_driver+0xfc/0x100
[   48.299498] [<ffffffff803476d2>] bus_for_each_dev+0x3c/0x64
[   48.305143] [<ffffffff80347d4c>] bus_add_driver+0xd2/0x180
[   48.310698] [<ffffffff80349d38>] driver_register+0x46/0xd8
[   48.316254] [<ffffffff80615da2>] mmc_blk_init+0x10c/0x110
[   48.321723] [<ffffffff80600c9e>] do_one_initcall+0x5e/0x110
[   48.327367] [<ffffffff8060007e>] rdinit_setup+0x28/0x2c
[   48.332666] [<ffffffff80600f5c>] kernel_init_freeable+0x1a8/0x226
[   48.338831] [<ffffffff804cacb4>] rest_init+0xc8/0xcc
[   48.343861] [<ffffffff804cacce>] kernel_init+0x16/0xfe
[   48.349070] [<ffffffff804cacb4>] rest_init+0xc8/0xcc
[   48.354105] [<ffffffff80001c94>] ret_from_syscall_rejected+0x8/0xc

This is bitstream I am using: digilent_nexys_video.bin.gz

Hope you can help me, I really would like to get this working.

Dolu1990 commented 9 months ago

Hi,

1) Yes i noticed that sometime, there is some weird hang in the litex bios, so far after doing reset it goes away most of the time. I didn't tracked the exact source of the issue so far.

2) Ahh i recently tested using https://github.com/SpinalHDL/NaxSoftware/blob/main/debian_litex/README.md which use the native MMC litex interface (not the SPI one)

What kernel were you using ? all the ones from the readthedoc ? you didn't recompiled anything right ? Maybe the address mapping of the SPI peripheral moved. What dts are you using / does the spi controller address of the generated soc match the dts/dtb you are using ?

Note, i'm mostly based on https://github.com/SpinalHDL/NaxSoftware/blob/main/debian_litex/README.md

newinnovations commented 9 months ago

Thanks for your quick reaction.

Reassuring to hear that you experienced the same bios/boot hang. I was wondering whether it may be a problem with my board. Not a major issue, but it would be nice if we could resolve it.

I was indeed using all the files from the readthedoc, including the dtb. And your guess was correct, the address mapping of the SPI has moved from spi@f0004800 to spi@f0005800.

After updating the dts and putting the corresponding dtb on the card, I was able to boot debian. Nice! Thanks!

I will now try to create a system based on your newer instructions.

Dolu1990 commented 9 months ago

Nice :D

Thanks for the update. Let's me know if you have any issue with the new instructions / there is missing information, especialy on the litex side of things.

newinnovations commented 9 months ago

I started with upgrading my config to the new instructions on step at a time:

  1. opensbi
  2. kernel
  3. naxriscv bitstream with dma/non-spi sd/multi cpu
  4. rootfs

Upgrading the opensbi was not successful. This is what I did:

(I changed the CROSS_COMPILE to riscv64-unknown-elf-)

git clone https://github.com/litex-hub/opensbi --branch 1.3.1-linux-on-litex-vexriscv
cd opensbi/
make CROSS_COMPILE=riscv64-unknown-elf- PLATFORM=litex/vexriscv
cp build/platform/litex/vexriscv/firmware/fw_jump.bin ../part1/opensbi.bin

This leads to a hang at liftoff:

...
Memspeed at 0x40000000 (Sequential, 2.0MiB)...
  Write speed: 163.6MiB/s
   Read speed: 215.4MiB/s

--============== Boot ==================--
Booting from serial...
Press Q or ESC to abort boot completely.
sL5DdSMmkekro
             Timeout
Booting from SDCard in SPI-Mode...
Booting from boot.json...
Copying Image to 0x41000000 (15451440 bytes)...
[########################################]
Copying linux.dtb to 0x46000000 (2630 bytes)...
[########################################]
Copying opensbi.bin to 0x40f00000 (132040 bytes)...
[########################################]
Executing booted program at 0x40f00000

--============= Liftoff! ===============--
<<<HANGS>>>

What I find strange is that you create the opensbi with the config of VexRiscv, which leads to a 32-bit executable.

Then I created the new linux 6.1-rc2 linux kernel per your instructions, which went fine and booted correctly with the old opensbi:

...
Memspeed at 0x40000000 (Sequential, 2.0MiB)...
  Write speed: 164.2MiB/s
   Read speed: 243.5MiB/s

--============== Boot ==================--
Booting from serial...
Press Q or ESC to abort boot completely.
sL5DdSMmkekro
             Timeout
Booting from SDCard in SPI-Mode...
Booting from boot.json...
Copying Image to 0x41000000 (17603072 bytes)...
[########################################]
Copying linux.dtb to 0x46000000 (2630 bytes)...
[########################################]
Copying opensbi.bin to 0x40f00000 (49992 bytes)...
[########################################]
Executing booted program at 0x40f00000

--============= Liftoff! ===============--

OpenSBI v0.9
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : LiteX / VexRiscv-SMP
Platform Features         : timer,mfdeleg
Platform HART Count       : 8
Firmware Base             : 0x40f00000
Firmware Size             : 124 KB
Runtime SBI Version       : 0.2

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*,1*,2*,3*,4*,5*,6*,7*
Domain0 Region00          : 0x0000000040f00000-0x0000000040f1ffff ()
Domain0 Region01          : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address      : 0x0000000041000000
Domain0 Next Arg1         : 0x0000000046000000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART ISA             : rv64imafdcsu
Boot HART Features        : scounteren,mcounteren,time
Boot HART PMP Count       : 0
Boot HART PMP Granularity : 0
Boot HART PMP Address Bits: 0
Boot HART MHPM Count      : 4
Boot HART MHPM Count      : 4
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109
[    0.000000] Linux version 6.1.0-rc2+ (embryonic@litex) (riscv64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP Thu Nov 16 12:27:06 UTC 2023
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000041000000-0x000000005fffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000041000000-0x000000005fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000041000000-0x000000005fffffff]
[    0.000000] SBI specification v0.2 detected
[    0.000000] SBI implementation ID=0x1 Version=0x9
[    0.000000] SBI TIME extension detected
[    0.000000] SBI IPI extension detected
[    0.000000] SBI RFENCE extension detected
[    0.000000] SBI HSM extension detected
[    0.000000] riscv: base ISA extensions acdfim
[    0.000000] riscv: ELF capabilities acdfim
....

I will now start working on updating the bitstreams, but wanted to let you know about my progress and hear your ideas on the opensbi issue.

Dolu1990 commented 9 months ago

Ahhhh right, i had some local changes about opensbi. I created a fork, and changed the readme instructions. with that updated https://github.com/SpinalHDL/NaxSoftware/blob/main/debian_litex/README.md#compile-opensbi it should be good. Let's me know ^^

newinnovations commented 9 months ago

That solved it:

--============= Liftoff! ===============--

OpenSBI v0.9-614-g034d47a
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name             : LiteX / NaxRiscv-SMP
Platform Features         : medeleg
Platform HART Count       : 8
Platform IPI Device       : aclint-mswi
Platform Timer Device     : aclint-mtimer @ 100000000Hz
Platform Console Device   : litex_uart
Platform HSM Device       : ---
Platform PMU Device       : ---
Platform Reboot Device    : ---
Platform Shutdown Device  : ---
Platform Suspend Device   : ---
Platform CPPC Device      : ---
Firmware Base             : 0x40f00000
Firmware Size             : 248 KB
Firmware RW Offset        : 0x20000
Firmware RW Size          : 120 KB
Firmware Heap Offset      : 0x32000
Firmware Heap Size        : 48 KB (total), 3 KB (reserved), 8 KB (used), 36 KB (free)
Firmware Scratch Size     : 4096 B (total), 736 B (used), 3360 B (free)
Runtime SBI Version       : 1.0

Domain0 Name              : root
Domain0 Boot HART         : 0
Domain0 HARTs             : 0*,1*,2*,3*,4*,5*,6*,7*
Domain0 Region00          : 0x00000000f0018000-0x00000000f001bfff M: (I,R,W) S/U: ()
Domain0 Region01          : 0x00000000f0010000-0x00000000f0017fff M: (I,R,W) S/U: ()
Domain0 Region02          : 0x0000000040f00000-0x0000000040f1ffff M: (R,X) S/U: ()
Domain0 Region03          : 0x0000000040f20000-0x0000000040f3ffff M: (R,W) S/U: ()
Domain0 Region04          : 0x0000000000000000-0xffffffffffffffff M: (R,W,X) S/U: (R,W,X)
Domain0 Next Address      : 0x0000000041000000
Domain0 Next Arg1         : 0x0000000046000000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes
Domain0 SysSuspend        : yes

Boot HART ID              : 0
Boot HART Domain          : root
Boot HART Priv Version    : v1.10
Boot HART Base ISA        : rv64imafdc
Boot HART ISA Extensions  : zicntr,zihpm
Boot HART PMP Count       : 0
Boot HART PMP Granularity : 0
Boot HART PMP Address Bits: 0
Boot HART MHPM Count      : 4
Boot HART MIDELEG         : 0x0000000000000222
Boot HART MEDELEG         : 0x000000000000b109
[    0.000000] Linux version 6.1.0-rc2+ (embryonic@litex) (riscv64-linux-gnu-gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP Thu Nov 16 12:27:06 UTC 2023
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] efi: UEFI not found.
[    0.000000] Zone ranges:
Dolu1990 commented 9 months ago

great :D

newinnovations commented 9 months ago

Now I am running into problems with the network. DHCP is not working and when statically configured I get:

root@sid-rv64:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ether 7e:4a:a0:19:59:68 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.50/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::7c4a:a0ff:fe19:5968/64 scope link
       valid_lft forever preferred_lft forever
root@sid-rv64:~# ping 192.168.1.100
PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
From 192.168.1.50 icmp_seq=1 Destination Host Unreachable
From 192.168.1.50 icmp_seq=2 Destination Host Unreachable
From 192.168.1.50 icmp_seq=3 Destination Host Unreachable
From 192.168.1.50 icmp_seq=4 Destination Host Unreachable
From 192.168.1.50 icmp_seq=5 Destination Host Unreachable
From 192.168.1.50 icmp_seq=6 Destination Host Unreachable
^C
--- 192.168.1.100 ping statistics ---
7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6074ms
pipe 3
root@sid-rv64:~# ifdown eth0
root@sid-rv64:~# ifup eth0
[  158.218664] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
root@sid-rv64:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 7e:4a:a0:19:59:68 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.50/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::7c4a:a0ff:fe19:5968/64 scope link
       valid_lft forever preferred_lft forever
root@sid-rv64:~# ping 192.168.1.100
PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
From 192.168.1.50 icmp_seq=1 Destination Host Unreachable
From 192.168.1.50 icmp_seq=2 Destination Host Unreachable
From 192.168.1.50 icmp_seq=3 Destination Host Unreachable
From 192.168.1.50 icmp_seq=4 Destination Host Unreachable
^C
--- 192.168.1.100 ping statistics ---
7 packets transmitted, 0 received, +4 errors, 100% packet loss, time 6073ms
pipe 3
root@sid-rv64:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 7e:4a:a0:19:59:68 brd ff:ff:ff:ff:ff:ff
Dolu1990 commented 9 months ago

Hi,

I didn't had particular with ethernet in debian, could it be aswell that the DTS memory address / interrupt id for the ethernet peripheral changed ? Can you check the eth0 stats ? (ifconfig eth0) RX packets 55249 bytes 65328784 (65.3 MB) RX errors 0 dropped 300 overruns 0 frame 0 TX packets 12857 bytes 2470859 (2.4 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

to see if the trafic goes both way

newinnovations commented 9 months ago

For your information my setup is now as follows. I created the bitmap using the following command:

python3 -m litex_boards.targets.digilent_nexys_video --build --no-compile-gateware \
    --cpu-type=naxriscv \
    --bus-standard axi-lite \
    --with-video-framebuffer \
    --with-coherent-dma \
    --with-sdcard \
    --with-ethernet \
    --xlen=64 --scala-args='rvc=true,rvf=true,rvd=true,alu-count=2,decode-count=2' \
    --uart-baudrate 3000000 \
    --with-jtag-tap \
    --sys-clk-freq 75000000 \
    --cpu-count 2 \
    --csr-csv $HOME/build/csr.csv \
    --csr-json $HOME/build/csr.json

I reduced the speed to 75MHz as I noticed that Vivado signals that timing cannot be met at 100MHz. At 75MHz the booting hangs are completely resolved and I can use the SD card in non-SPI mode. At 100MHz the core was unable to read the files reliable from SD to bootstrap everything. And I increased the serial speed to 3Mbps (for serial boots).

The dts is generated from csr.json, with the following modifications:

These are all the files I use, if you want to reproduce:

naxriscv.tar.gz

Below are the requested ifconfig logs:

sid-rv64 login: root
Password:
Linux sid-rv64 6.1.0-rc2+ #1 SMP Thu Nov 16 12:27:06 UTC 2023 riscv64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Aug 27 21:39:55 UTC 2022 on hvc0
root@sid-rv64:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.50  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::c086:f0ff:fe24:4714  prefixlen 64  scopeid 0x20<link>
        ether c2:86:f0:24:47:14  txqueuelen 1000  (Ethernet)
        RX packets 4  bytes 366 (366.0 B)
        RX errors 0  dropped 4  overruns 0  frame 0
        TX packets 79  bytes 3694 (3.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 1

root@sid-rv64:~# ping 192.168.1.100
PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
From 192.168.1.50 icmp_seq=1 Destination Host Unreachable
From 192.168.1.50 icmp_seq=2 Destination Host Unreachable
From 192.168.1.50 icmp_seq=3 Destination Host Unreachable
From 192.168.1.50 icmp_seq=6 Destination Host Unreachable
From 192.168.1.50 icmp_seq=7 Destination Host Unreachable
From 192.168.1.50 icmp_seq=8 Destination Host Unreachable
From 192.168.1.50 icmp_seq=9 Destination Host Unreachable
From 192.168.1.50 icmp_seq=10 Destination Host Unreachable
From 192.168.1.50 icmp_seq=11 Destination Host Unreachable
^C
--- 192.168.1.100 ping statistics ---
11 packets transmitted, 0 received, +9 errors, 100% packet loss, time 10139ms
pipe 4
root@sid-rv64:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.50  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::c086:f0ff:fe24:4714  prefixlen 64  scopeid 0x20<link>
        ether c2:86:f0:24:47:14  txqueuelen 1000  (Ethernet)
        RX packets 4  bytes 366 (366.0 B)
        RX errors 0  dropped 4  overruns 0  frame 0
        TX packets 147  bytes 6578 (6.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 1

root@sid-rv64:~# echo Just pinged to the naxriscv
Just pinged to the naxriscv
root@sid-rv64:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.50  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::c086:f0ff:fe24:4714  prefixlen 64  scopeid 0x20<link>
        ether c2:86:f0:24:47:14  txqueuelen 1000  (Ethernet)
        RX packets 13  bytes 906 (906.0 B)
        RX errors 0  dropped 13  overruns 0  frame 0
        TX packets 207  bytes 9126 (8.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 1
Dolu1990 commented 9 months ago

75MHz

Ahh maybe on my devkit i more lucky, (vivado give me slack violation of around -0.6 ns)

One thing you can do to increase fmax is to set alu-count=1,decode-count=1 instead

The thing which is botthering with vivado, is that -0.6 ns violation mean it could run at 94 Mhz. But when i change setting to 90 Mhz, then vivado relax too much and still get timing violation XD maybe the best would be to fake a higher clock frequancy to vivado than what it realy is to stress him well

Ahhh one thing to diagnostic is : cat /proc/interrupts

To see if interrupts happen or not.

newinnovations commented 9 months ago

Interrupts info:

root@sid-rv64:~# cat /proc/interrupts
           CPU0       CPU1
  1:        154          0  SiFive PLIC   3 Edge      eth0
  2:      10813          0  SiFive PLIC   4 Edge      litex-mmc
  5:      51092      51065  RISC-V INTC   5 Edge      riscv-timer
IPI0:        29         56  Rescheduling interrupts
IPI1:      2238       6428  Function call interrupts
IPI2:         0          0  CPU stop interrupts
IPI3:         0          0  IRQ work interrupts
IPI4:         0          0  Timer broadcast interrupts
root@sid-rv64:~# cat /proc/interrupts
           CPU0       CPU1
  1:        277          0  SiFive PLIC   3 Edge      eth0
  2:      10815          0  SiFive PLIC   4 Edge      litex-mmc
  5:      71969      71942  RISC-V INTC   5 Edge      riscv-timer
IPI0:        31         56  Rescheduling interrupts
IPI1:      2239       6505  Function call interrupts
IPI2:         0          0  CPU stop interrupts
IPI3:         0          0  IRQ work interrupts
IPI4:         0          0  Timer broadcast interrupts

I was wondering if you can reproduce with the files I provided.

Dolu1990 commented 9 months ago

hmm doesn't look bad. I will give a try.

Dolu1990 commented 9 months ago

I can reproduce the network issue on my side aswell now XD I'm trying to find the cause.

Dolu1990 commented 9 months ago

It seems related to a litex update which broke the peripheral interconnect. https://github.com/enjoy-digital/litex/issues/1831

There was a fix in litex upstream which fixed most of it, but apparentlyit may not have fixed it all, as reverting to https://github.com/Dolu1990/litex.git 5e482d64 fix the issue on my board.

Dolu1990 commented 9 months ago

Note if you try to revert litex to https://github.com/Dolu1990/litex.git 5e482d64 i had to change litex-boards/litex_boards/targets/digilent_nexys_video.py pll.create_clkout(self.cd_sys, sys_clk_freq, reset_buf="bufg") into pll.create_clkout(self.cd_sys, sys_clk_freq)

newinnovations commented 9 months ago

Thanks for testing and finding the problem so quickly. I will try to revert to the mentioned commit.

Dolu1990 commented 8 months ago

Should have been fixed with https://github.com/enjoy-digital/litex/issues/1831#issuecomment-1847283321 ?

newinnovations commented 8 months ago

Last week I was able to get networking running with reverting to the commit you mentioned and modifying the board file. Will try the "official fix" this week.

Dolu1990 commented 8 months ago

ok, thanks :D

Dolu1990 commented 8 months ago

Hi,

I had time to test. With litex upstream all seems good now. Also, it seems it may have fixed the random freeze i had in litex bios / early linux boot. (@100 Mhz)

let's me know how things goes on your side :D

newinnovations commented 8 months ago

Working for me as well. But only tested at 75MHz.

Will test for 100Mhz later and report back. Thanks again.

newinnovations commented 8 months ago

With 100Mhz, indeed the memory hangs seem to be resolved. However, the lite-x bios fails to recognize my SD-card in non-SPI mode or has read failures, so not usable for me at 100MHz.

Dolu1990 commented 8 months ago

Ahh on my side, critical path is on the SDcard side of things :


    Location             Delay type                Incr(ns)  Path(ns)    Netlist Resource(s)
  -------------------------------------------------------------------    -------------------
                         (clock crg_s7mmcm0_clkout0 rise edge)
                                                      0.000     0.000 r  
    R4                                                0.000     0.000 r  clk100 (IN)
                         net (fo=0)                   0.000     0.000    clk100
    R4                   IBUF (Prop_ibuf_I_O)         1.475     1.475 r  clk100_IBUF_inst/O
                         net (fo=11, routed)          1.233     2.708    crg_s7mmcm0_clkin
    MMCME2_ADV_X1Y2      MMCME2_ADV (Prop_mmcme2_adv_CLKIN1_CLKOUT0)
                                                      0.088     2.796 r  MMCME2_ADV/CLKOUT0
                         net (fo=1, routed)           1.808     4.605    crg_s7mmcm0_clkout0
    BUFGCTRL_X0Y0        BUFG (Prop_bufg_I_O)         0.096     4.701 r  BUFG/O
                         net (fo=57876, routed)       1.668     6.369    sys_clk
    SLICE_X58Y140        FDRE                                         r  clocker_storage_reg[6]/C
  -------------------------------------------------------------------    -------------------
    SLICE_X58Y140        FDRE (Prop_fdre_C_Q)         0.456     6.825 r  clocker_storage_reg[6]/Q
                         net (fo=9, routed)           0.716     7.541    clocker_storage[6]
    SLICE_X58Y140        LUT5 (Prop_lut5_I1_O)        0.124     7.665 f  BUFG_10_i_19/O
                         net (fo=2, routed)           0.656     8.322    BUFG_10_i_19_n_0
    SLICE_X59Y140        LUT5 (Prop_lut5_I0_O)        0.124     8.446 f  BUFG_10_i_8/O
                         net (fo=2, routed)           0.601     9.047    BUFG_10_i_8_n_0
    SLICE_X55Y139        LUT6 (Prop_lut6_I0_O)        0.124     9.171 f  BUFG_10_i_3/O
                         net (fo=1, routed)           0.815     9.985    BUFG_10_i_3_n_0
    SLICE_X53Y139        LUT6 (Prop_lut6_I0_O)        0.124    10.109 r  BUFG_10_i_2/O
                         net (fo=4, routed)           0.318    10.427    clocker_clk1
    SLICE_X53Y137        LUT2 (Prop_lut2_I1_O)        0.124    10.551 r  BUFG_10_i_1/O
                         net (fo=22, routed)          0.469    11.020    I0
    SLICE_X50Y135        LUT2 (Prop_lut2_I0_O)        0.124    11.144 f  sdcard_core_crc16_inserter_count[2]_i_5/O
                         net (fo=1, routed)           1.233    12.377    sdcard_core_crc16_inserter_count[2]_i_5_n_0
    SLICE_X21Y131        LUT6 (Prop_lut6_I4_O)        0.124    12.501 f  sdcard_core_crc16_inserter_count[2]_i_3/O
                         net (fo=3, routed)           0.465    12.966    sdcard_core_crc16_inserter_count[2]_i_3_n_0
    SLICE_X20Y129        LUT6 (Prop_lut6_I5_O)        0.124    13.090 r  sdcard_mem2block_count[8]_i_1_comp_1/O
                         net (fo=111, routed)         1.279    14.369    sdcard_mem2block_count[8]_i_1_n_0
    SLICE_X1Y126         LUT6 (Prop_lut6_I4_O)        0.124    14.493 f  ODDR_32_i_14/O
                         net (fo=1, routed)           0.000    14.493    ODDR_32_i_14_n_0
    SLICE_X1Y126         MUXF7 (Prop_muxf7_I1_O)      0.245    14.738 f  ODDR_32_i_6/O
                         net (fo=1, routed)           1.264    16.002    ODDR_32_i_6_n_0
    SLICE_X1Y119         LUT6 (Prop_lut6_I1_O)        0.298    16.300 r  ODDR_32_i_1_comp/O
                         net (fo=2, routed)           0.590    16.889    sdpads_data_o[3]
    OLOGIC_X0Y113        ODDR                                         r  ODDR_32/D1
  -------------------------------------------------------------------    -------------------

                         (clock crg_s7mmcm0_clkout0 rise edge)
                                                     10.000    10.000 r  
    R4                                                0.000    10.000 r  clk100 (IN)
                         net (fo=0)                   0.000    10.000    clk100
    R4                   IBUF (Prop_ibuf_I_O)         1.405    11.405 r  clk100_IBUF_inst/O
                         net (fo=11, routed)          1.162    12.567    crg_s7mmcm0_clkin
    MMCME2_ADV_X1Y2      MMCME2_ADV (Prop_mmcme2_adv_CLKIN1_CLKOUT0)
                                                      0.083    12.650 r  MMCME2_ADV/CLKOUT0
                         net (fo=1, routed)           1.723    14.373    crg_s7mmcm0_clkout0
    BUFGCTRL_X0Y0        BUFG (Prop_bufg_I_O)         0.091    14.464 r  BUFG/O
                         net (fo=57876, routed)       1.708    16.171    sys_clk
    OLOGIC_X0Y113        ODDR                                         r  ODDR_32/C
                         clock pessimism              0.317    16.488    
                         clock uncertainty           -0.067    16.421    
    OLOGIC_X0Y113        ODDR (Setup_oddr_C_D1)      -0.834    15.587    ODDR_32
  -------------------------------------------------------------------
                         required time                         15.587    
                         arrival time                         -16.889    
  -------------------------------------------------------------------
                         slack                                 -1.302    

Is it the same for you ?

newinnovations commented 8 months ago

Some are. I have several paths with negative slack, all related to crg_s7mmcm0_clkout0

Clock                          WNS(ns)      TNS(ns)  TNS Failing Endpoints  TNS Total Endpoints      WHS(ns)      THS(ns)  THS Failing Endpoints  THS Total Endpoints     WPWS(ns)     TPWS(ns)  TPWS Failing Endpoints  TPWS Total Endpoints
-----                          -------      -------  ---------------------  -------------------      -------      -------  ---------------------  -------------------     --------     --------  ----------------------  --------------------
clk100                           8.006        0.000                      0                    7        0.154        0.000                      0                    7        3.000        0.000                       0                    10
  basesoc_s7mmcm0_mmcm_fb                                                                                                                                                    8.751        0.000                       0                     2
  basesoc_s7mmcm1_mmcm_fb                                                                                                                                                    8.751        0.000                       0                     2
  crg_s7mmcm0_clkout0           -0.808     -751.404                   3788               198206        0.015        0.000                      0               198206        3.750        0.000                       0                 57657
  crg_s7mmcm0_clkout1                                                                                                                                                        0.345        0.000                       0                    77
  crg_s7mmcm0_clkout2                                                                                                                                                        0.345        0.000                       0                     4
  crg_s7mmcm0_clkout3            1.215        0.000                      0                   14        0.160        0.000                      0                   14        0.264        0.000                       0                    11
  crg_s7mmcm1_clkout0            1.200        0.000                      0                  489        0.061        0.000                      0                  489       12.000        0.000                       0                   444
  crg_s7mmcm1_clkout1                                                                                                                                                        2.845        0.000                       0                     8
eth_clocks_rx                                                                                                                                                                5.845        0.000                       0                     1
eth_rx_clk                       1.241        0.000                      0                  445        0.090        0.000                      0                  445        2.000        0.000                       0                   158
  basesoc_pll_fb                                                                                                                                                             6.751        0.000                       0                     2
  ethphy_clkout0                                                                                                                                                             5.845        0.000                       0                     2
  ethphy_clkout1                                                                                                                                                             5.845        0.000                       0                     3
eth_tx_clk                       0.746        0.000                      0                  336        0.153        0.000                      0                  336        3.500        0.000                       0                   140

This one seems RAM related for example:

--------------------------------------------------------------------------------------
Slack (VIOLATED) :        -0.808ns  (required time - arrival time)
  Source:                 NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/load_pipeline_stages_2_WAYS_HITS_reg[3]/C
                            (rising edge-triggered cell FDRE clocked by crg_s7mmcm0_clkout0  {rise@0.000ns fall@5.000ns period=10.000ns})
  Destination:            NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/ALU0_ExecutionUnitBase_pipeline_fetch_1_SrcStageables_SRC1_reg[38]/D
                            (rising edge-triggered cell FDRE clocked by crg_s7mmcm0_clkout0  {rise@0.000ns fall@5.000ns period=10.000ns})
  Path Group:             crg_s7mmcm0_clkout0
  Path Type:              Setup (Max at Slow Process Corner)
  Requirement:            10.000ns  (crg_s7mmcm0_clkout0 rise@10.000ns - crg_s7mmcm0_clkout0 rise@0.000ns)
  Data Path Delay:        10.512ns  (logic 1.784ns (16.972%)  route 8.728ns (83.028%))
  Logic Levels:           10  (LUT3=1 LUT4=3 LUT5=5 LUT6=1)
  Clock Path Skew:        -0.304ns (DCD - SCD + CPR)
    Destination Clock Delay (DCD):    5.994ns = ( 15.994 - 10.000 )
    Source Clock Delay      (SCD):    6.543ns
    Clock Pessimism Removal (CPR):    0.245ns
  Clock Uncertainty:      0.067ns  ((TSJ^2 + DJ^2)^1/2) / 2 + PE
    Total System Jitter     (TSJ):    0.071ns
    Discrete Jitter          (DJ):    0.114ns
    Phase Error              (PE):    0.000ns

    Location             Delay type                Incr(ns)  Path(ns)    Netlist Resource(s)
  -------------------------------------------------------------------    -------------------
                         (clock crg_s7mmcm0_clkout0 rise edge)
                                                      0.000     0.000 r
    R4                                                0.000     0.000 r  clk100 (IN)
                         net (fo=0)                   0.000     0.000    clk100
    R4                   IBUF (Prop_ibuf_I_O)         1.475     1.475 r  clk100_IBUF_inst/O
                         net (fo=10, routed)          1.233     2.708    crg_s7mmcm0_clkin
    MMCME2_ADV_X1Y2      MMCME2_ADV (Prop_mmcme2_adv_CLKIN1_CLKOUT0)
                                                      0.088     2.796 r  MMCME2_ADV/CLKOUT0
                         net (fo=1, routed)           1.808     4.605    crg_s7mmcm0_clkout0
    BUFGCTRL_X0Y0        BUFG (Prop_bufg_I_O)         0.096     4.701 r  BUFG/O
                         net (fo=57655, routed)       1.842     6.543    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/out
    SLICE_X52Y90         FDRE                                         r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/load_pipeline_stages_2_WAYS_HITS_reg[3]/C
  -------------------------------------------------------------------    -------------------
    SLICE_X52Y90         FDRE (Prop_fdre_C_Q)         0.518     7.061 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/load_pipeline_stages_2_WAYS_HITS_reg[3]/Q
                         net (fo=75, routed)          0.995     8.056    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/_zz_load_pipeline_stages_2_CPU_WORD_2
    SLICE_X63Y90         LUT4 (Prop_lut4_I3_O)        0.124     8.180 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/MmuPlugin_logic_refill_load_rsp_payload_data[47]_i_2__0/O
                         net (fo=1, routed)           0.699     8.878    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/MmuPlugin_logic_refill_load_rsp_payload_data[47]_i_2__0_n_0
    SLICE_X69Y90         LUT5 (Prop_lut5_I4_O)        0.124     9.002 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/MmuPlugin_logic_refill_load_rsp_payload_data[47]_i_1__0/O
                         net (fo=4, routed)           0.780     9.782    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/load_pipeline_stages_2_WAYS_HITS_reg[0]_0[44]
    SLICE_X75Y94         LUT3 (Prop_lut3_I2_O)        0.124     9.906 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ram_0_reg_r1_0_63_15_17_i_10/O
                         net (fo=1, routed)           0.498    10.404    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ram_0_reg_r1_0_63_15_17_i_10_n_0
    SLICE_X76Y94         LUT6 (Prop_lut6_I5_O)        0.124    10.528 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ram_0_reg_r1_0_63_15_17_i_9/O
                         net (fo=1, routed)           0.699    11.227    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ram_0_reg_r1_0_63_15_17_i_9_n_0
    SLICE_X82Y96         LUT5 (Prop_lut5_I2_O)        0.124    11.351 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ram_0_reg_r1_0_63_15_17_i_4/O
                         net (fo=4, routed)           1.187    12.538    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ram_0_reg_r1_0_63_15_17_i_4_n_0
    SLICE_X79Y108        LUT4 (Prop_lut4_I3_O)        0.124    12.662 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ram_0_reg_r1_0_63_15_17_i_7_comp/O
                         net (fo=1, routed)           0.886    13.548    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ram_0_reg_r1_0_63_15_17_i_7_n_0_repN
    SLICE_X78Y110        LUT5 (Prop_lut5_I4_O)        0.124    13.672 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ram_0_reg_r1_0_63_36_38_i_3__0_comp/O
                         net (fo=12, routed)          1.450    15.122    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/io_writes_0_payload_data[38]
    SLICE_X67Y128        LUT5 (Prop_lut5_I4_O)        0.124    15.246 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ALU0_ExecutionUnitBase_pipeline_fetch_1_SrcStageables_SRC1[38]_i_3/O
                         net (fo=1, routed)           0.601    15.847    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ALU0_ExecutionUnitBase_pipeline_fetch_1_SrcStageables_SRC1[38]_i_3_n_0
    SLICE_X65Y131        LUT5 (Prop_lut5_I2_O)        0.124    15.971 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ALU0_ExecutionUnitBase_pipeline_fetch_1_SrcStageables_SRC1[38]_i_2/O
                         net (fo=1, routed)           0.934    16.905    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/integer_RegFilePlugin_logic_regfile_fpga_io_reads_0_data[38]
    SLICE_X65Y127        LUT4 (Prop_lut4_I3_O)        0.150    17.055 r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/DataCachePlugin_logic_cache/ALU0_ExecutionUnitBase_pipeline_fetch_1_SrcStageables_SRC1[38]_i_1/O
                         net (fo=1, routed)           0.000    17.055    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/_zz_ALU0_ExecutionUnitBase_pipeline_fetch_0_SrcStageables_SRC1[38]
    SLICE_X65Y127        FDRE                                         r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/ALU0_ExecutionUnitBase_pipeline_fetch_1_SrcStageables_SRC1_reg[38]/D
  -------------------------------------------------------------------    -------------------

                         (clock crg_s7mmcm0_clkout0 rise edge)
                                                     10.000    10.000 r
    R4                                                0.000    10.000 r  clk100 (IN)
                         net (fo=0)                   0.000    10.000    clk100
    R4                   IBUF (Prop_ibuf_I_O)         1.405    11.405 r  clk100_IBUF_inst/O
                         net (fo=10, routed)          1.162    12.567    crg_s7mmcm0_clkin
    MMCME2_ADV_X1Y2      MMCME2_ADV (Prop_mmcme2_adv_CLKIN1_CLKOUT0)
                                                      0.083    12.650 r  MMCME2_ADV/CLKOUT0
                         net (fo=1, routed)           1.723    14.373    crg_s7mmcm0_clkout0
    BUFGCTRL_X0Y0        BUFG (Prop_bufg_I_O)         0.091    14.464 r  BUFG/O
                         net (fo=57655, routed)       1.530    15.994    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/out
    SLICE_X65Y127        FDRE                                         r  NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/ALU0_ExecutionUnitBase_pipeline_fetch_1_SrcStageables_SRC1_reg[38]/C
                         clock pessimism              0.245    16.239
                         clock uncertainty           -0.067    16.172
    SLICE_X65Y127        FDRE (Setup_fdre_C_D)        0.075    16.247    NaxRiscvLitex_a79cc6017676fe6fb88c46e096a4295b/naxes_0_thread_core/ALU0_ExecutionUnitBase_pipeline_fetch_1_SrcStageables_SRC1_reg[38]
  -------------------------------------------------------------------
                         required time                         16.247
                         arrival time                         -17.055
  -------------------------------------------------------------------
                         slack                                 -0.808