esiaccel 0.0.17.dev722__cp39-cp39-win_amd64.whl → 0.1.0__cp39-cp39-win_amd64.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.

Potentially problematic release.


This version of esiaccel might be problematic. Click here for more details.

esiaccel/types.py CHANGED
@@ -20,6 +20,8 @@ if TYPE_CHECKING:
20
20
 
21
21
  from concurrent.futures import Future
22
22
  from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
23
+ import sys
24
+ import traceback
23
25
 
24
26
 
25
27
  def _get_esi_type(cpp_type: cpp.Type):
@@ -364,8 +366,12 @@ class BundlePort:
364
366
  # TODO: add a proper registration mechanism for service ports.
365
367
  if isinstance(cpp_port, cpp.Function):
366
368
  return super().__new__(FunctionPort)
369
+ if isinstance(cpp_port, cpp.Callback):
370
+ return super().__new__(CallbackPort)
367
371
  if isinstance(cpp_port, cpp.MMIORegion):
368
372
  return super().__new__(MMIORegion)
373
+ if isinstance(cpp_port, cpp.Telemetry):
374
+ return super().__new__(TelemetryPort)
369
375
  return super().__new__(cls)
370
376
 
371
377
  def __init__(self, owner: HWModule, cpp_port: cpp.BundlePort):
@@ -455,3 +461,52 @@ class FunctionPort(BundlePort):
455
461
 
456
462
  def __call__(self, *args: Any, **kwds: Any) -> Future:
457
463
  return self.call(*args, **kwds)
464
+
465
+
466
+ class CallbackPort(BundlePort):
467
+ """Callback ports are the inverse of function ports -- instead of calls to the
468
+ accelerator, they get called from the accelerator. Specify the function which
469
+ you'd like the accelerator to call when you call `connect`."""
470
+
471
+ def __init__(self, owner: HWModule, cpp_port: cpp.BundlePort):
472
+ super().__init__(owner, cpp_port)
473
+ self.arg_type = self.read_port("arg").type
474
+ self.result_type = self.write_port("result").type
475
+ self.connected = False
476
+
477
+ def connect(self, cb: Callable[[Any], Any]):
478
+
479
+ def type_convert_wrapper(cb: Callable[[Any], Any],
480
+ msg: bytearray) -> Optional[bytearray]:
481
+ try:
482
+ (obj, leftover) = self.arg_type.deserialize(msg)
483
+ if len(leftover) != 0:
484
+ raise ValueError(f"leftover bytes: {leftover}")
485
+ result = cb(obj)
486
+ if result is None:
487
+ return None
488
+ return self.result_type.serialize(result)
489
+ except Exception as e:
490
+ traceback.print_exception(e)
491
+ return None
492
+
493
+ self.cpp_port.connect(lambda x: type_convert_wrapper(cb=cb, msg=x))
494
+ self.connected = True
495
+
496
+
497
+ class TelemetryPort(BundlePort):
498
+ """Telemetry ports report an individual piece of information from the
499
+ acceelerator. The method of accessing telemetry will likely change in the
500
+ future."""
501
+
502
+ def __init__(self, owner: HWModule, cpp_port: cpp.BundlePort):
503
+ super().__init__(owner, cpp_port)
504
+ self.connected = False
505
+
506
+ def connect(self):
507
+ self.cpp_port.connect()
508
+ self.connected = True
509
+
510
+ def read(self) -> Future:
511
+ cpp_future = self.cpp_port.read()
512
+ return MessageFuture(self.cpp_port.type, cpp_future)
esiaccel/zlib1.dll CHANGED
Binary file
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: esiaccel
3
- Version: 0.0.17.dev722
3
+ Version: 0.1.0
4
4
  Summary: ESI accelerators runtime
5
5
  Author-email: John Demme <John.Demme@microsoft.com>
6
6
  License: ==============================================================================
@@ -251,4 +251,4 @@ Classifier: Programming Language :: Python :: 3.12
251
251
  Classifier: Programming Language :: Python :: 3.13
252
252
  Requires-Python: >=3.8
253
253
  License-File: LICENSE
