Executing Python code on bsg_replicant

11 views
Skip to first unread message

Amit Hiremath

unread,
Mar 10, 2025, 10:24:37 PM3/10/25
to black-parrot
I was going through this file: https://github.com/bespoke-silicon-group/bsg_replicant/blob/e952023cc498c54a26a9c828ae1c3843b133cc68/examples/python/test_loader/main.c I don't see any path, or binary where python code is executed on bsg_manycore/bsg_replicany hardware. I think when one types make regression, it starts executing on host machine (x86_x64)?  Perhaps I am misunderstanding something?

  

Dan Petrisko

unread,
Mar 10, 2025, 11:31:46 PM3/10/25
to Amit Hiremath, black-parrot
Hi,

The example code linked uses the python c++ bindings to call into a python interpreter. It was written for Amazon F1 over 5 years ago and is not maintained. There's a chance you could get it working for ARM / Zynq. There's a very slim chance you could get a micropython interpreter running on BlackParrot but my understanding is that porting is non-trivial

bsg_replicant in general uses a C++ runtime very similar to CUDA APIs i.e. copy data from host to device, execute, copy data from device to host. An example of a generic loader for a "single program, multiple data" RV32 program is here: https://github.com/bespoke-silicon-group/bsg_replicant/blob/main/examples/spmd/loader.c. This is what we use to bootstrap the ZynqParrot emulator for HammerBlade

Best,
-Dan





On Mon, Mar 10, 2025 at 7:24 PM 'Amit Hiremath' via black-parrot <black-...@googlegroups.com> wrote:
I was going through this file: https://github.com/bespoke-silicon-group/bsg_replicant/blob/e952023cc498c54a26a9c828ae1c3843b133cc68/examples/python/test_loader/main.c I don't see any path, or binary where python code is executed on bsg_manycore/bsg_replicany hardware. I think when one types make regression, it starts executing on host machine (x86_x64)?  Perhaps I am misunderstanding something?

  

--
You received this message because you are subscribed to the Google Groups "black-parrot" group.
To unsubscribe from this group and stop receiving emails from it, send an email to black-parrot...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/black-parrot/cfd1c974-c4fd-4ecd-926a-96f348d21c9en%40googlegroups.com.

Amit Hiremath

unread,
Mar 11, 2025, 12:39:22 AM3/11/25
to Dan Petrisko, black-parrot
Thanks Dan.  I know  bsg_replicant in general uses a C++ runtime API calls which are similar to CUDA. But my question was can we execute Python codes in RISCV core which are inside bsg_replicant, something like one could generate  main.riscv for python code and call this binary using bsg_replicant API for example:  https://github.com/bespoke-silicon-group/bsg_replicant/blob/main/examples/spmd/loader.c   ?
Reply all
Reply to author
Forward
0 new messages