Forum Discussion
Altera_Forum
Honored Contributor
12 years agoOpenCL + Cyclone V SoC
Hello, Whilst I have lots of experience with embedded ARM C/Linux I'm new to FPGAs and new to OpenCL. I have a SoCKit plus some no doubt dumb questions: 1. It seems C2H is no longer suppor...
Altera_Forum
Honored Contributor
12 years agoHi all again
I have managed to make /dev/acl to pop up. I thought the driver created it dynamically (alloc_chrdev_region->class_create->device_create) but aclsoc_load script showed me I was wrong. After "mknodding" the entry /dev/acl was ready. Then I run "user" program and it segfaults during mmap test. This is "user" program output ... root@socfpga:~/AOCL/host/driver# ./user Opened the device: file handle# 3! Wrote 19, read back 19 ua[0] = 0, ub[0] = 0 ua[1] = 13, ub[1] = 13 ua[2] = 26, ub[2] = 26 ua[3] = 39, ub[3] = 39 ua[4] = 52, ub[4] = 52 ua[5] = 65, ub[5] = 65 ua[6] = 78, ub[6] = 78 ua[7] = 91, ub[7] = 91 ua[8] = 104, ub[8] = 104 ua[9] = 117, ub[9] = 117 test_small_writes PASSED Done test_page_write with 12288 bytes Segmentation fault ... And dmesg output... ... aclsoc_open (145): aclsoc = bf1be800, pid = 8285 (user)<7> aclsoc_contig_alloc: asked for 7340032, allocating 8388608 bytes ibuf = 0, buf = bcc00000, cur_size = 4194304 ibuf = 1, buf = bbc00000, cur_size = 4194304 Allocation failed. Freeing buffers from 1 to 0 inclusive aclsoc_mmap (629): Remapping 7340032 bytes. Got (null) from allocator. aclsoc_close (191): aclsoc = bf1be800, pid = 8285, dma_idle = 1<7> ... By the way. Driver can be successfully loaded (no IRQ problems) if you change IRQ from 72 to another number (I tried 70 and it worked) ... aclsoc_init (826): ----------------------------<7> aclsoc_init (827): Driver version: 13.1.1<7> aclsoc_probe (705): acl_board_id is 4, ACL_PCI_CRA_BAR is 0, PAGE_SIZE is 4096<7> init_chrdev (130): aclsoc = 251:0<7> mapped region 0 (lw) to [c0e80000, c0ea0000). Size = 131072 mapped region 2 (lw) to [c0e00000, c0e40000). Size = 262144 mapped ffc25000 to c0e60000 Writing 0x3fff to offset 0x80 Writing 0x0 to offset 0x7c Setting applycfg bit to 1 ALT_SDR_CTL_CTLCFG_OFST = 0xa8c42 ALT_SDR_CTL_CTLWIDTH = 0x2 ALT_SDR_CTL_PORTCFG = 0x0 ALT_SDR_CTL_FPGAPORTRST = 0x3fff ALT_SDR_CTL_REMAPPRIORITY = 0x0 ALT_SDR_CTL_CPORTWIDTH = 0x44000 ALT_SDR_CTL_CPORTWMAP = 0x2c000000 ALT_SDR_CTL_CPORTRMAP = 0xb00000 ALT_SDR_CTL_WFIFOCMAP = 0x980000 ALT_SDR_CTL_RFIFOCMAP = 0x760000 fpga_mgr mapped to c08f8000, fpga_mgr_data mapped to c08fa000 init_irq (288): aclsoc = bf1bf400<7> init_irq (289): get_interrupt_enable_addr = c0e04050<7> init_irq (308): Succesfully requested IRQ# 70<7> .... root@socfpga:~/AOCL/host/driver# cat /proc/devices Character devices: 1 mem 2 pty 3 ttyp 4 /dev/vc/0 4 tty 4 ttyS 5 /dev/tty 5 /dev/console 5 /dev/ptmx 7 vcs 10 misc 13 input 89 i2c 90 mtd 128 ptm 136 pts 153 spi 180 usb 189 usb_device 251 acl 252 ttyLCD 253 rtc 254 fpga .... root@socfpga:~/AOCL/host/driver# cat /proc/interrupts CPU0 CPU1 29: 1571586 1571346 GIC twd 70: 0 0 GIC aclsoc_drv 152: 8612 0 GIC eth0 160: 1 0 GIC dwc_otg, dwc_otg_hcd:usb1 171: 110332 0 GIC dw-mci 183: 0 0 GIC ff705000.flash 190: 22 0 GIC ffc04000.i2c 194: 35 0 GIC serial 201: 17 0 GIC timer 207: 0 0 GIC fpga-mgr IPI0: 0 0 CPU wakeup interrupts IPI1: 0 0 Timer broadcast interrupts IPI2: 26080 25744 Rescheduling interrupts IPI3: 0 0 Function call interrupts IPI4: 2 2 Single function call interrupts IPI5: 0 0 CPU stop interrupts Err: 0 Next steps, anyone? :-) Thanks In Advance