254
-
254
+ Dynamic: license-file
@@ -0,0 +1,44 @@
1
+ esiaccel/CosimBackend.dll,sha256=XN_unAwTtpeodnFJNh5TLtZ8Kdzahww4oankwp9TiJI,7161344
2
+ esiaccel/CosimBackend.lib,sha256=dZgNr_bh6UBFYi1UKscDYE5Hen86dlqPYcuOgmxDmgM,4990738
3
+ esiaccel/ESICppRuntime.dll,sha256=dLgiFyNoCDbCD3RGBvzVeyqNKXI_qDuhlC8AsZa5Iiw,3691520
4
+ esiaccel/ESICppRuntime.lib,sha256=LGcoy18mUISBREvoqhSuylZ1CmosE0jzCjuss4wfXjs,14491514
5
+ esiaccel/__init__.py,sha256=C0GLqCQuF5g5qTzmAkf_YAHmBV2XAyiJad3Qz7h8u1g,562
6
+ esiaccel/accelerator.py,sha256=GM2FRZF_8nzAJ_7TSRSw_kaJCYWCHMK-cQD8ZZU8QVs,3071
7
+ esiaccel/codegen.py,sha256=uoYELtnIabVvgLeCABj-mWras0BvmSKABPH-cd9nDFk,6560
8
+ esiaccel/esiCppAccel.cp39-win_amd64.pyd,sha256=0H6gTcsB3XTb7ku7-1Rfrsr4qJKArKRPU3rBRThS1FU,464384
9
+ esiaccel/types.py,sha256=gfUgrX67KYFruX5xsj_wLNJCdwczzLpseyH71M86pW0,17047
10
+ esiaccel/utils.py,sha256=nzar3WALJC_RfmM5v0GeUev5So1-EAYuAMxG9jLj3eQ,1062
11
+ esiaccel/zlib1.dll,sha256=5uXUHHgEq2agW-2DTSqrT5ROU_o5ri4ayqztnVgkAbs,90624
12
+ esiaccel/bin/esi-cosim.py,sha256=Q-eW6S8m5fJsgY__-XlPXxXI8HHYsDDqjTNksrZcK60,13808
13
+ esiaccel/bin/esiquery.exe,sha256=usqCxpAqBoSbh9jMiSYuVfn5QGRuNzzFtBCm6hNgl74,436224
14
+ esiaccel/cmake/esiaccelConfig.cmake,sha256=ihqU8IJ4Y2zFJ6_fBsR8HA9dI6IblIb5fHyXV9BXYbI,579
15
+ esiaccel/cosim/Cosim_DpiPkg.sv,sha256=9qGn1VyAVrzBP5At1thV6xrovg0WghICD01Zz9J221E,3458
16
+ esiaccel/cosim/Cosim_Endpoint.sv,sha256=ri1fHdkiphe8S2-vm6Ru16rBGYiDiS1c8qeCAsl1diU,6498
17
+ esiaccel/cosim/Cosim_Manifest.sv,sha256=vl9b6XieEkP880IBw1ferekBnDJwFanZZggJJGertXM,1123
18
+ esiaccel/cosim/driver.cpp,sha256=DrEKkSN7Y_Hu7wcaUulH5mbC2L4yB9xLClRMeRUpzHM,3842
19
+ esiaccel/cosim/driver.sv,sha256=ro-j9GM164A1W0MDPkqYfEn3TUKHSqVvgjO31fnloQI,1428
20
+ esiaccel/include/esi/Accelerator.h,sha256=RhkZ2HeMZ0iHc5BkHdDWXoeg9J9lyPQciH5bWq5Qc_w,9772
21
+ esiaccel/include/esi/CLI.h,sha256=Nn8tHn_xtEfkrD7USE2tao6ktYOJ6xcbnhZkS9-ox0A,2540
22
+ esiaccel/include/esi/Common.h,sha256=GyB9S4GJn-1K4bZNWi6Fc5ftKsL2Y362QOsNYuCqk6I,5078
23
+ esiaccel/include/esi/Context.h,sha256=Tk_4nBDtTeVY62GfX4Cs_ZMIQstjSgrWHddN_PKANEA,2396
24
+ esiaccel/include/esi/Design.h,sha256=mU8OwpCYijiWSdDq17l45LMzZxBca93nosudWCXNHfQ,4922
25
+ esiaccel/include/esi/Engines.h,sha256=bbGbhXjYMpIpXh_DR0OS57zyGQUIDXh_S7xHX3su0Y0,4831
26
+ esiaccel/include/esi/Logging.h,sha256=sHqMcpp0lNIHkIEyvSm-BBWx4zXXh6NOATCgZpgzYI4,8944
27
+ esiaccel/include/esi/Manifest.h,sha256=j3v9UA0ogtJQBlv6k5s4j_3sCsq-gwF9btVg5dKTBlg,2244
28
+ esiaccel/include/esi/Ports.h,sha256=T2WbPBViUSvFbO5Jjxlcp_eGq9jMitguvNnz3O0564U,10543
29
+ esiaccel/include/esi/Services.h,sha256=NyeuBxBzmZLpDoikQsjI-ih5FfVivfepZU9Bt8oi0CE,14721
30
+ esiaccel/include/esi/Types.h,sha256=P4ExO8-zvm7qQocUmkM_ATIvamxtDZ8JT2ToLkFo1dk,5483
31
+ esiaccel/include/esi/Utils.h,sha256=KPd75GajIFeTBVJocXBjwsJqhbZg-ShWZCIe3oQdBss,3061
32
+ esiaccel/include/esi/backends/Cosim.h,sha256=s7vYd0ra6m1nvk-n37MjvBoGVI-CCUKBt0DU4PKlaHM,2838
33
+ esiaccel/include/esi/backends/RpcServer.h,sha256=WMwnhwU2qnrcglGNeiKg9QQHpkDx1QE1JydKYDK4jqE,1856
34
+ esiaccel/include/esi/backends/Trace.h,sha256=kx4wwLH3a0ndmRUdaDyYGZ1SP83zlpFrk30Nw8ZrJJA,3286
35
+ esiaccel/lib/EsiCosimDpiServer.dll,sha256=Q-65ADVkQjUdmx4tFOJ9cHFOqN3gLJcOVZgCdFRf8zc,160768
36
+ esiaccel/lib/EsiCosimDpiServer.lib,sha256=YrKxoXvBjmyrC-yJ7aq4_ePloA9p5X04oXjM8Ers1wY,604164
37
+ esiaccel/lib/MtiPli.dll,sha256=v6M9mADMyEjImY6V0kTdyMshCWAvqRVQUCym28C6hyc,14848
38
+ esiaccel/lib/MtiPli.lib,sha256=Q__4sWi51FSc2p1hDaN90G0HstSxRy07z0aaXGd2e_w,14570
39
+ esiaccel-0.1.0.dist-info/licenses/LICENSE,sha256=vtnVnB8_lN1yPYcA5MeT56R8UsQtBhyzZLBvu_KMf7I,13468
40
+ esiaccel-0.1.0.dist-info/METADATA,sha256=uKKxNFfPI2p2qDeatoqG61dx7uMtpgIOHSCPKrkC0VM,16141
41
+ esiaccel-0.1.0.dist-info/WHEEL,sha256=Ekw6eyh5fsv5ZDFyN8EhA_Lop9eSc00KViyfE3SoiIA,99
42
+ esiaccel-0.1.0.dist-info/entry_points.txt,sha256=_CuNLV0fyTURxRREFwpzGycifZW_-7-MyuJNEwKK9J8,137
43
+ esiaccel-0.1.0.dist-info/top_level.txt,sha256=fYWTWMDK4PDu4ePQ9NtcFHas2k8-d1kWhTs2avPpgB4,9
44
+ esiaccel-0.1.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.2)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp39-cp39-win_amd64
5
5
 
