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

Simulation hangs indefinitely with generated Linux binary #408

Open
GMXX opened this issue Oct 2, 2024 · 1 comment
Open

Simulation hangs indefinitely with generated Linux binary #408

GMXX opened this issue Oct 2, 2024 · 1 comment

Comments

@GMXX
Copy link

GMXX commented Oct 2, 2024

Following the instructions presented on the README, I've generated a custom Linux binary with USB support. The buildroot configuration file used is the default litex_vexriscv_usbhost_defconfig with the addition of the micropython package by uncommenting the line as follows:

# Extra packages
#BR2_PACKAGE_DHRYSTONE_OPT=y
BR2_PACKAGE_MICROPYTHON=y
#BR2_PACKAGE_SPIDEV_TEST=y
#BR2_PACKAGE_MTD=y
#BR2_PACKAGE_MTD_JFFS_UTILS=y

After the generation, I ran sim.py, but it hung at

Run /init as init process

Below is the complete simulation log:

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


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


 BIOS built on Sep 29 2024 20:37:58
 BIOS CRC passed (80d30a52)


 LiteX git sha1: 87ee6ec3a


--=============== SoC ==================--
CPU:		VexRiscv SMP-LINUX @ 100MHz
BUS:		wishbone 32-bit @ 4GiB
CSR:		32-bit data
ROM:		64.0KiB
SRAM:		8.0KiB
SDRAM:		64.0MiB 32-bit @ 100MT/s (CL-2 CWL-2)
MAIN-RAM:	64.0MiB


--========== Initialization ============--


Initializing SDRAM @0x40000000...
Switching SDRAM to software control.
Switching SDRAM to hardware control.


--============== Boot ==================--
Booting from serial...
Press Q or ESC to abort boot completely.
sL5DdSMmkekro
Timeout
Executing booted program at 0x40f00000


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


OpenSBI v1.3
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|


Platform Name             : LiteX / VexRiscv-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             : 376 KB
Firmware RW Offset        : 0x40000
Firmware RW Size          : 120 KB
Firmware Heap Offset      : 0x52000
Firmware Heap Size        : 48 KB (total), 3 KB (reserved), 8 KB (used), 36 KB (free)
Firmware Scratch Size     : 4096 B (total), 452 B (used), 3644 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          : 0xf0018000-0xf001bfff M: (I,R,W) S/U: ()
Domain0 Region01          : 0xf0010000-0xf0017fff M: (I,R,W) S/U: ()
Domain0 Region02          : 0x40f40000-0x40f5ffff M: (R,W) S/U: ()
Domain0 Region03          : 0x40f00000-0x40f3ffff M: (R,X) S/U: ()
Domain0 Region04          : 0x00000000-0xffffffff M: (R,W,X) S/U: (R,W,X)
Domain0 Next Address      : 0x40000000
Domain0 Next Arg1         : 0x40ef0000
Domain0 Next Mode         : S-mode
Domain0 SysReset          : yes
Domain0 SysSuspend        : yes


