sdfgen 0.21.0__cp310-cp310-macosx_14_0_arm64.whl → 0.22.0__cp310-cp310-macosx_14_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- csdfgen.cpython-310-darwin.so +0 -0
- libcsdfgen.0.21.0.dylib → libcsdfgen.0.22.0.dylib +0 -0
- libcsdfgen.0.dylib +0 -0
- libcsdfgen.dylib +0 -0
- sdfgen/module.py +42 -22
- {sdfgen-0.21.0.dist-info → sdfgen-0.22.0.dist-info}/METADATA +5 -7
- sdfgen-0.22.0.dist-info/RECORD +11 -0
- {sdfgen-0.21.0.dist-info → sdfgen-0.22.0.dist-info}/WHEEL +1 -1
- sdfgen-0.21.0.dist-info/RECORD +0 -11
- {sdfgen-0.21.0.dist-info → sdfgen-0.22.0.dist-info}/top_level.txt +0 -0
csdfgen.cpython-310-darwin.so
CHANGED
Binary file
|
Binary file
|
libcsdfgen.0.dylib
CHANGED
Binary file
|
libcsdfgen.dylib
CHANGED
Binary file
|
sdfgen/module.py
CHANGED
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
2
2
|
import ctypes
|
3
3
|
import importlib.util
|
4
4
|
from ctypes import (
|
5
|
-
cast, c_void_p, c_char_p, c_int8, c_uint8, c_uint32, c_uint64, c_bool, POINTER, byref, pointer
|
5
|
+
cast, c_void_p, c_char_p, c_int8, c_uint8, c_uint16, c_uint32, c_uint64, c_bool, POINTER, byref, pointer
|
6
6
|
)
|
7
7
|
from typing import Optional, List, Tuple
|
8
8
|
from enum import IntEnum
|
@@ -156,7 +156,7 @@ libsdfgen.sdfgen_sddf_blk_destroy.restype = None
|
|
156
156
|
libsdfgen.sdfgen_sddf_blk_destroy.argtypes = [c_void_p]
|
157
157
|
|
158
158
|
libsdfgen.sdfgen_sddf_blk_add_client.restype = c_uint32
|
159
|
-
libsdfgen.sdfgen_sddf_blk_add_client.argtypes = [c_void_p, c_void_p, c_uint32]
|
159
|
+
libsdfgen.sdfgen_sddf_blk_add_client.argtypes = [c_void_p, c_void_p, c_uint32, POINTER(c_uint16), POINTER(c_uint32)]
|
160
160
|
|
161
161
|
libsdfgen.sdfgen_sddf_blk_connect.restype = c_bool
|
162
162
|
libsdfgen.sdfgen_sddf_blk_connect.argtypes = [c_void_p]
|
@@ -203,7 +203,7 @@ libsdfgen.sdfgen_sddf_gpu_destroy.restype = None
|
|
203
203
|
libsdfgen.sdfgen_sddf_gpu_destroy.argtypes = [c_void_p]
|
204
204
|
|
205
205
|
libsdfgen.sdfgen_sddf_gpu_add_client.restype = c_uint32
|
206
|
-
libsdfgen.sdfgen_sddf_gpu_add_client.argtypes = [c_void_p, c_void_p
|
206
|
+
libsdfgen.sdfgen_sddf_gpu_add_client.argtypes = [c_void_p, c_void_p]
|
207
207
|
|
208
208
|
libsdfgen.sdfgen_sddf_gpu_connect.restype = c_bool
|
209
209
|
libsdfgen.sdfgen_sddf_gpu_connect.argtypes = [c_void_p]
|
@@ -302,6 +302,17 @@ def ffi_uint8_ptr(n: Optional[int]):
|
|
302
302
|
return pointer(c_uint8(n))
|
303
303
|
|
304
304
|
|
305
|
+
def ffi_uint16_ptr(n: Optional[int]):
|
306
|
+
"""
|
307
|
+
Convert an int value to a uint16_t pointer for FFI.
|
308
|
+
If 'n' is None then we return None (which acts as a null pointer)
|
309
|
+
"""
|
310
|
+
if n is None:
|
311
|
+
return None
|
312
|
+
|
313
|
+
return pointer(c_uint16(n))
|
314
|
+
|
315
|
+
|
305
316
|
def ffi_uint32_ptr(n: Optional[int]):
|
306
317
|
"""
|
307
318
|
Convert an int value to a uint32_t pointer for FFI.
|
@@ -513,32 +524,28 @@ class SystemDescription:
|
|
513
524
|
class Map:
|
514
525
|
_obj: c_void_p
|
515
526
|
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
c_perms |= 0b001
|
526
|
-
if self.write:
|
527
|
-
c_perms |= 0b010
|
528
|
-
if self.execute:
|
529
|
-
c_perms |= 0b100
|
527
|
+
@staticmethod
|
528
|
+
def _perms_to_c_bindings(s: str) -> int:
|
529
|
+
c_perms = 0
|
530
|
+
if "r" in s:
|
531
|
+
c_perms |= 0b001
|
532
|
+
if "w" in s:
|
533
|
+
c_perms |= 0b010
|
534
|
+
if "x" in s:
|
535
|
+
c_perms |= 0b100
|
530
536
|
|
531
|
-
|
537
|
+
return c_perms
|
532
538
|
|
533
539
|
def __init__(
|
534
540
|
self,
|
535
541
|
mr: SystemDescription.MemoryRegion,
|
536
542
|
vaddr: int,
|
537
|
-
perms:
|
543
|
+
perms: str,
|
538
544
|
*,
|
539
545
|
cached: bool = True,
|
540
546
|
) -> None:
|
541
|
-
|
547
|
+
c_perms = SystemDescription.Map._perms_to_c_bindings(perms)
|
548
|
+
self._obj = libsdfgen.sdfgen_map_create(mr._obj, vaddr, c_perms, cached)
|
542
549
|
if self._obj is None:
|
543
550
|
raise Exception("failed to create mapping")
|
544
551
|
|
@@ -802,8 +809,21 @@ class Sddf:
|
|
802
809
|
if self._obj is None:
|
803
810
|
raise Exception("failed to create blk system")
|
804
811
|
|
805
|
-
def add_client(
|
806
|
-
|
812
|
+
def add_client(
|
813
|
+
self,
|
814
|
+
client: SystemDescription.ProtectionDomain,
|
815
|
+
*,
|
816
|
+
partition: int,
|
817
|
+
queue_capacity: Optional[int] = None,
|
818
|
+
data_size: Optional[int] = None
|
819
|
+
):
|
820
|
+
ret = libsdfgen.sdfgen_sddf_blk_add_client(
|
821
|
+
self._obj,
|
822
|
+
client._obj,
|
823
|
+
partition,
|
824
|
+
ffi_uint16_ptr(queue_capacity),
|
825
|
+
ffi_uint32_ptr(data_size)
|
826
|
+
)
|
807
827
|
if ret == SddfStatus.OK:
|
808
828
|
return
|
809
829
|
elif ret == SddfStatus.DUPLICATE_CLIENT:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: sdfgen
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.22.0
|
4
4
|
Summary: Automating the creation of Microkit System Description Files (SDF)
|
5
5
|
Home-page: https://github.com/au-ts/microkit_sdf_gen
|
6
6
|
Description-Content-Type: text/markdown
|
@@ -17,8 +17,9 @@ Microkit-based systems.
|
|
17
17
|
> [!IMPORTANT]
|
18
18
|
> This project is experimental, we are using it internally to get it into a
|
19
19
|
> usable state for the public. For development this work exists in a separate
|
20
|
-
> repository, but that may change once it has matured (e.g by
|
21
|
-
> official Microkit repository
|
20
|
+
> repository, but that may change once it has matured (e.g by the Microkit part
|
21
|
+
> of the tooling part of the official Microkit repository, the sDDF part being
|
22
|
+
> in the sDDF repository, etc).
|
22
23
|
|
23
24
|
## Use
|
24
25
|
|
@@ -49,10 +50,7 @@ Pre-built archives of the C library are available in each
|
|
49
50
|
|
50
51
|
### Dependencies
|
51
52
|
|
52
|
-
* Zig
|
53
|
-
* See https://ziglang.org/download/, until 0.14.0 is released we rely on a
|
54
|
-
master version of Zig. Once 0.14.0 is released (most likely Feb'25) we can
|
55
|
-
pin to that release.
|
53
|
+
* [Zig 0.14.0](https://ziglang.org/download)
|
56
54
|
|
57
55
|
### C library (libcsdfgen)
|
58
56
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
csdfgen.cpython-310-darwin.so,sha256=cLaJ9oDzKTmd-kYqiZ33NL645KzTcO_SjRm7kL0g3jM,863368
|
2
|
+
libcsdfgen.0.22.0.dylib,sha256=cLaJ9oDzKTmd-kYqiZ33NL645KzTcO_SjRm7kL0g3jM,863368
|
3
|
+
libcsdfgen.0.dylib,sha256=cLaJ9oDzKTmd-kYqiZ33NL645KzTcO_SjRm7kL0g3jM,863368
|
4
|
+
libcsdfgen.dylib,sha256=cLaJ9oDzKTmd-kYqiZ33NL645KzTcO_SjRm7kL0g3jM,863368
|
5
|
+
sdfgen/__init__.py,sha256=_d7GGV8GhadIAEYP8uiJlez0yKtXnHMHdRkRzVMKS3c,143
|
6
|
+
sdfgen/module.py,sha256=muoa7d4_LCOESh1DjxiQ1m5w9W-J-JtdwuhcJeWSljE,44458
|
7
|
+
sdfgen/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
sdfgen-0.22.0.dist-info/METADATA,sha256=s4PhR_4TZJKSh43BIFni3jDj2Z55csAqBD8bO-C7om8,4549
|
9
|
+
sdfgen-0.22.0.dist-info/WHEEL,sha256=3PtDnICF55ygkvWSvGBLrYkorYQ1fQb0sr6jkfHtodU,109
|
10
|
+
sdfgen-0.22.0.dist-info/top_level.txt,sha256=M3gUW9vTMij10peQKgv1Qs0jZkdsk_PG0REFxuv6jNY,15
|
11
|
+
sdfgen-0.22.0.dist-info/RECORD,,
|
sdfgen-0.21.0.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
csdfgen.cpython-310-darwin.so,sha256=WmQZjIMKT3eME7AxFQRkWM2nzww2et0EWJhShVVi_z0,863384
|
2
|
-
libcsdfgen.0.21.0.dylib,sha256=WmQZjIMKT3eME7AxFQRkWM2nzww2et0EWJhShVVi_z0,863384
|
3
|
-
libcsdfgen.0.dylib,sha256=WmQZjIMKT3eME7AxFQRkWM2nzww2et0EWJhShVVi_z0,863384
|
4
|
-
libcsdfgen.dylib,sha256=WmQZjIMKT3eME7AxFQRkWM2nzww2et0EWJhShVVi_z0,863384
|
5
|
-
sdfgen/__init__.py,sha256=_d7GGV8GhadIAEYP8uiJlez0yKtXnHMHdRkRzVMKS3c,143
|
6
|
-
sdfgen/module.py,sha256=xV75IHPGivRXij-DriZFiUTrtWs5hpRUhryMdmQ99C8,44021
|
7
|
-
sdfgen/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
sdfgen-0.21.0.dist-info/METADATA,sha256=iycD4r1V3CoTlEPAWoUI_87zkgyoVgChvBvLRrwLD4A,4654
|
9
|
-
sdfgen-0.21.0.dist-info/WHEEL,sha256=klg0lqQAFwAFb2kWcAdoV20BbGKUs51e_pLHMDjToSo,109
|
10
|
-
sdfgen-0.21.0.dist-info/top_level.txt,sha256=M3gUW9vTMij10peQKgv1Qs0jZkdsk_PG0REFxuv6jNY,15
|
11
|
-
sdfgen-0.21.0.dist-info/RECORD,,
|
File without changes
|