@@ -1,29 +0,0 @@
1
- esiaccel/ESICppRuntime.dll,sha256=YdGvvZ5L0uk2cxrFAt8mNO2t52gurOnxocBhx-GBXiU,3635712
2
- esiaccel/ESICppRuntime.lib,sha256=yZQJYNauXny6zFkm47O0aofHrW0THtmN0X2E90Vglgk,14292648
3
- esiaccel/__init__.py,sha256=C0GLqCQuF5g5qTzmAkf_YAHmBV2XAyiJad3Qz7h8u1g,562
4
- esiaccel/accelerator.py,sha256=GM2FRZF_8nzAJ_7TSRSw_kaJCYWCHMK-cQD8ZZU8QVs,3071
5
- esiaccel/codegen.py,sha256=uoYELtnIabVvgLeCABj-mWras0BvmSKABPH-cd9nDFk,6560
6
- esiaccel/esiCppAccel.cp39-win_amd64.pyd,sha256=b0URxA2FClaiwUReebx_NZ9hmpUeFcJdFS9tc2s4oq8,448000
7
- esiaccel/types.py,sha256=quV7bQFrweocGVCvwX_8KZd-Wz3Y0Yvi2YGCmihKvZM,15132
8
- esiaccel/utils.py,sha256=nzar3WALJC_RfmM5v0GeUev5So1-EAYuAMxG9jLj3eQ,1062
9
- esiaccel/zlib1.dll,sha256=xOP1G60LmKJd-j8iGXTvj7xrNA95sufVYoOGXEIfnQM,90624
10
- esiaccel/bin/esiquery.exe,sha256=M0cAuwBpYSy2JOWzScB-QwMVfk5BS9nLUjIsTHZiBos,424448
11
- esiaccel/cmake/esiaccelConfig.cmake,sha256=HcLuZRVSMGdr1ln6gsLTfo9iWCsAPf9wVLejnYqnpVE,564
12
- esiaccel/include/esi/Accelerator.h,sha256=RhkZ2HeMZ0iHc5BkHdDWXoeg9J9lyPQciH5bWq5Qc_w,9772
13
- esiaccel/include/esi/CLI.h,sha256=hqU1yAsp8tYmqvyeG-Ddi_mO0HxJ89KoQK2y-P6D6aQ,2317
14
- esiaccel/include/esi/Common.h,sha256=GyB9S4GJn-1K4bZNWi6Fc5ftKsL2Y362QOsNYuCqk6I,5078
15
- esiaccel/include/esi/Context.h,sha256=Tk_4nBDtTeVY62GfX4Cs_ZMIQstjSgrWHddN_PKANEA,2396
16
- esiaccel/include/esi/Design.h,sha256=mU8OwpCYijiWSdDq17l45LMzZxBca93nosudWCXNHfQ,4922
17
- esiaccel/include/esi/Logging.h,sha256=QUMzkFFIoPg8kERdvBSZ9OisBF_o18qRZm_6N8X-3V4,7441
18
- esiaccel/include/esi/Manifest.h,sha256=j3v9UA0ogtJQBlv6k5s4j_3sCsq-gwF9btVg5dKTBlg,2244
19
- esiaccel/include/esi/Ports.h,sha256=T2WbPBViUSvFbO5Jjxlcp_eGq9jMitguvNnz3O0564U,10543
20
- esiaccel/include/esi/Services.h,sha256=1bjsDS9JvrONlDTGyxkIXprQL2wGSWIayrlxstyaqw0,13278
21
- esiaccel/include/esi/Types.h,sha256=P4ExO8-zvm7qQocUmkM_ATIvamxtDZ8JT2ToLkFo1dk,5483
22
- esiaccel/include/esi/Utils.h,sha256=KPd75GajIFeTBVJocXBjwsJqhbZg-ShWZCIe3oQdBss,3061
23
- esiaccel/include/esi/backends/Trace.h,sha256=kx4wwLH3a0ndmRUdaDyYGZ1SP83zlpFrk30Nw8ZrJJA,3286
24
- esiaccel-0.0.17.dev722.dist-info/LICENSE,sha256=vtnVnB8_lN1yPYcA5MeT56R8UsQtBhyzZLBvu_KMf7I,13468
25
- esiaccel-0.0.17.dev722.dist-info/METADATA,sha256=1SUBaaqym4nWxrHAKgj7CvA819_EPU4_32nJNy1Ja3g,16128
26
- esiaccel-0.0.17.dev722.dist-info/WHEEL,sha256=2xSj8c4s_gFbWpcImYQptdXS3JLuzC2uK5Om8I_SEKg,100
27
- esiaccel-0.0.17.dev722.dist-info/entry_points.txt,sha256=_CuNLV0fyTURxRREFwpzGycifZW_-7-MyuJNEwKK9J8,137
28
- esiaccel-0.0.17.dev722.dist-info/top_level.txt,sha256=fYWTWMDK4PDu4ePQ9NtcFHas2k8-d1kWhTs2avPpgB4,9
29
- esiaccel-0.0.17.dev722.dist-info/RECORD,,