sdfgen 0.21.0__cp310-cp310-musllinux_1_2_x86_64.whl → 0.23.0__cp310-cp310-musllinux_1_2_x86_64.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.
Binary file
libcsdfgen.so CHANGED
Binary file
libcsdfgen.so.0 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, c_uint32]
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__(self, name: str, vcpus: List[Vcpu], priority: Optional[int] = None):
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
- class Perms:
517
- def __init__(self, *, r: bool = False, w: bool = False, x: bool = False):
518
- self.read = r
519
- self.write = w
520
- self.execute = x
521
-
522
- def _to_c_bindings(self) -> int:
523
- c_perms = 0
524
- if self.read:
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
- return c_perms
552
+ return c_perms
532
553
 
533
554
  def __init__(
534
555
  self,
535
556
  mr: SystemDescription.MemoryRegion,
536
557
  vaddr: int,
537
- perms: Perms,
558
+ perms: str,
538
559
  *,
539
560
  cached: bool = True,
540
561
  ) -> None:
541
- self._obj = libsdfgen.sdfgen_map_create(mr._obj, vaddr, perms._to_c_bindings(), cached)
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(self, client: SystemDescription.ProtectionDomain, *, partition: int):
806
- ret = libsdfgen.sdfgen_sddf_blk_add_client(self._obj, client._obj, partition)
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
1
  Metadata-Version: 2.1
2
2
  Name: sdfgen
3
- Version: 0.21.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
@@ -13,8 +13,9 @@ Microkit-based systems.
13
13
  > [!IMPORTANT]
14
14
  > This project is experimental, we are using it internally to get it into a
15
15
  > usable state for the public. For development this work exists in a separate
16
- > repository, but that may change once it has matured (e.g by being apart of the
17
- > official Microkit repository).
16
+ > repository, but that may change once it has matured (e.g by the Microkit part
17
+ > of the tooling part of the official Microkit repository, the sDDF part being
18
+ > in the sDDF repository, etc).
18
19
 
19
20
  ## Use
20
21
 
@@ -45,10 +46,7 @@ Pre-built archives of the C library are available in each
45
46
 
46
47
  ### Dependencies
47
48
 
48
- * Zig (`0.14.0-dev.3050+d72f3d353` or higher)
49
- * See https://ziglang.org/download/, until 0.14.0 is released we rely on a
50
- master version of Zig. Once 0.14.0 is released (most likely Feb'25) we can
51
- pin to that release.
49
+ * [Zig 0.14.0](https://ziglang.org/download)
52
50
 
53
51
  ### C library (libcsdfgen)
54
52
 
@@ -0,0 +1,11 @@
1
+ libcsdfgen.so,sha256=HpISY_VaewroQgxbSCm2VyKOmndMdWDh1OZesTsvppA,5406080
2
+ libcsdfgen.so.0.23.0,sha256=HpISY_VaewroQgxbSCm2VyKOmndMdWDh1OZesTsvppA,5406080
3
+ csdfgen.cpython-310-x86_64-linux-gnu.so,sha256=HpISY_VaewroQgxbSCm2VyKOmndMdWDh1OZesTsvppA,5406080
4
+ libcsdfgen.so.0,sha256=HpISY_VaewroQgxbSCm2VyKOmndMdWDh1OZesTsvppA,5406080
5
+ sdfgen/module.py,sha256=cSiUZFdti5PtaqWLWA2sEmtkqgE8Bf0qzPNDW2dcfZs,45021
6
+ sdfgen/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ sdfgen/__init__.py,sha256=_d7GGV8GhadIAEYP8uiJlez0yKtXnHMHdRkRzVMKS3c,143
8
+ sdfgen-0.23.0.dist-info/WHEEL,sha256=G6WAJh_GXUMYPkzQt82j5xHS9Nx3k6AYK5BZjp4Pr1U,112
9
+ sdfgen-0.23.0.dist-info/RECORD,,
10
+ sdfgen-0.23.0.dist-info/top_level.txt,sha256=M3gUW9vTMij10peQKgv1Qs0jZkdsk_PG0REFxuv6jNY,15
11
+ sdfgen-0.23.0.dist-info/METADATA,sha256=jdgZtxzPgHWJsNMvEK-EA8wttxf4qSl_L1acqGeSgbo,4458
@@ -1,11 +0,0 @@
1
- libcsdfgen.so,sha256=wvECax4EomvN4SaX1Ft-4mo7NY8zl00CcFCGWNdnkMc,5405072
2
- libcsdfgen.so.0.21.0,sha256=wvECax4EomvN4SaX1Ft-4mo7NY8zl00CcFCGWNdnkMc,5405072
3
- csdfgen.cpython-310-x86_64-linux-gnu.so,sha256=wvECax4EomvN4SaX1Ft-4mo7NY8zl00CcFCGWNdnkMc,5405072
4
- libcsdfgen.so.0,sha256=wvECax4EomvN4SaX1Ft-4mo7NY8zl00CcFCGWNdnkMc,5405072
5
- sdfgen-0.21.0.dist-info/WHEEL,sha256=G6WAJh_GXUMYPkzQt82j5xHS9Nx3k6AYK5BZjp4Pr1U,112
6
- sdfgen-0.21.0.dist-info/RECORD,,
7
- sdfgen-0.21.0.dist-info/top_level.txt,sha256=M3gUW9vTMij10peQKgv1Qs0jZkdsk_PG0REFxuv6jNY,15
8
- sdfgen-0.21.0.dist-info/METADATA,sha256=moRdWJtrjWC96q2cStIYoASv130Bh-DBMNIExPqfioQ,4563
9
- sdfgen/module.py,sha256=xV75IHPGivRXij-DriZFiUTrtWs5hpRUhryMdmQ99C8,44021
10
- sdfgen/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- sdfgen/__init__.py,sha256=_d7GGV8GhadIAEYP8uiJlez0yKtXnHMHdRkRzVMKS3c,143