Ejemplo n.º 1
0
#!/usr/bin/python3

from ti.icss import Icss
from ctypes import c_uint32
import struct

pruss = Icss( "/dev/uio/pruss/module" )
pruss.initialize()

core = pruss.core0

# load program
with open('pruss-elf-test-fw/test.out', 'rb') as f:
    pruss.elf_load( core, f.read() )

# map shared memory
shmem = pruss.dram2.map( c_uint32 )

print( shmem.value )

core.run()

print( "waiting for core to halt" )
while not core.halted:
    pass

print( shmem.value )
Ejemplo n.º 2
0
#!/usr/bin/python3

import sys
sys.path.insert(0, '../src')

from ti.icss import Icss
from uio import Uio
import ctypes

EVENT0 = 16  # range 16..31
EVENT1 = 17  # range 16..31
IRQ = 2  # range 2..9

pruss = Icss("/dev/uio/pruss/module")
irq = Uio("/dev/uio/pruss/irq%d" % IRQ)
intc = pruss.intc
(core0, core1) = pruss.cores

pruss.initialize()

# clear and enable events and route them to our irq
for event in EVENT0, EVENT1:
    intc.ev_ch[event] = IRQ
    intc.ev_clear_one(event)
    intc.ev_enable_one(event)

# load program onto both cores
core0.load('fw/intc-test.bin')
core1.load('fw/intc-test.bin')