Added access to VWriteBE from python

This commit is contained in:
Simon Southwell 2024-04-27 08:49:29 +01:00
commit 3cfea83aa5
3 changed files with 23 additions and 0 deletions

View file

@ -25,6 +25,7 @@
// Define pointers to the external API functions
static wfunc_p Vwrite;
static wbefunc_p VwriteBE;
static rfunc_p Vread;
static wbfunc_p VburstWrite;
static rbfunc_p VburstRead;
@ -56,6 +57,12 @@ static int BindToApiFuncs(void)
fprintf(stderr, "***ERROR: failed to find symbol VWrite\n");
return 1;
}
if ((VwriteBE = (wfunc_p)dlsym(hdl, "VWriteBE")) == NULL)
{
fprintf(stderr, "***ERROR: failed to find symbol VWriteBE\n");
return 1;
}
if ((Vread = (rfunc_p)dlsym(hdl, "VRead")) == NULL)
{
@ -207,6 +214,15 @@ uint32_t PyWrite (const uint32_t addr, const uint32_t data, const int delta, con
return Vwrite(addr, data, delta, node);
}
// ------------------------------------------------------------
// VWriteBE wrapper function for Python
// ------------------------------------------------------------
uint32_t PyWriteBE (const uint32_t addr, const uint32_t data, const uint32_t be, const int delta, const uint32_t node)
{
return VwriteBE(addr, data, be, delta, node);
}
// ------------------------------------------------------------
// VRead wrapper function for Python
// ------------------------------------------------------------

View file

@ -33,6 +33,7 @@
// Pointer types for external API functions. Must match prototypes in VUser.h
typedef int (*wfunc_p) (const unsigned, const unsigned, const int, const unsigned);
typedef int (*wbefunc_p) (const unsigned, const unsigned, const unsigned, const int, const unsigned);
typedef int (*rfunc_p) (const unsigned, unsigned *, const int, const unsigned);
typedef int (*wbfunc_p) (const unsigned, void *, const unsigned, const unsigned);
typedef int (*rbfunc_p) (const unsigned, void *, const unsigned, const unsigned);
@ -44,6 +45,7 @@ typedef uint32_t (*pyfetchirq_p) (void *, const uint32_t);
// API functions called from python
int RunPython (const int node);
uint32_t PyWrite (const uint32_t addr, const uint32_t data, const int delta, const uint32_t node);
uint32_t PyWriteBE (const uint32_t addr, const uint32_t data, const uint32_t be, const int delta, const uint32_t node);
uint32_t PyRead (const uint32_t addr, const int delta, const uint32_t node);
uint32_t PyTick (const uint32_t ticks, const uint32_t node);
uint32_t PyBurstWrite (const uint32_t addr, void *data, const uint32_t len, const uint32_t node);