SystemVerilog API
The SystemVerilog API provides two levels of Python API access:
Direct access to the Python C API
An abstracted class-based convenience API
Class-Based API
-
class py_object
Convenience wrapper class for PyObject handles
Subclassed by py_dict, py_list, py_tuple
Public Functions
-
virtual void dispose()
Drops ownership of handle
-
virtual py_object call(py_tuple args = null, py_object kwargs = null)
Calls the object as a Python callable
-
py_iter iter()
Creates an iterator for the given object
-
virtual py_object call_attr(string name, py_tuple args = null, py_object kwargs = null)
Calls a named attribute of the object as a method
-
virtual int to_int()
Obtains the integer value of this object and releases ownership
-
virtual longint to_long()
Obtains the long-int value of this object and releases ownership
-
virtual void to_void()
Disposes of the object
-
virtual string to_str()
Obtains the string value of the object and disposes of the object
-
int as_int()
Obtains the integer value of the object
-
longint as_long()
Obtains the long-int value of the object
-
virtual string as_str()
Obtains the string value of the object
-
virtual void dispose()
-
class py_list : public py_object
Public Functions
-
int size()
Returns the number of elements in the list
-
int size()
Utility Methods
-
py_object py_call_builtin(string name, py_tuple args, py_dict kwargs = null)
Call a built-in function
-
void py_gil_enter()
Acquire the GIL
-
void py_gil_leave()
Release the GIL