Boot HART ID              : 0
Boot HART Domain          : root
Boot HART Priv Version    : unknown
Boot HART Base ISA        : rv32ima
Boot HART ISA Extensions  : zicntr
Boot HART PMP Count       : 0
Boot HART PMP Granularity : 0
Boot HART PMP Address Bits: 0
Boot HART MHPM Count      : 0
Boot HART MIDELEG         : 0x00000222
Boot HART MEDELEG         : 0x0000b109
[    0.000000] Linux version 6.9.0 (stark@eOS) (riscv32-buildroot-linux-gnu-gcc.br_real (Buildroot 2024.08-761-g09964bc5c0) 13.3.0, GNU ld (GNU Binutils) 2.42) #1 SMP Sun Sep 29 20:28:22 -03 2024
[    0.000000] Machine model: sim
[    0.000000] SBI specification v1.0 detected
[    0.000000] SBI implementation ID=0x1 Version=0x10003
[    0.000000] SBI TIME extension detected
[    0.000000] SBI IPI extension detected
[    0.000000] SBI RFENCE extension detected
[    0.000000] earlycon: liteuart0 at I/O port 0x0 (options '')
[    0.000000] Malformed early option 'console'
[    0.000000] earlycon: liteuart0 at MMIO 0xf0001000 (options '')
[    0.000000] printk: legacy bootconsole [liteuart0] enabled
[    0.000000] OF: reserved mem: OVERLAP DETECTED!
[    0.000000] mmode_resv1@40f00000 (0x40f00000--0x40f40000) overlaps with opensbi@40f00000 (0x40f00000--0x40f80000)
[    0.000000] OF: reserved mem: OVERLAP DETECTED!
[    0.000000] opensbi@40f00000 (0x40f00000--0x40f80000) overlaps with mmode_resv0@40f40000 (0x40f40000--0x40f60000)
[    0.000000] OF: reserved mem: 0x40f00000..0x40f3ffff (256 KiB) nomap non-reusable mmode_resv1@40f00000
[    0.000000] OF: reserved mem: 0x40f00000..0x40f7ffff (512 KiB) map non-reusable opensbi@40f00000
[    0.000000] OF: reserved mem: 0x40f40000..0x40f5ffff (128 KiB) nomap non-reusable mmode_resv0@40f40000
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000040000000-0x0000000043ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000040000000-0x0000000040efffff]
[    0.000000]   node   0: [mem 0x0000000040f00000-0x0000000040f5ffff]
[    0.000000]   node   0: [mem 0x0000000040f60000-0x0000000043ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000040000000-0x0000000043ffffff]
[    0.000000] SBI HSM extension detected
[    0.000000] riscv: base ISA extensions aim
[    0.000000] riscv: ELF capabilities aim
[    0.000000] percpu: Embedded 11 pages/cpu s23188 r0 d21868 u45056
[    0.000000] Kernel command line: console=liteuart earlycon=liteuart,0xf0001000 rootwait root=/dev/ram0
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] mem auto-init: stack:all(zero), heap alloc:off, heap free:off
[    0.000000] Memory: 46256K/65536K available (7488K kernel code, 599K rwdata, 1264K rodata, 271K init, 257K bss, 19280K 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=32 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 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: 32 local interrupts mapped
[    0.000000] riscv: providing IPIs using SBI IPI extension
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns
[    0.000026] sched_clock: 64 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns
[    0.003093] Console: colour dummy device 80x25
[    0.004118] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=400000)
[    0.005042] pid_max: default: 32768 minimum: 301
[    0.009969] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.010732] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.053466] ASID allocator using 9 bits (512 entries)
[    0.058268] rcu: Hierarchical SRCU implementation.
[    0.058732] rcu: 	Max phase no-delay instances is 1000.
[    0.076128] smp: Bringing up secondary CPUs ...
[    0.076784] smp: Brought up 1 node, 1 CPU
[    0.088065] devtmpfs: initialized
[    0.135744] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.137005] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.176482] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.189512] DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations
[    0.306677] cpu0: Ratio of byte access time to unaligned word access is 0.00, unaligned accesses are slow
[    0.323078] platform soc: Fixed dependency cycle(s) with /soc/interrupt-controller@f0c00000
[    0.333364] platform soc: Fixed dependency cycle(s) with /soc/interrupt-controller@f0c00000
[    0.377999] SCSI subsystem initialized
[    0.381391] usbcore: registered new interface driver usbfs
[    0.383013] usbcore: registered new interface driver hub
[    0.385070] usbcore: registered new device driver usb
[    0.389666] pps_core: LinuxPPS API ver. 1 registered
[    0.390167] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
[    0.391269] PTP clock support registered
[    0.397298] FPGA manager framework
[    0.399441] Advanced Linux Sound Architecture Driver Initialized.
[    0.420805] clocksource: Switched to clocksource riscv_clocksource
[    0.773200] NET: Registered PF_INET protocol family
[    0.778442] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.790937] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.791812] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.793207] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.794172] TCP bind hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    0.795174] TCP: Hash tables configured (established 1024 bind 1024)
[    0.797071] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.798007] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.829863] Unpacking initramfs...
[    0.839110] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.850256] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.850861] io scheduler mq-deadline registered
[    0.851382] io scheduler kyber registered
[    0.852290] io scheduler bfq registered
[    0.877329] riscv-plic f0c00000.interrupt-controller: mapped 32 interrupts with 1 handlers for 2 contexts.
[    0.895044] LiteX SoC Controller driver initialized
[    3.403317] Freeing initrd memory: 8192K
[    4.435874] f0001000.serial: ttyLXU0 at MMIO 0x0 (irq = 12, base_baud = 0) is a liteuart
[    4.437410] printk: legacy console [liteuart0] enabled
[    4.437410] printk: legacy console [liteuart0] enabled
[    4.438273] printk: legacy bootconsole [liteuart0] disabled
[    4.438273] printk: legacy bootconsole [liteuart0] disabled
[    4.474898] usbcore: registered new interface driver usb-storage
[    4.478156] usbcore: registered new interface driver ftdi_sio
[    4.479597] usbserial: USB Serial support registered for FTDI USB Serial Device
[    4.482938] UDC core: g_audio: couldn't find an available UDC
[    4.494943] mousedev: PS/2 mouse device common for all mice
[    4.499015] i2c_dev: i2c /dev entries driver
[    4.526705] usbcore: registered new interface driver usbhid
[    4.527306] usbhid: USB HID core driver
[    4.538164] usbcore: registered new interface driver snd-usb-audio
[    4.545997] NET: Registered PF_INET6 protocol family
[    4.571587] Segment Routing with IPv6
[    4.574311] In-situ OAM (IOAM) with IPv6
[    4.576898] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    4.595487] NET: Registered PF_PACKET protocol family
[    5.147893] clk: Disabling unused clocks
[    5.149155] ALSA device list:
[    5.149634]   No soundcards found.
[    5.162803] Freeing unused kernel image (initmem) memory: 268K
[    5.163429] Kernel memory protection not selected by kernel config.
[    5.164185] Run /init as init process
@Rajnesh28
Copy link

How long did you wait after the last line printed before declaring the simulation as dead? Waiting for the busy box output to come alive after [...] Run /init as init process] can take a while in simulation.

I have never used the litex_vexriscv_usbhost_defconfig configuration for the Image (I have never looked into what it was even really for), but I have had success with litex_vexriscv_defconfig in both hardware and simulation in-case you're interested in trying that instead.

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

No branches or pull requests

2 participants