esiaccel 0.1.5.dev93__cp39-cp39-win_amd64.whl → 0.1.5.dev104__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/CosimBackend.dll CHANGED
Binary file
esiaccel/CosimBackend.lib CHANGED
Binary file
Binary file
Binary file
Binary file
esiaccel/MtiPli.dll CHANGED
Binary file
esiaccel/__init__.py CHANGED
@@ -1,7 +1,8 @@
1
1
  # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2
2
  # See https://llvm.org/LICENSE.txt for license information.
3
3
  # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
-
4
+ import sys
5
+ import os
5
6
  from .accelerator import AcceleratorConnection
6
7
 
7
8
  from .esiCppAccel import (AppID, Type, BundleType, ChannelType, ArrayType,
@@ -11,3 +12,11 @@ __all__ = [
11
12
  "AcceleratorConnection", "AppID", "Type", "BundleType", "ChannelType",
12
13
  "ArrayType", "StructType", "BitsType", "UIntType", "SIntType"
13
14
  ]
15
+
16
+ if sys.platform == "win32":
17
+ """Ensure that ESI libraries are in the dll path on Windows. Necessary to
18
+ call when users build against the esiaccel-provided prebuilt CMake/prebuilt
19
+ libraries, before they are loaded via. python.
20
+ """
21
+ from .utils import get_dll_dir
22
+ os.add_dll_directory(str(get_dll_dir()))
Binary file
esiaccel/esiquery.exe CHANGED
Binary file
@@ -138,8 +138,8 @@ class StructType : public Type {
138
138
  public:
139
139
  using FieldVector = std::vector<std::pair<std::string, const Type *>>;
140
140
 
141
- StructType(const ID &id, const FieldVector &fields)
142
- : Type(id), fields(fields) {}
141
+ StructType(const ID &id, const FieldVector &fields, bool reverse = true)
142
+ : Type(id), fields(fields), reverse(reverse) {}
143
143
 
144
144
  const FieldVector &getFields() const { return fields; }
145
145
  std::ptrdiff_t getBitWidth() const override {
@@ -153,8 +153,16 @@ public:
153
153
  return size;
154
154
  }
155
155
 
156
+ // Returns whether this struct type should be reversed when
157
+ // serializing/deserializing.
158
+ // By default, a truthy value here makes StructType's compatible with system
159
+ // verilog, which has reversed struct field ordering, wrt. C/software struct
160
+ // ordering.
161
+ bool isReverse() const { return reverse; }
162
+
156
163
  private:
157
164
  FieldVector fields;
165
+ bool reverse;
158
166
  };
159
167
 
160
168
  /// Arrays have a compile time specified (static) size and an element type.
esiaccel/types.py CHANGED
@@ -245,6 +245,8 @@ class StructType(ESIType):
245
245
  def is_valid(self, obj) -> Tuple[bool, Optional[str]]:
246
246
  fields_count = 0
247
247
  if not isinstance(obj, dict):
248
+ if not hasattr(obj, "__dict__"):
249
+ return (False, "must be a dict or have __dict__ attribute")
248
250
  obj = obj.__dict__
249
251
 
250
252
  for (fname, ftype) in self.fields:
@@ -260,14 +262,20 @@ class StructType(ESIType):
260
262
 
261
263
  def serialize(self, obj) -> bytearray:
262
264
  ret = bytearray()
263
- for (fname, ftype) in reversed(self.fields):
265
+ if not isinstance(obj, dict):
266
+ obj = obj.__dict__
267
+ ordered_fields = reversed(
268
+ self.fields) if self.cpp_type.reverse else self.fields
269
+ for (fname, ftype) in ordered_fields:
264
270
  fval = obj[fname]
265
271
  ret.extend(ftype.serialize(fval))
266
272
  return ret
267
273
 
268
274
  def deserialize(self, data: bytearray) -> Tuple[Dict[str, Any], bytearray]:
269
275
  ret = {}
270
- for (fname, ftype) in reversed(self.fields):
276
+ ordered_fields = reversed(
277
+ self.fields) if self.cpp_type.reverse else self.fields
278
+ for (fname, ftype) in ordered_fields:
271
279
  (fval, data) = ftype.deserialize(data)
272
280
  ret[fname] = fval
273
281
  return (ret, data)
esiaccel/utils.py CHANGED
@@ -40,5 +40,15 @@ def run_cppgen():
40
40
  return codegen.run()
41
41
 
42
42
 
43
- def get_cmake_dir():
43
+ def get_cmake_dir() -> Path:
44
44
  return _thisdir / "cmake"
45
+
46
+
47
+ def get_dll_dir() -> Path:
48
+ """Return the directory where the ESI dll's are located"""
49
+ import sys
50
+ import os
51
+ if sys.platform == "win32":
52
+ return _thisdir
53
+ else:
54
+ return _thisdir / "lib"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: esiaccel
3
- Version: 0.1.5.dev93
3
+ Version: 0.1.5.dev104
4
4
  Summary: ESI accelerators runtime
5
5
  Author-email: John Demme <John.Demme@microsoft.com>
6
6
  License: ==============================================================================
@@ -1,19 +1,19 @@
1
- esiaccel/CosimBackend.dll,sha256=lKxSwkAinSX1rtzLuGHRLKUPT1tICkGQ1dD98a2wRgI,7150592
2
- esiaccel/CosimBackend.lib,sha256=5-p0KcNVY5sy5f3H59i2V6w-jXAiy_eVBrXLki3GuAY,4991546
3
- esiaccel/ESICppRuntime.dll,sha256=nIWEabEs4Am4aeA8h-yyLucWsL3pwBym1hMmW88s6v8,3721728
4
- esiaccel/ESICppRuntime.lib,sha256=PhqlDlxNWjShXt4I58b5VgrerTgIG9DQU787cVqxh30,14530116
5
- esiaccel/EsiCosimDpiServer.dll,sha256=cdpzOXifyzi7q7mbbgl0pa1fiHUfR73C4Rqob-AUiyc,159744
1
+ esiaccel/CosimBackend.dll,sha256=31RCH58BldCToB3ffweLg8YmGmLIo4ZdkQ8WK1Y1SmQ,7150592
2
+ esiaccel/CosimBackend.lib,sha256=LtcEhVi75BqE9pNbUTxOoSFvcjI954tz7VmdsBTaoLY,4991556
3
+ esiaccel/ESICppRuntime.dll,sha256=Tbk5qP_HEKJIT4kjBPn3dNB_bElvq_fXOR8hjtJCPPw,3722240
4
+ esiaccel/ESICppRuntime.lib,sha256=jIEtwRR_6zJuM_eXeRTQYjBwp4CPp2ghYt9gGNQFwyU,14530126
5
+ esiaccel/EsiCosimDpiServer.dll,sha256=57WTcxC5boiR5qE1a2V_t8pok-5PF4oK4akQ03pQXME,159744
6
6
  esiaccel/EsiCosimDpiServer.lib,sha256=bYBigD0RtRRSEiDxf4_gvpasLjD8fcUmC0CjRgQiQ0s,604164
7
- esiaccel/MtiPli.dll,sha256=Z3bunTmluKT00y6zUKJ8cPclzZmN_i5S-aJynS5Sqkg,14848
7
+ esiaccel/MtiPli.dll,sha256=n9WkXm0yB9gzwAMcFRyHrmW0EQPB-AwK7tm8qTqXkwc,14848
8
8
  esiaccel/MtiPli.lib,sha256=X0PcXwheCUvBMgQ5BAawePxbXQSLNk5M1FFn6V56ydo,14570
9
- esiaccel/__init__.py,sha256=C0GLqCQuF5g5qTzmAkf_YAHmBV2XAyiJad3Qz7h8u1g,562
9
+ esiaccel/__init__.py,sha256=65xXWHwJwRePsyhWk837NpzuN0qsNhoAX29TOiSYKGc,905
10
10
  esiaccel/accelerator.py,sha256=BcXPsUqcQV3YsVVyYbz9P6JnZLlcnuageFbJwID9_3s,3318
11
11
  esiaccel/codegen.py,sha256=uoYELtnIabVvgLeCABj-mWras0BvmSKABPH-cd9nDFk,6560
12
12
  esiaccel/esi-cosim.py,sha256=GwYfNh4aagypheAhGf0EIX6ojkLYKkc5OMlFR9pfXe8,14381
13
- esiaccel/esiCppAccel.cp39-win_amd64.pyd,sha256=dF7dtVJ_7s7amlVJofBqFirNiIlCLMoTVvFRQWLimZE,545792
14
- esiaccel/esiquery.exe,sha256=elK4Vb7i4-aNU9f7pX1Fi5y7smjV8HUKtEwcRr367yw,441856
15
- esiaccel/types.py,sha256=LtBYmpmSBlzbB-f_4XqcptmseqI6Q0ibnNWJT3G-GI8,18696
16
- esiaccel/utils.py,sha256=0_A8Jw3M7mjvjTHeV6u00tvRWxLnWKdFq_6NFKTgbVk,1296
13
+ esiaccel/esiCppAccel.cp39-win_amd64.pyd,sha256=ARx9J6nup7jVIw3Kwjaq0rBzsvmqbWvIbBRkPAG7o2I,547840
14
+ esiaccel/esiquery.exe,sha256=JZXxyAdbBRQl4LOewhs8BQx1bAPSkWrnXLsLw7tAgnA,441856
15
+ esiaccel/types.py,sha256=LFLzUCvtYF6FLsmKet6eJTMq2ija2Z5kxd5Ks6tkS4U,19044
16
+ esiaccel/utils.py,sha256=q-8fmgJ9tUvmBsIvqZiZ7u845IJhOjvjYTQLhhrNYl0,1515
17
17
  esiaccel/cmake/esiaccelConfig.cmake,sha256=u2aW99k1lEcmYTG1P3BTJqtmDrj53wUUaBz_jzw8kYY,565
18
18
  esiaccel/cosim/Cosim_DpiPkg.sv,sha256=9qGn1VyAVrzBP5At1thV6xrovg0WghICD01Zz9J221E,3458
19
19
  esiaccel/cosim/Cosim_Endpoint.sv,sha256=ri1fHdkiphe8S2-vm6Ru16rBGYiDiS1c8qeCAsl1diU,6498
@@ -30,14 +30,14 @@ esiaccel/include/esi/Logging.h,sha256=sHqMcpp0lNIHkIEyvSm-BBWx4zXXh6NOATCgZpgzYI
30
30
  esiaccel/include/esi/Manifest.h,sha256=j3v9UA0ogtJQBlv6k5s4j_3sCsq-gwF9btVg5dKTBlg,2244
31
31
  esiaccel/include/esi/Ports.h,sha256=T2WbPBViUSvFbO5Jjxlcp_eGq9jMitguvNnz3O0564U,10543
32
32
  esiaccel/include/esi/Services.h,sha256=H7Iq3F3LivSZHblFJmrC8RAU_MftfKAPDtyGBfJ2nP4,14815
33
- esiaccel/include/esi/Types.h,sha256=P4ExO8-zvm7qQocUmkM_ATIvamxtDZ8JT2ToLkFo1dk,5483
33
+ esiaccel/include/esi/Types.h,sha256=05nnhCXvStzCy436UM4LA6Z6N9jHgHUJgGcP5CWHQY0,5859
34
34
  esiaccel/include/esi/Utils.h,sha256=KPd75GajIFeTBVJocXBjwsJqhbZg-ShWZCIe3oQdBss,3061
35
35
  esiaccel/include/esi/backends/Cosim.h,sha256=s7vYd0ra6m1nvk-n37MjvBoGVI-CCUKBt0DU4PKlaHM,2838
36
36
  esiaccel/include/esi/backends/RpcServer.h,sha256=WMwnhwU2qnrcglGNeiKg9QQHpkDx1QE1JydKYDK4jqE,1856
37
37
  esiaccel/include/esi/backends/Trace.h,sha256=kx4wwLH3a0ndmRUdaDyYGZ1SP83zlpFrk30Nw8ZrJJA,3286
38
- esiaccel-0.1.5.dev93.dist-info/licenses/LICENSE,sha256=vtnVnB8_lN1yPYcA5MeT56R8UsQtBhyzZLBvu_KMf7I,13468
39
- esiaccel-0.1.5.dev93.dist-info/METADATA,sha256=54v_sDwTnOYIdAn_OsDKFrbXthsDYxQWTIDcbfa15vE,16147
40
- esiaccel-0.1.5.dev93.dist-info/WHEEL,sha256=XkFE14KmFh7mutkkb-qn_ueuH2lwfT8rLdfc5xpQ7wE,99
41
- esiaccel-0.1.5.dev93.dist-info/entry_points.txt,sha256=_CuNLV0fyTURxRREFwpzGycifZW_-7-MyuJNEwKK9J8,137
42
- esiaccel-0.1.5.dev93.dist-info/top_level.txt,sha256=fYWTWMDK4PDu4ePQ9NtcFHas2k8-d1kWhTs2avPpgB4,9
43
- esiaccel-0.1.5.dev93.dist-info/RECORD,,
38
+ esiaccel-0.1.5.dev104.dist-info/licenses/LICENSE,sha256=vtnVnB8_lN1yPYcA5MeT56R8UsQtBhyzZLBvu_KMf7I,13468
39
+ esiaccel-0.1.5.dev104.dist-info/METADATA,sha256=swcP5O3aZB-EDQxTAXzd7KNZDFebItz5aaHCmwicAMo,16148
40
+ esiaccel-0.1.5.dev104.dist-info/WHEEL,sha256=XkFE14KmFh7mutkkb-qn_ueuH2lwfT8rLdfc5xpQ7wE,99
41
+ esiaccel-0.1.5.dev104.dist-info/entry_points.txt,sha256=_CuNLV0fyTURxRREFwpzGycifZW_-7-MyuJNEwKK9J8,137
42
+ esiaccel-0.1.5.dev104.dist-info/top_level.txt,sha256=fYWTWMDK4PDu4ePQ9NtcFHas2k8-d1kWhTs2avPpgB4,9
43
+ esiaccel-0.1.5.dev104.dist-info/RECORD,,