esiaccel 0.1.5.dev309__cp313-cp313-win_amd64.whl → 0.1.5.dev376__cp313-cp313-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 +0 -0
- esiaccel/CosimBackend.lib +0 -0
- esiaccel/ESICppRuntime.dll +0 -0
- esiaccel/ESICppRuntime.lib +0 -0
- esiaccel/EsiCosimDpiServer.dll +0 -0
- esiaccel/EsiCosimDpiServer.lib +0 -0
- esiaccel/MtiPli.dll +0 -0
- esiaccel/MtiPli.lib +0 -0
- esiaccel/abseil_dll.dll +0 -0
- esiaccel/cares.dll +0 -0
- esiaccel/esiCppAccel.cp313-win_amd64.pyd +0 -0
- esiaccel/esiquery.exe +0 -0
- esiaccel/include/esi/Common.h +5 -1
- esiaccel/include/esi/Manifest.h +0 -2
- esiaccel/include/esi/Types.h +39 -29
- esiaccel/include/esi/Values.h +313 -0
- esiaccel/libcrypto-3-x64.dll +0 -0
- esiaccel/libprotobuf.dll +0 -0
- esiaccel/libssl-3-x64.dll +0 -0
- esiaccel/re2.dll +0 -0
- esiaccel/zlib1.dll +0 -0
- {esiaccel-0.1.5.dev309.dist-info → esiaccel-0.1.5.dev376.dist-info}/METADATA +1 -1
- {esiaccel-0.1.5.dev309.dist-info → esiaccel-0.1.5.dev376.dist-info}/RECORD +27 -26
- {esiaccel-0.1.5.dev309.dist-info → esiaccel-0.1.5.dev376.dist-info}/WHEEL +0 -0
- {esiaccel-0.1.5.dev309.dist-info → esiaccel-0.1.5.dev376.dist-info}/entry_points.txt +0 -0
- {esiaccel-0.1.5.dev309.dist-info → esiaccel-0.1.5.dev376.dist-info}/licenses/LICENSE +0 -0
- {esiaccel-0.1.5.dev309.dist-info → esiaccel-0.1.5.dev376.dist-info}/top_level.txt +0 -0
esiaccel/CosimBackend.dll
CHANGED
|
Binary file
|
esiaccel/CosimBackend.lib
CHANGED
|
Binary file
|
esiaccel/ESICppRuntime.dll
CHANGED
|
Binary file
|
esiaccel/ESICppRuntime.lib
CHANGED
|
Binary file
|
esiaccel/EsiCosimDpiServer.dll
CHANGED
|
Binary file
|
esiaccel/EsiCosimDpiServer.lib
CHANGED
|
Binary file
|
esiaccel/MtiPli.dll
CHANGED
|
Binary file
|
esiaccel/MtiPli.lib
CHANGED
|
Binary file
|
esiaccel/abseil_dll.dll
CHANGED
|
Binary file
|
esiaccel/cares.dll
CHANGED
|
Binary file
|
|
Binary file
|
esiaccel/esiquery.exe
CHANGED
|
Binary file
|
esiaccel/include/esi/Common.h
CHANGED
|
@@ -43,6 +43,7 @@ struct AppID {
|
|
|
43
43
|
return name == other.name && idx == other.idx;
|
|
44
44
|
}
|
|
45
45
|
bool operator!=(const AppID &other) const { return !(*this == other); }
|
|
46
|
+
friend std::ostream &operator<<(std::ostream &os, const AppID &id);
|
|
46
47
|
};
|
|
47
48
|
bool operator<(const AppID &a, const AppID &b);
|
|
48
49
|
|
|
@@ -53,6 +54,7 @@ public:
|
|
|
53
54
|
AppIDPath operator+(const AppIDPath &b) const;
|
|
54
55
|
AppIDPath parent() const;
|
|
55
56
|
std::string toStr() const;
|
|
57
|
+
friend std::ostream &operator<<(std::ostream &os, const AppIDPath &path);
|
|
56
58
|
};
|
|
57
59
|
bool operator<(const AppIDPath &a, const AppIDPath &b);
|
|
58
60
|
|
|
@@ -106,6 +108,8 @@ class MessageData {
|
|
|
106
108
|
public:
|
|
107
109
|
/// Adopts the data vector buffer.
|
|
108
110
|
MessageData() = default;
|
|
111
|
+
MessageData(std::span<const uint8_t> data)
|
|
112
|
+
: data(data.data(), data.data() + data.size()) {}
|
|
109
113
|
MessageData(std::vector<uint8_t> &data) : data(std::move(data)) {}
|
|
110
114
|
MessageData(std::vector<uint8_t> &&data) : data(std::move(data)) {}
|
|
111
115
|
MessageData(const uint8_t *data, size_t size) : data(data, data + size) {}
|
|
@@ -126,6 +130,7 @@ public:
|
|
|
126
130
|
|
|
127
131
|
/// Get the size of the data in bytes.
|
|
128
132
|
size_t getSize() const { return data.size(); }
|
|
133
|
+
size_t size() const { return getSize(); }
|
|
129
134
|
|
|
130
135
|
/// Returns true if this message contains no data.
|
|
131
136
|
bool empty() const { return data.empty(); }
|
|
@@ -158,7 +163,6 @@ private:
|
|
|
158
163
|
} // namespace esi
|
|
159
164
|
|
|
160
165
|
std::ostream &operator<<(std::ostream &, const esi::ModuleInfo &);
|
|
161
|
-
std::ostream &operator<<(std::ostream &, const esi::AppID &);
|
|
162
166
|
|
|
163
167
|
//===----------------------------------------------------------------------===//
|
|
164
168
|
// Functions which should be in the standard library.
|
esiaccel/include/esi/Manifest.h
CHANGED
|
@@ -65,8 +65,6 @@ private:
|
|
|
65
65
|
|
|
66
66
|
} // namespace esi
|
|
67
67
|
|
|
68
|
-
std::ostream &operator<<(std::ostream &os, const esi::AppID &id);
|
|
69
|
-
std::ostream &operator<<(std::ostream &, const esi::AppIDPath &);
|
|
70
68
|
std::ostream &operator<<(std::ostream &, const esi::ModuleInfo &);
|
|
71
69
|
|
|
72
70
|
#endif // ESI_MANIFEST_H
|
esiaccel/include/esi/Types.h
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
#include <vector>
|
|
27
27
|
|
|
28
28
|
#include "esi/Common.h"
|
|
29
|
+
#include "esi/Values.h" // For BitVector / Int / UInt
|
|
29
30
|
|
|
30
31
|
namespace esi {
|
|
31
32
|
|
|
@@ -39,20 +40,29 @@ public:
|
|
|
39
40
|
ID getID() const { return id; }
|
|
40
41
|
virtual std::ptrdiff_t getBitWidth() const { return -1; }
|
|
41
42
|
|
|
42
|
-
/// Serialize an object to
|
|
43
|
-
///
|
|
44
|
-
/// serialized
|
|
45
|
-
|
|
43
|
+
/// Serialize an object to a MutableBitVector (LSB-first stream). The object
|
|
44
|
+
/// should be passed via std::any. Implementations append fields in the order
|
|
45
|
+
/// they are iterated (the first serialized field occupies the
|
|
46
|
+
/// least-significant bits of the result).
|
|
47
|
+
virtual MutableBitVector serialize(const std::any &obj) const {
|
|
46
48
|
throw std::runtime_error("Serialization not implemented for type " + id);
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
/// Deserialize from a
|
|
50
|
-
///
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
/// Deserialize from a BitVector stream (LSB-first). Implementations consume
|
|
52
|
+
/// bits from 'data' in-place (via logical right shifts) and return the
|
|
53
|
+
/// reconstructed value. Remaining bits stay in 'data'.
|
|
54
|
+
virtual std::any deserialize(BitVector &data) const {
|
|
53
55
|
throw std::runtime_error("Deserialization not implemented for type " + id);
|
|
54
56
|
}
|
|
55
57
|
|
|
58
|
+
// Deserialize from a MessageData buffer. Maps the MessageData onto a
|
|
59
|
+
// MutableBitVector, and proceeds with regular MutableBitVector
|
|
60
|
+
// deserialization.
|
|
61
|
+
std::any deserialize(const MessageData &data) const {
|
|
62
|
+
auto bv = MutableBitVector(std::vector<uint8_t>(data.getData()));
|
|
63
|
+
return deserialize(bv);
|
|
64
|
+
}
|
|
65
|
+
|
|
56
66
|
/// Ensure that a std::any object is valid for this type. Throws
|
|
57
67
|
/// std::runtime_error if the object is not valid.
|
|
58
68
|
virtual void ensureValid(const std::any &obj) const {
|
|
@@ -101,14 +111,14 @@ protected:
|
|
|
101
111
|
/// carry one values of one type.
|
|
102
112
|
class ChannelType : public Type {
|
|
103
113
|
public:
|
|
114
|
+
using Type::deserialize;
|
|
104
115
|
ChannelType(const ID &id, const Type *inner) : Type(id), inner(inner) {}
|
|
105
116
|
const Type *getInner() const { return inner; }
|
|
106
117
|
std::ptrdiff_t getBitWidth() const override { return inner->getBitWidth(); };
|
|
107
118
|
|
|
108
119
|
void ensureValid(const std::any &obj) const override;
|
|
109
|
-
|
|
110
|
-
std::
|
|
111
|
-
deserialize(std::span<const uint8_t> data) const override;
|
|
120
|
+
MutableBitVector serialize(const std::any &obj) const override;
|
|
121
|
+
std::any deserialize(BitVector &data) const override;
|
|
112
122
|
|
|
113
123
|
private:
|
|
114
124
|
const Type *inner;
|
|
@@ -117,14 +127,14 @@ private:
|
|
|
117
127
|
/// The "void" type is a special type which can be used to represent no type.
|
|
118
128
|
class VoidType : public Type {
|
|
119
129
|
public:
|
|
130
|
+
using Type::deserialize;
|
|
120
131
|
VoidType(const ID &id) : Type(id) {}
|
|
121
132
|
// 'void' is 1 bit by convention.
|
|
122
133
|
std::ptrdiff_t getBitWidth() const override { return 1; };
|
|
123
134
|
|
|
124
135
|
void ensureValid(const std::any &obj) const override;
|
|
125
|
-
|
|
126
|
-
std::
|
|
127
|
-
deserialize(std::span<const uint8_t> data) const override;
|
|
136
|
+
MutableBitVector serialize(const std::any &obj) const override;
|
|
137
|
+
std::any deserialize(BitVector &data) const override;
|
|
128
138
|
};
|
|
129
139
|
|
|
130
140
|
/// The "any" type is a special type which can be used to represent any type, as
|
|
@@ -154,11 +164,11 @@ private:
|
|
|
154
164
|
class BitsType : public BitVectorType {
|
|
155
165
|
public:
|
|
156
166
|
using BitVectorType::BitVectorType;
|
|
167
|
+
using Type::deserialize;
|
|
157
168
|
|
|
158
169
|
void ensureValid(const std::any &obj) const override;
|
|
159
|
-
|
|
160
|
-
std::
|
|
161
|
-
deserialize(std::span<const uint8_t> data) const override;
|
|
170
|
+
MutableBitVector serialize(const std::any &obj) const override;
|
|
171
|
+
std::any deserialize(BitVector &data) const override;
|
|
162
172
|
};
|
|
163
173
|
|
|
164
174
|
/// Integers are bit vectors which may be signed or unsigned and are interpreted
|
|
@@ -172,28 +182,29 @@ public:
|
|
|
172
182
|
class SIntType : public IntegerType {
|
|
173
183
|
public:
|
|
174
184
|
using IntegerType::IntegerType;
|
|
185
|
+
using Type::deserialize;
|
|
175
186
|
|
|
176
187
|
void ensureValid(const std::any &obj) const override;
|
|
177
|
-
|
|
178
|
-
std::
|
|
179
|
-
deserialize(std::span<const uint8_t> data) const override;
|
|
188
|
+
MutableBitVector serialize(const std::any &obj) const override;
|
|
189
|
+
std::any deserialize(BitVector &data) const override;
|
|
180
190
|
};
|
|
181
191
|
|
|
182
192
|
/// Unsigned integer.
|
|
183
193
|
class UIntType : public IntegerType {
|
|
184
194
|
public:
|
|
185
195
|
using IntegerType::IntegerType;
|
|
196
|
+
using Type::deserialize;
|
|
186
197
|
|
|
187
198
|
void ensureValid(const std::any &obj) const override;
|
|
188
|
-
|
|
189
|
-
std::
|
|
190
|
-
deserialize(std::span<const uint8_t> data) const override;
|
|
199
|
+
MutableBitVector serialize(const std::any &obj) const override;
|
|
200
|
+
std::any deserialize(BitVector &data) const override;
|
|
191
201
|
};
|
|
192
202
|
|
|
193
203
|
/// Structs are an ordered collection of fields, each with a name and a type.
|
|
194
204
|
class StructType : public Type {
|
|
195
205
|
public:
|
|
196
206
|
using FieldVector = std::vector<std::pair<std::string, const Type *>>;
|
|
207
|
+
using Type::deserialize;
|
|
197
208
|
|
|
198
209
|
StructType(const ID &id, const FieldVector &fields, bool reverse = true)
|
|
199
210
|
: Type(id), fields(fields), reverse(reverse) {}
|
|
@@ -211,9 +222,8 @@ public:
|
|
|
211
222
|
}
|
|
212
223
|
|
|
213
224
|
void ensureValid(const std::any &obj) const override;
|
|
214
|
-
|
|
215
|
-
std::
|
|
216
|
-
deserialize(std::span<const uint8_t> data) const override;
|
|
225
|
+
MutableBitVector serialize(const std::any &obj) const override;
|
|
226
|
+
std::any deserialize(BitVector &data) const override;
|
|
217
227
|
|
|
218
228
|
// Returns whether this struct type should be reversed when
|
|
219
229
|
// serializing/deserializing.
|
|
@@ -233,6 +243,7 @@ public:
|
|
|
233
243
|
ArrayType(const ID &id, const Type *elementType, uint64_t size,
|
|
234
244
|
bool reverse = true)
|
|
235
245
|
: Type(id), elementType(elementType), size(size), reverse(reverse) {}
|
|
246
|
+
using Type::deserialize;
|
|
236
247
|
|
|
237
248
|
const Type *getElementType() const { return elementType; }
|
|
238
249
|
uint64_t getSize() const { return size; }
|
|
@@ -245,9 +256,8 @@ public:
|
|
|
245
256
|
}
|
|
246
257
|
|
|
247
258
|
void ensureValid(const std::any &obj) const override;
|
|
248
|
-
|
|
249
|
-
std::
|
|
250
|
-
deserialize(std::span<const uint8_t> data) const override;
|
|
259
|
+
MutableBitVector serialize(const std::any &obj) const override;
|
|
260
|
+
std::any deserialize(BitVector &data) const override;
|
|
251
261
|
|
|
252
262
|
private:
|
|
253
263
|
const Type *elementType;
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
//===- values.h - ESI value system -------------------------------* C++ -*-===//
|
|
2
|
+
//
|
|
3
|
+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
4
|
+
// See https://llvm.org/LICENSE.txt for license information.
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
6
|
+
//
|
|
7
|
+
//===----------------------------------------------------------------------===//
|
|
8
|
+
//
|
|
9
|
+
// ESI arbitrary width bitvector and integer types.
|
|
10
|
+
// These types are not meant to be highly optimized. Rather, its a simple
|
|
11
|
+
// implementation to support arbitrary bit widths for ESI runtime values.
|
|
12
|
+
//
|
|
13
|
+
//===----------------------------------------------------------------------===//
|
|
14
|
+
// DO NOT EDIT!
|
|
15
|
+
// This file is distributed as part of an ESI package. The source for this file
|
|
16
|
+
// should always be modified within CIRCT.
|
|
17
|
+
//
|
|
18
|
+
//===----------------------------------------------------------------------===//
|
|
19
|
+
|
|
20
|
+
// NOLINTNEXTLINE(llvm-header-guard)
|
|
21
|
+
#ifndef ESI_VALUES_H
|
|
22
|
+
#define ESI_VALUES_H
|
|
23
|
+
|
|
24
|
+
#include <cstdint>
|
|
25
|
+
#include <format>
|
|
26
|
+
#include <memory> // (may be removable later)
|
|
27
|
+
#include <optional>
|
|
28
|
+
#include <ostream>
|
|
29
|
+
#include <span>
|
|
30
|
+
#include <stdexcept>
|
|
31
|
+
#include <string>
|
|
32
|
+
#include <vector>
|
|
33
|
+
|
|
34
|
+
namespace esi {
|
|
35
|
+
|
|
36
|
+
class MutableBitVector;
|
|
37
|
+
|
|
38
|
+
/// A lightweight, non-owning bit vector view backed by a byte array span.
|
|
39
|
+
/// BitVector is immutable wrt. modifying the underlying bits, and provides
|
|
40
|
+
/// read-only access to bits. It supports bit-level access and returns new views
|
|
41
|
+
/// for operations.
|
|
42
|
+
class BitVector {
|
|
43
|
+
public:
|
|
44
|
+
using byte = uint8_t;
|
|
45
|
+
|
|
46
|
+
/// Construct from an existing span. Width defaults to the number of bits in
|
|
47
|
+
/// the span (size * 8). The BitVector does not take ownership.
|
|
48
|
+
BitVector(std::span<const byte> bytes,
|
|
49
|
+
std::optional<size_t> width = std::nullopt, uint8_t bitIndex = 0);
|
|
50
|
+
BitVector() = default;
|
|
51
|
+
BitVector(const BitVector &other);
|
|
52
|
+
BitVector &operator=(const BitVector &other);
|
|
53
|
+
|
|
54
|
+
size_t width() const { return bitWidth; }
|
|
55
|
+
size_t size() const { return width(); }
|
|
56
|
+
|
|
57
|
+
/// Return the i-th bit (0 = LSB) as boolean.
|
|
58
|
+
bool getBit(size_t i) const;
|
|
59
|
+
|
|
60
|
+
/// Return a handle to the underlying span. Throws if the current bit index
|
|
61
|
+
/// is not 0 (since a non-zero bit offset breaks raw byte alignment).
|
|
62
|
+
std::span<const byte> getSpan() const {
|
|
63
|
+
if (bitIndex != 0)
|
|
64
|
+
throw std::runtime_error("Cannot get data span with non-zero bit index");
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/// Logical right shift that drops the least-significant n bits by advancing
|
|
69
|
+
/// the byte/bit index and reducing width. Returns a new immutable
|
|
70
|
+
/// view. Does not modify the underlying storage contents.
|
|
71
|
+
BitVector operator>>(size_t n) const;
|
|
72
|
+
BitVector &operator>>=(size_t n);
|
|
73
|
+
|
|
74
|
+
/// Create a new immutable view of a contiguous bit slice [offset,
|
|
75
|
+
/// offset+sliceWidth). The returned BitVector is a view (not an owning copy)
|
|
76
|
+
/// into the same underlying span. Throws if the requested slice exceeds the
|
|
77
|
+
/// current width.
|
|
78
|
+
BitVector slice(size_t offset, size_t sliceWidth) const;
|
|
79
|
+
|
|
80
|
+
/// Return a view of the N least-significant bits.
|
|
81
|
+
BitVector lsb(size_t n) const { return slice(0, n); }
|
|
82
|
+
|
|
83
|
+
/// Return a view of the N most-significant bits.
|
|
84
|
+
BitVector msb(size_t n) const {
|
|
85
|
+
if (n > bitWidth)
|
|
86
|
+
throw std::invalid_argument("msb width exceeds bit width");
|
|
87
|
+
return slice(bitWidth - n, n);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
std::string toString(unsigned base = 16) const;
|
|
91
|
+
|
|
92
|
+
bool operator==(const BitVector &rhs) const;
|
|
93
|
+
bool operator!=(const BitVector &rhs) const { return !(*this == rhs); }
|
|
94
|
+
|
|
95
|
+
/// Bitwise AND: creates a new MutableBitVector with the result.
|
|
96
|
+
friend MutableBitVector operator&(const BitVector &a, const BitVector &b);
|
|
97
|
+
|
|
98
|
+
/// Bitwise OR: creates a new MutableBitVector with the result.
|
|
99
|
+
friend MutableBitVector operator|(const BitVector &a, const BitVector &b);
|
|
100
|
+
|
|
101
|
+
/// Bitwise XOR: creates a new MutableBitVector with the result.
|
|
102
|
+
friend MutableBitVector operator^(const BitVector &a, const BitVector &b);
|
|
103
|
+
|
|
104
|
+
/// Forward iterator for iterating over bits from LSB (index 0) to MSB.
|
|
105
|
+
class bit_iterator {
|
|
106
|
+
public:
|
|
107
|
+
using difference_type = std::ptrdiff_t;
|
|
108
|
+
using value_type = bool;
|
|
109
|
+
using pointer = const bool *;
|
|
110
|
+
using reference = bool;
|
|
111
|
+
using iterator_category = std::forward_iterator_tag;
|
|
112
|
+
|
|
113
|
+
/// Default constructor.
|
|
114
|
+
bit_iterator() = default;
|
|
115
|
+
|
|
116
|
+
/// Construct an iterator at the given bit position.
|
|
117
|
+
bit_iterator(const BitVector *bv, size_t pos = 0)
|
|
118
|
+
: bitVector(bv), position(pos) {}
|
|
119
|
+
|
|
120
|
+
/// Dereference: returns the bit value at the current position.
|
|
121
|
+
bool operator*() const {
|
|
122
|
+
if (bitVector == nullptr || position >= bitVector->bitWidth)
|
|
123
|
+
throw std::out_of_range("bit_iterator dereference out of range");
|
|
124
|
+
return bitVector->getBit(position);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/// Pre-increment: move to next bit.
|
|
128
|
+
bit_iterator &operator++() {
|
|
129
|
+
++position;
|
|
130
|
+
return *this;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// Post-increment: move to next bit.
|
|
134
|
+
bit_iterator operator++(int) {
|
|
135
|
+
bit_iterator tmp = *this;
|
|
136
|
+
++position;
|
|
137
|
+
return tmp;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/// Equality comparison.
|
|
141
|
+
bool operator==(const bit_iterator &other) const {
|
|
142
|
+
return bitVector == other.bitVector && position == other.position;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/// Inequality comparison.
|
|
146
|
+
bool operator!=(const bit_iterator &other) const {
|
|
147
|
+
return !(*this == other);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/// Less-than comparison (for ranges support).
|
|
151
|
+
bool operator<(const bit_iterator &other) const {
|
|
152
|
+
return bitVector == other.bitVector && position < other.position;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/// Sentinel-compatible equality (for ranges support).
|
|
156
|
+
bool operator==(std::default_sentinel_t) const {
|
|
157
|
+
return bitVector == nullptr || position >= bitVector->bitWidth;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/// Sentinel-compatible inequality.
|
|
161
|
+
bool operator!=(std::default_sentinel_t sent) const {
|
|
162
|
+
return !(*this == sent);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
private:
|
|
166
|
+
const BitVector *bitVector = nullptr;
|
|
167
|
+
size_t position = 0;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/// Return an iterator to the first bit (LSB).
|
|
171
|
+
bit_iterator begin() const { return bit_iterator(this, 0); }
|
|
172
|
+
|
|
173
|
+
/// Return an iterator past the last bit.
|
|
174
|
+
bit_iterator end() const { return bit_iterator(this, bitWidth); }
|
|
175
|
+
|
|
176
|
+
protected:
|
|
177
|
+
// Underlying storage view. const, to allow for non-owning immutable views.
|
|
178
|
+
std::span<const byte> data{};
|
|
179
|
+
size_t bitWidth = 0; // Number of valid bits.
|
|
180
|
+
uint8_t bitIndex = 0; // Starting bit offset in first byte.
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/// A mutable bit vector that owns its underlying storage.
|
|
184
|
+
/// It supports in-place modifications and mutable operations.
|
|
185
|
+
class MutableBitVector : public BitVector {
|
|
186
|
+
public:
|
|
187
|
+
/// Owning, zero-initialized constructor of a given width.
|
|
188
|
+
explicit MutableBitVector(size_t width);
|
|
189
|
+
|
|
190
|
+
/// Owning constructor from an rvalue vector (must move in).
|
|
191
|
+
MutableBitVector(std::vector<byte> &&bytes,
|
|
192
|
+
std::optional<size_t> width = std::nullopt);
|
|
193
|
+
|
|
194
|
+
MutableBitVector() = default;
|
|
195
|
+
|
|
196
|
+
// Copy constructor: duplicate storage.
|
|
197
|
+
MutableBitVector(const MutableBitVector &other);
|
|
198
|
+
|
|
199
|
+
// Copy constructor from immutable BitVector: creates owning copy.
|
|
200
|
+
MutableBitVector(const BitVector &other);
|
|
201
|
+
|
|
202
|
+
// Move constructor: transfer ownership.
|
|
203
|
+
MutableBitVector(MutableBitVector &&other) noexcept;
|
|
204
|
+
|
|
205
|
+
// Move constructor from immutable BitVector: creates owning copy.
|
|
206
|
+
MutableBitVector(BitVector &&other);
|
|
207
|
+
|
|
208
|
+
MutableBitVector &operator=(const MutableBitVector &other);
|
|
209
|
+
|
|
210
|
+
MutableBitVector &operator=(MutableBitVector &&other) noexcept;
|
|
211
|
+
|
|
212
|
+
/// Set the i-th bit.
|
|
213
|
+
void setBit(size_t i, bool v);
|
|
214
|
+
|
|
215
|
+
/// Return a handle to the underlying span (always aligned since bitIndex=0).
|
|
216
|
+
std::span<const byte> getSpan() const { return data; }
|
|
217
|
+
|
|
218
|
+
/// Return and transfer ownership of the underlying storage.
|
|
219
|
+
std::vector<uint8_t> takeStorage() { return std::move(owner); }
|
|
220
|
+
|
|
221
|
+
/// In-place logical right shift that drops the least-significant n bits.
|
|
222
|
+
/// Reduces width and updates internal state. Does not modify underlying
|
|
223
|
+
/// storage.
|
|
224
|
+
MutableBitVector &operator>>=(size_t n);
|
|
225
|
+
|
|
226
|
+
/// In-place logical left shift shifts in n zero bits at LSB, shifting
|
|
227
|
+
/// existing bits upward.
|
|
228
|
+
MutableBitVector &operator<<=(size_t n);
|
|
229
|
+
|
|
230
|
+
/// In-place concatenate: appends bits from other to this.
|
|
231
|
+
MutableBitVector &operator<<=(const MutableBitVector &other);
|
|
232
|
+
|
|
233
|
+
MutableBitVector &operator|=(const MutableBitVector &other);
|
|
234
|
+
MutableBitVector &operator&=(const MutableBitVector &other);
|
|
235
|
+
MutableBitVector &operator^=(const MutableBitVector &other);
|
|
236
|
+
MutableBitVector operator~() const;
|
|
237
|
+
MutableBitVector operator|(const MutableBitVector &other) const;
|
|
238
|
+
MutableBitVector operator&(const MutableBitVector &other) const;
|
|
239
|
+
MutableBitVector operator^(const MutableBitVector &other) const;
|
|
240
|
+
|
|
241
|
+
private:
|
|
242
|
+
// Storage owned by this MutableBitVector.
|
|
243
|
+
std::vector<byte> owner;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
std::ostream &operator<<(std::ostream &os, const BitVector &bv);
|
|
247
|
+
|
|
248
|
+
// Arbitrary width signed integer type built on MutableBitVector.
|
|
249
|
+
class Int : public MutableBitVector {
|
|
250
|
+
public:
|
|
251
|
+
using MutableBitVector::MutableBitVector;
|
|
252
|
+
Int() = default;
|
|
253
|
+
Int(int64_t v, unsigned width = 64);
|
|
254
|
+
operator int64_t() const { return toI64(); }
|
|
255
|
+
operator int32_t() const { return toInt<int32_t>(); }
|
|
256
|
+
operator int16_t() const { return toInt<int16_t>(); }
|
|
257
|
+
operator int8_t() const { return toInt<int8_t>(); }
|
|
258
|
+
|
|
259
|
+
private:
|
|
260
|
+
template <typename T>
|
|
261
|
+
T toInt() const {
|
|
262
|
+
static_assert(std::is_integral<T>::value && std::is_signed<T>::value,
|
|
263
|
+
"T must be a signed integral type");
|
|
264
|
+
int64_t v = toI64();
|
|
265
|
+
fits(v, sizeof(T) * 8);
|
|
266
|
+
return static_cast<T>(v);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Convert the bitvector to a signed intN_t, throwing if the value doesn't
|
|
270
|
+
// fit.
|
|
271
|
+
int64_t toI64() const;
|
|
272
|
+
|
|
273
|
+
// Check if the given value fits in the specified bit width.
|
|
274
|
+
static void fits(int64_t v, unsigned n);
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
// Arbitrary width unsigned integer type built on MutableBitVector.
|
|
278
|
+
class UInt : public MutableBitVector {
|
|
279
|
+
public:
|
|
280
|
+
using MutableBitVector::MutableBitVector;
|
|
281
|
+
UInt() = default;
|
|
282
|
+
UInt(uint64_t v, unsigned width = 64);
|
|
283
|
+
operator uint64_t() const { return toUI64(); }
|
|
284
|
+
operator uint32_t() const { return toUInt<uint32_t>(); }
|
|
285
|
+
operator uint16_t() const { return toUInt<uint16_t>(); }
|
|
286
|
+
operator uint8_t() const { return toUInt<uint8_t>(); }
|
|
287
|
+
|
|
288
|
+
private:
|
|
289
|
+
uint64_t toUI64() const;
|
|
290
|
+
|
|
291
|
+
static void fits(uint64_t v, unsigned n);
|
|
292
|
+
|
|
293
|
+
template <typename T>
|
|
294
|
+
T toUInt() const {
|
|
295
|
+
static_assert(std::is_integral<T>::value && std::is_unsigned<T>::value,
|
|
296
|
+
"T must be an unsigned integral type");
|
|
297
|
+
uint64_t v = toUI64();
|
|
298
|
+
fits(v, sizeof(T) * 8);
|
|
299
|
+
return static_cast<T>(v);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
} // namespace esi
|
|
304
|
+
|
|
305
|
+
// Enable BitVector and MutableBitVector to work with std::ranges algorithms
|
|
306
|
+
template <>
|
|
307
|
+
inline constexpr bool std::ranges::enable_borrowed_range<esi::BitVector> = true;
|
|
308
|
+
|
|
309
|
+
template <>
|
|
310
|
+
inline constexpr bool
|
|
311
|
+
std::ranges::enable_borrowed_range<esi::MutableBitVector> = true;
|
|
312
|
+
|
|
313
|
+
#endif // ESI_VALUES_H
|
esiaccel/libcrypto-3-x64.dll
CHANGED
|
Binary file
|
esiaccel/libprotobuf.dll
CHANGED
|
Binary file
|
esiaccel/libssl-3-x64.dll
CHANGED
|
Binary file
|
esiaccel/re2.dll
CHANGED
|
Binary file
|
esiaccel/zlib1.dll
CHANGED
|
Binary file
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
esiaccel/CosimBackend.dll,sha256=
|
|
2
|
-
esiaccel/CosimBackend.lib,sha256=
|
|
3
|
-
esiaccel/ESICppRuntime.dll,sha256=
|
|
4
|
-
esiaccel/ESICppRuntime.lib,sha256=
|
|
5
|
-
esiaccel/EsiCosimDpiServer.dll,sha256=
|
|
6
|
-
esiaccel/EsiCosimDpiServer.lib,sha256=
|
|
7
|
-
esiaccel/MtiPli.dll,sha256=
|
|
8
|
-
esiaccel/MtiPli.lib,sha256=
|
|
1
|
+
esiaccel/CosimBackend.dll,sha256=brx5NtQeyf87GPBXAFiA9FFzocTrvlYfIsS1Md_FyKw,7190016
|
|
2
|
+
esiaccel/CosimBackend.lib,sha256=irceROhM9oK4xu-X5-asnfJAPaYHTQYwYIwufUEbCcc,4903722
|
|
3
|
+
esiaccel/ESICppRuntime.dll,sha256=VCHXtMCNSmZNuKSoB9SbSq-RwONBJnRZBUWBmGPRgro,4123648
|
|
4
|
+
esiaccel/ESICppRuntime.lib,sha256=7qN5KCd_vBEiRxVfIj4-dJnz8TDYqKSa2YzVZOzPUkw,15239210
|
|
5
|
+
esiaccel/EsiCosimDpiServer.dll,sha256=QvVYq0d8rjO9XRlS_KzKvAHzpbzSUTMX9pLV3r3upaM,160768
|
|
6
|
+
esiaccel/EsiCosimDpiServer.lib,sha256=xMj0Uiih7BfmPUCe5NrAK8gEAqoi0ITH7P4Fp0IvaHo,606000
|
|
7
|
+
esiaccel/MtiPli.dll,sha256=HUDcLTGCNLBJvKYCuDfk8o1_zMQ8jIB1bSE7KI4Vxlk,14848
|
|
8
|
+
esiaccel/MtiPli.lib,sha256=FFIpVSxcH4VGNnMeZXAHcYQxTCBAeElN3YXLk1yrSTM,14570
|
|
9
9
|
esiaccel/__init__.py,sha256=65xXWHwJwRePsyhWk837NpzuN0qsNhoAX29TOiSYKGc,905
|
|
10
|
-
esiaccel/abseil_dll.dll,sha256=
|
|
10
|
+
esiaccel/abseil_dll.dll,sha256=KIIT4c_vWvyxeRgt0tZfgXsDA0j5LRwsdOG6IDxgSV4,1584640
|
|
11
11
|
esiaccel/accelerator.py,sha256=BcXPsUqcQV3YsVVyYbz9P6JnZLlcnuageFbJwID9_3s,3318
|
|
12
|
-
esiaccel/cares.dll,sha256=
|
|
12
|
+
esiaccel/cares.dll,sha256=1zh8SGWhmFj_dCqq7PFeRMGlHMWvSkPAGnDPuazK94Y,199168
|
|
13
13
|
esiaccel/codegen.py,sha256=uoYELtnIabVvgLeCABj-mWras0BvmSKABPH-cd9nDFk,6560
|
|
14
14
|
esiaccel/esi-cosim.py,sha256=P7n3SBgKPnXynwghY5zK1FmpqZkbC_YxfVIvNNQNl6Q,3817
|
|
15
|
-
esiaccel/esiCppAccel.cp313-win_amd64.pyd,sha256=
|
|
16
|
-
esiaccel/esiquery.exe,sha256=
|
|
17
|
-
esiaccel/libcrypto-3-x64.dll,sha256=
|
|
18
|
-
esiaccel/libprotobuf.dll,sha256=
|
|
19
|
-
esiaccel/libssl-3-x64.dll,sha256=
|
|
20
|
-
esiaccel/re2.dll,sha256=
|
|
15
|
+
esiaccel/esiCppAccel.cp313-win_amd64.pyd,sha256=7DF_v2TGa5SQM7qWEhQGHUP7JZnJBnFBNCMLRopvYuw,510976
|
|
16
|
+
esiaccel/esiquery.exe,sha256=2wMIXO_JyqbspMBW9sKR-cFJlRqwrtLXYKjYGNoqmH0,441856
|
|
17
|
+
esiaccel/libcrypto-3-x64.dll,sha256=xEn4aIo-jxcBZ4__qxZ7E2Q1uNDDJMB7_-03zpOqEg0,5327872
|
|
18
|
+
esiaccel/libprotobuf.dll,sha256=oLW_PejyCww7Qh2e1pGpld5GL7g03GJOS-g_8G6Znug,12566528
|
|
19
|
+
esiaccel/libssl-3-x64.dll,sha256=JiN4CNgcaIaF-9c7T1njTYtW0pLoEefTwPga0s34Kmk,871424
|
|
20
|
+
esiaccel/re2.dll,sha256=ps_qyaK8rgKif5n6YIoYl9gYAaMiXlitvQhsjSctBHo,1213952
|
|
21
21
|
esiaccel/types.py,sha256=LFLzUCvtYF6FLsmKet6eJTMq2ija2Z5kxd5Ks6tkS4U,19044
|
|
22
22
|
esiaccel/utils.py,sha256=q-8fmgJ9tUvmBsIvqZiZ7u845IJhOjvjYTQLhhrNYl0,1515
|
|
23
|
-
esiaccel/zlib1.dll,sha256=
|
|
23
|
+
esiaccel/zlib1.dll,sha256=pA_VZ3au8YNlAmK-7uDv7-bfps_4Uyzcm4_-yn-gHto,90112
|
|
24
24
|
esiaccel/cmake/esiaccelConfig.cmake,sha256=u2aW99k1lEcmYTG1P3BTJqtmDrj53wUUaBz_jzw8kYY,565
|
|
25
25
|
esiaccel/cosim/Cosim_DpiPkg.sv,sha256=9qGn1VyAVrzBP5At1thV6xrovg0WghICD01Zz9J221E,3458
|
|
26
26
|
esiaccel/cosim/Cosim_Endpoint.sv,sha256=-XXrGvvk6hdiZ-Ex6_QtdKXXUwKJLKSvpTUK3o0gPZ8,7589
|
|
@@ -32,22 +32,23 @@ esiaccel/cosim/simulator.py,sha256=HpkvKPbpyqalRp8poRYU3E0taYxTRmxcmBEJ7YOecx4,1
|
|
|
32
32
|
esiaccel/cosim/verilator.py,sha256=dwiEkKOem5OKPV9AK6O1ohr22MTsyDxBVnriDRFoVa8,2877
|
|
33
33
|
esiaccel/include/esi/Accelerator.h,sha256=RhkZ2HeMZ0iHc5BkHdDWXoeg9J9lyPQciH5bWq5Qc_w,9772
|
|
34
34
|
esiaccel/include/esi/CLI.h,sha256=Nn8tHn_xtEfkrD7USE2tao6ktYOJ6xcbnhZkS9-ox0A,2540
|
|
35
|
-
esiaccel/include/esi/Common.h,sha256
|
|
35
|
+
esiaccel/include/esi/Common.h,sha256=-eK_r24nxpQkBQKOOuwcHJVUB1AP3iDgLwvzGWFItAY,6008
|
|
36
36
|
esiaccel/include/esi/Context.h,sha256=Tk_4nBDtTeVY62GfX4Cs_ZMIQstjSgrWHddN_PKANEA,2396
|
|
37
37
|
esiaccel/include/esi/Design.h,sha256=mU8OwpCYijiWSdDq17l45LMzZxBca93nosudWCXNHfQ,4922
|
|
38
38
|
esiaccel/include/esi/Engines.h,sha256=bbGbhXjYMpIpXh_DR0OS57zyGQUIDXh_S7xHX3su0Y0,4831
|
|
39
39
|
esiaccel/include/esi/Logging.h,sha256=sHqMcpp0lNIHkIEyvSm-BBWx4zXXh6NOATCgZpgzYI4,8944
|
|
40
|
-
esiaccel/include/esi/Manifest.h,sha256=
|
|
40
|
+
esiaccel/include/esi/Manifest.h,sha256=ZdIu_vXXLS4bwOoISFo-sFjzvB9x5ddYmNmaknyF0ds,2110
|
|
41
41
|
esiaccel/include/esi/Ports.h,sha256=T2WbPBViUSvFbO5Jjxlcp_eGq9jMitguvNnz3O0564U,10543
|
|
42
42
|
esiaccel/include/esi/Services.h,sha256=hv_asloGwIVcgoCjtYubfBvb-UJbU_GQKoZW464BYn8,15125
|
|
43
|
-
esiaccel/include/esi/Types.h,sha256
|
|
43
|
+
esiaccel/include/esi/Types.h,sha256=6krb9cRpVvuml35LqR7SHPTDMdz9u4773SON94_3_Ig,9298
|
|
44
44
|
esiaccel/include/esi/Utils.h,sha256=KPd75GajIFeTBVJocXBjwsJqhbZg-ShWZCIe3oQdBss,3061
|
|
45
|
+
esiaccel/include/esi/Values.h,sha256=1xXxNV2oUr84At3Y7aXBqbiPZxyJXeUbhycl0O0fUtk,11074
|
|
45
46
|
esiaccel/include/esi/backends/Cosim.h,sha256=s7vYd0ra6m1nvk-n37MjvBoGVI-CCUKBt0DU4PKlaHM,2838
|
|
46
47
|
esiaccel/include/esi/backends/RpcServer.h,sha256=WMwnhwU2qnrcglGNeiKg9QQHpkDx1QE1JydKYDK4jqE,1856
|
|
47
48
|
esiaccel/include/esi/backends/Trace.h,sha256=kx4wwLH3a0ndmRUdaDyYGZ1SP83zlpFrk30Nw8ZrJJA,3286
|
|
48
|
-
esiaccel-0.1.5.
|
|
49
|
-
esiaccel-0.1.5.
|
|
50
|
-
esiaccel-0.1.5.
|
|
51
|
-
esiaccel-0.1.5.
|
|
52
|
-
esiaccel-0.1.5.
|
|
53
|
-
esiaccel-0.1.5.
|
|
49
|
+
esiaccel-0.1.5.dev376.dist-info/licenses/LICENSE,sha256=vtnVnB8_lN1yPYcA5MeT56R8UsQtBhyzZLBvu_KMf7I,13468
|
|
50
|
+
esiaccel-0.1.5.dev376.dist-info/METADATA,sha256=ZS7PYDMK0-yazusUQThL39OaqSlNRi27UH-0Et1lo0A,16148
|
|
51
|
+
esiaccel-0.1.5.dev376.dist-info/WHEEL,sha256=qV0EIPljj1XC_vuSatRWjn02nZIz3N1t8jsZz7HBr2U,101
|
|
52
|
+
esiaccel-0.1.5.dev376.dist-info/entry_points.txt,sha256=_CuNLV0fyTURxRREFwpzGycifZW_-7-MyuJNEwKK9J8,137
|
|
53
|
+
esiaccel-0.1.5.dev376.dist-info/top_level.txt,sha256=fYWTWMDK4PDu4ePQ9NtcFHas2k8-d1kWhTs2avPpgB4,9
|
|
54
|
+
esiaccel-0.1.5.dev376.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|