sdfgen 0.21.0__cp312-cp312-macosx_14_0_arm64.whl → 0.23.0__cp312-cp312-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-312-darwin.so +0 -0
- libcsdfgen.0.21.0.dylib → libcsdfgen.0.23.0.dylib +0 -0
- libcsdfgen.0.dylib +0 -0
- libcsdfgen.dylib +0 -0
- sdfgen/module.py +58 -23
- {sdfgen-0.21.0.dist-info → sdfgen-0.23.0.dist-info}/METADATA +6 -8
- sdfgen-0.23.0.dist-info/RECORD +11 -0
- {sdfgen-0.21.0.dist-info → sdfgen-0.23.0.dist-info}/WHEEL +1 -1
- sdfgen-0.21.0.dist-info/RECORD +0 -11
- {sdfgen-0.21.0.dist-info → sdfgen-0.23.0.dist-info}/top_level.txt +0 -0
csdfgen.cpython-312-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
|
@@ -103,6 +103,10 @@ libsdfgen.sdfgen_vm_destroy.argtypes = [c_void_p]
|
|
103
103
|
|
104
104
|
libsdfgen.sdfgen_vm_set_priority.restype = None
|
105
105
|
libsdfgen.sdfgen_vm_set_priority.argtypes = [c_void_p, c_uint8]
|
106
|
+
libsdfgen.sdfgen_vm_set_budget.restype = None
|
107
|
+
libsdfgen.sdfgen_vm_set_budget.argtypes = [c_void_p, c_uint32]
|
108
|
+
libsdfgen.sdfgen_vm_set_period.restype = None
|
109
|
+
libsdfgen.sdfgen_vm_set_period.argtypes = [c_void_p, c_uint32]
|
106
110
|
|
107
111
|
libsdfgen.sdfgen_vm_add_map.restype = None
|
108
112
|
libsdfgen.sdfgen_vm_add_map.argtypes = [c_void_p, c_void_p]
|
@@ -156,7 +160,7 @@ libsdfgen.sdfgen_sddf_blk_destroy.restype = None
|
|
156
160
|
libsdfgen.sdfgen_sddf_blk_destroy.argtypes = [c_void_p]
|
157
161
|
|
158
162
|
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]
|
163
|
+
libsdfgen.sdfgen_sddf_blk_add_client.argtypes = [c_void_p, c_void_p, c_uint32, POINTER(c_uint16), POINTER(c_uint32)]
|
160
164
|
|
161
165
|
libsdfgen.sdfgen_sddf_blk_connect.restype = c_bool
|
162
166
|
libsdfgen.sdfgen_sddf_blk_connect.argtypes = [c_void_p]
|
@@ -203,7 +207,7 @@ libsdfgen.sdfgen_sddf_gpu_destroy.restype = None
|
|
203
207
|
libsdfgen.sdfgen_sddf_gpu_destroy.argtypes = [c_void_p]
|
204
208
|
|
205
209
|
libsdfgen.sdfgen_sddf_gpu_add_client.restype = c_uint32
|
206
|
-
libsdfgen.sdfgen_sddf_gpu_add_client.argtypes = [c_void_p, c_void_p
|
210
|
+
libsdfgen.sdfgen_sddf_gpu_add_client.argtypes = [c_void_p, c_void_p]
|
207
211
|
|
208
212
|
libsdfgen.sdfgen_sddf_gpu_connect.restype = c_bool
|
209
213
|
libsdfgen.sdfgen_sddf_gpu_connect.argtypes = [c_void_p]
|
@@ -302,6 +306,17 @@ def ffi_uint8_ptr(n: Optional[int]):
|
|
302
306
|
return pointer(c_uint8(n))
|
303
307
|
|
304
308
|
|
309
|
+
def ffi_uint16_ptr(n: Optional[int]):
|
310
|
+
"""
|
311
|
+
Convert an int value to a uint16_t pointer for FFI.
|
312
|
+
If 'n' is None then we return None (which acts as a null pointer)
|
313
|
+
"""
|
314
|
+
if n is None:
|
315
|
+
return None
|
316
|
+
|
317
|
+
return pointer(c_uint16(n))
|
318
|
+
|
319
|
+
|
305
320
|
def ffi_uint32_ptr(n: Optional[int]):
|
306
321
|
"""
|
307
322
|
Convert an int value to a uint32_t pointer for FFI.
|
@@ -489,7 +504,14 @@ class SystemDescription:
|
|
489
504
|
def __init__(self, *, id: int, cpu: Optional[int] = None):
|
490
505
|
self._obj = libsdfgen.sdfgen_vm_vcpu_create(id, ffi_uint8_ptr(cpu))
|
491
506
|
|
492
|
-
def __init__(
|
507
|
+
def __init__(
|
508
|
+
self,
|
509
|
+
name: str,
|
510
|
+
vcpus: List[Vcpu],
|
511
|
+
priority: Optional[int] = None,
|
512
|
+
budget: Optional[int] = None,
|
513
|
+
period: Optional[int] = None,
|
514
|
+
):
|
493
515
|
vcpus_tuple: Tuple[c_void_p] = tuple([vcpu._obj for vcpu in vcpus])
|
494
516
|
c_vcpus = (c_void_p * len(vcpus))(*vcpus_tuple)
|
495
517
|
c_name = c_char_p(name.encode("utf-8"))
|
@@ -499,6 +521,10 @@ class SystemDescription:
|
|
499
521
|
raise Exception("failed to create VM")
|
500
522
|
if priority is not None:
|
501
523
|
libsdfgen.sdfgen_vm_set_priority(self._obj, priority)
|
524
|
+
if budget is not None:
|
525
|
+
libsdfgen.sdfgen_vm_set_budget(self._obj, budget)
|
526
|
+
if period is not None:
|
527
|
+
libsdfgen.sdfgen_vm_set_period(self._obj, period)
|
502
528
|
|
503
529
|
@property
|
504
530
|
def name(self) -> str:
|
@@ -513,32 +539,28 @@ class SystemDescription:
|
|
513
539
|
class Map:
|
514
540
|
_obj: c_void_p
|
515
541
|
|
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
|
542
|
+
@staticmethod
|
543
|
+
def _perms_to_c_bindings(s: str) -> int:
|
544
|
+
c_perms = 0
|
545
|
+
if "r" in s:
|
546
|
+
c_perms |= 0b001
|
547
|
+
if "w" in s:
|
548
|
+
c_perms |= 0b010
|
549
|
+
if "x" in s:
|
550
|
+
c_perms |= 0b100
|
530
551
|
|
531
|
-
|
552
|
+
return c_perms
|
532
553
|
|
533
554
|
def __init__(
|
534
555
|
self,
|
535
556
|
mr: SystemDescription.MemoryRegion,
|
536
557
|
vaddr: int,
|
537
|
-
perms:
|
558
|
+
perms: str,
|
538
559
|
*,
|
539
560
|
cached: bool = True,
|
540
561
|
) -> None:
|
541
|
-
|
562
|
+
c_perms = SystemDescription.Map._perms_to_c_bindings(perms)
|
563
|
+
self._obj = libsdfgen.sdfgen_map_create(mr._obj, vaddr, c_perms, cached)
|
542
564
|
if self._obj is None:
|
543
565
|
raise Exception("failed to create mapping")
|
544
566
|
|
@@ -802,8 +824,21 @@ class Sddf:
|
|
802
824
|
if self._obj is None:
|
803
825
|
raise Exception("failed to create blk system")
|
804
826
|
|
805
|
-
def add_client(
|
806
|
-
|
827
|
+
def add_client(
|
828
|
+
self,
|
829
|
+
client: SystemDescription.ProtectionDomain,
|
830
|
+
*,
|
831
|
+
partition: int,
|
832
|
+
queue_capacity: Optional[int] = None,
|
833
|
+
data_size: Optional[int] = None
|
834
|
+
):
|
835
|
+
ret = libsdfgen.sdfgen_sddf_blk_add_client(
|
836
|
+
self._obj,
|
837
|
+
client._obj,
|
838
|
+
partition,
|
839
|
+
ffi_uint16_ptr(queue_capacity),
|
840
|
+
ffi_uint32_ptr(data_size)
|
841
|
+
)
|
807
842
|
if ret == SddfStatus.OK:
|
808
843
|
return
|
809
844
|
elif ret == SddfStatus.DUPLICATE_CLIENT:
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: sdfgen
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.23.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-312-darwin.so,sha256=o3YqFpECb4-CHmHS4efckqc6tXNeTU0U_2fpNfVnRkw,863608
|
2
|
+
libcsdfgen.0.23.0.dylib,sha256=o3YqFpECb4-CHmHS4efckqc6tXNeTU0U_2fpNfVnRkw,863608
|
3
|
+
libcsdfgen.0.dylib,sha256=o3YqFpECb4-CHmHS4efckqc6tXNeTU0U_2fpNfVnRkw,863608
|
4
|
+
libcsdfgen.dylib,sha256=o3YqFpECb4-CHmHS4efckqc6tXNeTU0U_2fpNfVnRkw,863608
|
5
|
+
sdfgen/__init__.py,sha256=_d7GGV8GhadIAEYP8uiJlez0yKtXnHMHdRkRzVMKS3c,143
|
6
|
+
sdfgen/module.py,sha256=cSiUZFdti5PtaqWLWA2sEmtkqgE8Bf0qzPNDW2dcfZs,45021
|
7
|
+
sdfgen/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
sdfgen-0.23.0.dist-info/METADATA,sha256=u_squeTY8tciegseUvvMluk4sOuiFGm5KYF6gL1zbRk,4549
|
9
|
+
sdfgen-0.23.0.dist-info/WHEEL,sha256=Duh07W_64_yan9sqf6ToaLAzjDscOfQBCYC6FAxuAVY,109
|
10
|
+
sdfgen-0.23.0.dist-info/top_level.txt,sha256=M3gUW9vTMij10peQKgv1Qs0jZkdsk_PG0REFxuv6jNY,15
|
11
|
+
sdfgen-0.23.0.dist-info/RECORD,,
|
sdfgen-0.21.0.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
csdfgen.cpython-312-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=eAqXk-QNBMa5-MfZIK8Gt6rbgF1MQwY75KCK1Npp_q0,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
|