I've been trying to get a basic example working and have hit a bug in gen_sv_class.py. It uses PyLong_AsLong() for c_uint64 fields when it should be using PyLong_AsUnsignedLongLong().
Any ctypes.Structure with a c_uint64 field set to a value >= 0x8000000000000000 causes the value to wrap. The struct_passing example doesn't hit this because it uses small values.
This possibly also affects: c_uint32 (line 1005) and c_uint16 (line 1003) which could have the same issue at their respective sign boundaries, though c_uint32 is cast via 32'() from a 64-bit signed value so it may accidentally work for values < 2^32.