always getting 'None' return value from PyObject_CallObject

Gal Aviel galaviel at yahoo.com
Sun Mar 23 19:43:54 EDT 2008


Hello all,

Kinda desperate over here .. Any help would be greatly appreciated !

I'm trying to embed a Python interpreter inside a Verilog simulator as a
SystemVerilog DPI application. The python side implements a few SV exported
tasks. I've got a thin C shared library as the dpi app; all it does it get the
task arguments from the simulator and hand those to the Python side using the 
Python C API.

I followed '5.3 Pure Embedding' under Python 2.5 documentation very closely.

When calling a function defined in my module, the function executes Ok - it sees
the correct arguments being passed from C, and executes 100% - only the return
value is always 'None' (I tried returning a simple integer like '5' which
doesn't work).

Any ideas?

Maybe scope issues? the module goes out of scope, and there is no place to store
the temporary return value from the function? Where is that stored anyway with
embedded python?

Thanks- Gal Aviel.









More information about the Python-list mailing list