yowasp-yosys 0.59.0.0.post1038__py3-none-any.whl → 0.60.0.0.post1055__py3-none-any.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.
- yowasp_yosys/share/include/kernel/constids.inc +2 -0
- yowasp_yosys/share/include/kernel/ff.h +43 -35
- yowasp_yosys/share/include/kernel/log.h +6 -4
- yowasp_yosys/share/include/kernel/register.h +32 -0
- yowasp_yosys/share/include/kernel/rtlil.h +379 -224
- yowasp_yosys/share/include/kernel/yosys_common.h +30 -4
- yowasp_yosys/share/sdc/graph-stubs.sdc +42 -0
- yowasp_yosys/yosys.wasm +0 -0
- {yowasp_yosys-0.59.0.0.post1038.dist-info → yowasp_yosys-0.60.0.0.post1055.dist-info}/METADATA +1 -1
- {yowasp_yosys-0.59.0.0.post1038.dist-info → yowasp_yosys-0.60.0.0.post1055.dist-info}/RECORD +13 -13
- yowasp_yosys/share/cells.lib +0 -108
- {yowasp_yosys-0.59.0.0.post1038.dist-info → yowasp_yosys-0.60.0.0.post1055.dist-info}/WHEEL +0 -0
- {yowasp_yosys-0.59.0.0.post1038.dist-info → yowasp_yosys-0.60.0.0.post1055.dist-info}/entry_points.txt +0 -0
- {yowasp_yosys-0.59.0.0.post1038.dist-info → yowasp_yosys-0.60.0.0.post1055.dist-info}/top_level.txt +0 -0
|
@@ -196,6 +196,7 @@ X($bweqx)
|
|
|
196
196
|
X($bwmux)
|
|
197
197
|
X($check)
|
|
198
198
|
X($concat)
|
|
199
|
+
X($connect)
|
|
199
200
|
X($cover)
|
|
200
201
|
X($demux)
|
|
201
202
|
X($dff)
|
|
@@ -222,6 +223,7 @@ X($get_tag)
|
|
|
222
223
|
X($gt)
|
|
223
224
|
X($initstate)
|
|
224
225
|
X($input)
|
|
226
|
+
X($input_port)
|
|
225
227
|
X($lcu)
|
|
226
228
|
X($le)
|
|
227
229
|
X($live)
|
|
@@ -78,31 +78,20 @@ YOSYS_NAMESPACE_BEGIN
|
|
|
78
78
|
// - has_arst [does not correspond to a native cell, represented as dlatch with const D input]
|
|
79
79
|
// - empty set [not a cell — will be emitted as a simple direct connection]
|
|
80
80
|
|
|
81
|
-
struct
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
SigSpec sig_ce;
|
|
96
|
-
// The async load enable, present if has_aload.
|
|
97
|
-
SigSpec sig_aload;
|
|
98
|
-
// The async reset, preset if has_arst.
|
|
99
|
-
SigSpec sig_arst;
|
|
100
|
-
// The sync reset, preset if has_srst.
|
|
101
|
-
SigSpec sig_srst;
|
|
102
|
-
// The async clear (per-lane), present if has_sr.
|
|
103
|
-
SigSpec sig_clr;
|
|
104
|
-
// The async set (per-lane), present if has_sr.
|
|
105
|
-
SigSpec sig_set;
|
|
81
|
+
struct FfTypeData {
|
|
82
|
+
FfTypeData(IdString type);
|
|
83
|
+
FfTypeData() {
|
|
84
|
+
has_clk = false;
|
|
85
|
+
has_gclk = false;
|
|
86
|
+
has_ce = false;
|
|
87
|
+
has_aload = false;
|
|
88
|
+
has_srst = false;
|
|
89
|
+
has_arst = false;
|
|
90
|
+
has_sr = false;
|
|
91
|
+
ce_over_srst = false;
|
|
92
|
+
is_fine = false;
|
|
93
|
+
is_anyinit = false;
|
|
94
|
+
}
|
|
106
95
|
// True if this is a clocked (edge-sensitive) flip-flop.
|
|
107
96
|
bool has_clk;
|
|
108
97
|
// True if this is a $ff, exclusive with every other has_*.
|
|
@@ -143,9 +132,38 @@ struct FfData {
|
|
|
143
132
|
bool pol_clr;
|
|
144
133
|
bool pol_set;
|
|
145
134
|
// The value loaded by sig_arst.
|
|
135
|
+
// Zero length if unknowable from just type
|
|
146
136
|
Const val_arst;
|
|
147
137
|
// The value loaded by sig_srst.
|
|
138
|
+
// Zero length if unknowable from just type
|
|
148
139
|
Const val_srst;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
struct FfData : FfTypeData {
|
|
143
|
+
Module *module;
|
|
144
|
+
FfInitVals *initvals;
|
|
145
|
+
Cell *cell;
|
|
146
|
+
IdString name;
|
|
147
|
+
// The FF output.
|
|
148
|
+
SigSpec sig_q;
|
|
149
|
+
// The sync data input, present if has_clk or has_gclk.
|
|
150
|
+
SigSpec sig_d;
|
|
151
|
+
// The async data input, present if has_aload.
|
|
152
|
+
SigSpec sig_ad;
|
|
153
|
+
// The sync clock, present if has_clk.
|
|
154
|
+
SigSpec sig_clk;
|
|
155
|
+
// The clock enable, present if has_ce.
|
|
156
|
+
SigSpec sig_ce;
|
|
157
|
+
// The async load enable, present if has_aload.
|
|
158
|
+
SigSpec sig_aload;
|
|
159
|
+
// The async reset, preset if has_arst.
|
|
160
|
+
SigSpec sig_arst;
|
|
161
|
+
// The sync reset, preset if has_srst.
|
|
162
|
+
SigSpec sig_srst;
|
|
163
|
+
// The async clear (per-lane), present if has_sr.
|
|
164
|
+
SigSpec sig_clr;
|
|
165
|
+
// The async set (per-lane), present if has_sr.
|
|
166
|
+
SigSpec sig_set;
|
|
149
167
|
// The initial value at power-up.
|
|
150
168
|
Const val_init;
|
|
151
169
|
// The FF data width in bits.
|
|
@@ -154,16 +172,6 @@ struct FfData {
|
|
|
154
172
|
|
|
155
173
|
FfData(Module *module = nullptr, FfInitVals *initvals = nullptr, IdString name = IdString()) : module(module), initvals(initvals), cell(nullptr), name(name) {
|
|
156
174
|
width = 0;
|
|
157
|
-
has_clk = false;
|
|
158
|
-
has_gclk = false;
|
|
159
|
-
has_ce = false;
|
|
160
|
-
has_aload = false;
|
|
161
|
-
has_srst = false;
|
|
162
|
-
has_arst = false;
|
|
163
|
-
has_sr = false;
|
|
164
|
-
ce_over_srst = false;
|
|
165
|
-
is_fine = false;
|
|
166
|
-
is_anyinit = false;
|
|
167
175
|
pol_clk = false;
|
|
168
176
|
pol_aload = false;
|
|
169
177
|
pol_ce = false;
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
#include <time.h>
|
|
26
26
|
|
|
27
|
+
#include <atomic>
|
|
27
28
|
#include <regex>
|
|
28
29
|
#define YS_REGEX_COMPILE(param) std::regex(param, \
|
|
29
30
|
std::regex_constants::nosubs | \
|
|
@@ -298,15 +299,16 @@ void log_abort_internal(const char *file, int line);
|
|
|
298
299
|
|
|
299
300
|
#define cover(_id) do { \
|
|
300
301
|
static CoverData __d __attribute__((section("yosys_cover_list"), aligned(1), used)) = { __FILE__, __FUNCTION__, _id, __LINE__, 0 }; \
|
|
301
|
-
__d.counter
|
|
302
|
+
__d.counter.fetch_add(1, std::memory_order_relaxed); \
|
|
302
303
|
} while (0)
|
|
303
304
|
|
|
304
305
|
struct CoverData {
|
|
305
306
|
const char *file, *func, *id;
|
|
306
|
-
int line
|
|
307
|
-
|
|
307
|
+
int line;
|
|
308
|
+
std::atomic<int> counter;
|
|
309
|
+
};
|
|
308
310
|
|
|
309
|
-
// this two symbols are created by the linker
|
|
311
|
+
// this two symbols are created by the linker __start_yosys_cover_listfor the "yosys_cover_list" ELF section
|
|
310
312
|
extern "C" struct CoverData __start_yosys_cover_list[];
|
|
311
313
|
extern "C" struct CoverData __stop_yosys_cover_list[];
|
|
312
314
|
|
|
@@ -50,6 +50,30 @@ struct source_location { // dummy placeholder
|
|
|
50
50
|
|
|
51
51
|
YOSYS_NAMESPACE_BEGIN
|
|
52
52
|
|
|
53
|
+
// Track whether garbage collection is enabled. Garbage collection must be disabled
|
|
54
|
+
// while any RTLIL objects (e.g. non-owning non-immortal IdStrings) exist outside Designs.
|
|
55
|
+
// Garbage collection is disabled whenever any GarbageCollectionGuard(false) is on the
|
|
56
|
+
// stack. These objects must be stack-allocated on the main thread.
|
|
57
|
+
class GarbageCollectionGuard
|
|
58
|
+
{
|
|
59
|
+
bool was_enabled;
|
|
60
|
+
static bool is_enabled_;
|
|
61
|
+
public:
|
|
62
|
+
GarbageCollectionGuard(bool allow) : was_enabled(is_enabled_) {
|
|
63
|
+
is_enabled_ &= allow;
|
|
64
|
+
}
|
|
65
|
+
~GarbageCollectionGuard() {
|
|
66
|
+
is_enabled_ = was_enabled;
|
|
67
|
+
}
|
|
68
|
+
static bool is_enabled() { return is_enabled_; }
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Call from anywhere to request GC at the next safe point.
|
|
72
|
+
void request_garbage_collection();
|
|
73
|
+
|
|
74
|
+
// GC if GarbageCollectionGuard::is_enabled() and GC was requested.
|
|
75
|
+
void try_collect_garbage();
|
|
76
|
+
|
|
53
77
|
struct Pass
|
|
54
78
|
{
|
|
55
79
|
std::string pass_name, short_help;
|
|
@@ -71,6 +95,8 @@ struct Pass
|
|
|
71
95
|
bool experimental_flag = false;
|
|
72
96
|
bool internal_flag = false;
|
|
73
97
|
|
|
98
|
+
static void subtract_from_current_runtime_ns(int64_t time_ns);
|
|
99
|
+
|
|
74
100
|
void experimental() {
|
|
75
101
|
experimental_flag = true;
|
|
76
102
|
}
|
|
@@ -108,6 +134,10 @@ struct Pass
|
|
|
108
134
|
virtual void on_register();
|
|
109
135
|
virtual void on_shutdown();
|
|
110
136
|
virtual bool replace_existing_pass() const { return false; }
|
|
137
|
+
|
|
138
|
+
// This should return false if the pass holds onto RTLIL objects outside a Design while it
|
|
139
|
+
// calls nested passes. For safety, we default to assuming the worst.
|
|
140
|
+
virtual bool allow_garbage_collection_during_pass() const { return false; }
|
|
111
141
|
};
|
|
112
142
|
|
|
113
143
|
struct ScriptPass : Pass
|
|
@@ -126,6 +156,8 @@ struct ScriptPass : Pass
|
|
|
126
156
|
void run_nocheck(std::string command, std::string info = std::string());
|
|
127
157
|
void run_script(RTLIL::Design *design, std::string run_from = std::string(), std::string run_to = std::string());
|
|
128
158
|
void help_script();
|
|
159
|
+
|
|
160
|
+
bool allow_garbage_collection_during_pass() const override { return true; }
|
|
129
161
|
};
|
|
130
162
|
|
|
131
163
|
struct Frontend : Pass
|
|
@@ -53,10 +53,11 @@ namespace RTLIL
|
|
|
53
53
|
// Semantic metadata - how can this constant be interpreted?
|
|
54
54
|
// Values may be generally non-exclusive
|
|
55
55
|
enum ConstFlags : unsigned char {
|
|
56
|
-
CONST_FLAG_NONE
|
|
57
|
-
CONST_FLAG_STRING
|
|
58
|
-
CONST_FLAG_SIGNED
|
|
59
|
-
CONST_FLAG_REAL
|
|
56
|
+
CONST_FLAG_NONE = 0,
|
|
57
|
+
CONST_FLAG_STRING = 1,
|
|
58
|
+
CONST_FLAG_SIGNED = 2, // only used for parameters
|
|
59
|
+
CONST_FLAG_REAL = 4, // only used for parameters
|
|
60
|
+
CONST_FLAG_UNSIZED = 8, // only used for parameters
|
|
60
61
|
};
|
|
61
62
|
|
|
62
63
|
enum SelectPartials : unsigned char {
|
|
@@ -120,27 +121,30 @@ namespace RTLIL
|
|
|
120
121
|
struct Process;
|
|
121
122
|
struct Binding;
|
|
122
123
|
struct IdString;
|
|
123
|
-
struct
|
|
124
|
+
struct OwningIdString;
|
|
124
125
|
|
|
125
126
|
typedef std::pair<SigSpec, SigSpec> SigSig;
|
|
126
|
-
|
|
127
|
-
struct StaticIdString {
|
|
128
|
-
constexpr StaticIdString(StaticId id, const IdString &id_str) : id_str(id_str), id(id) {}
|
|
129
|
-
constexpr inline operator const IdString &() const { return id_str; }
|
|
130
|
-
constexpr inline int index() const { return static_cast<short>(id); }
|
|
131
|
-
constexpr inline const IdString &id_string() const { return id_str; }
|
|
132
|
-
|
|
133
|
-
const IdString &id_str;
|
|
134
|
-
const StaticId id;
|
|
135
|
-
};
|
|
136
127
|
};
|
|
137
128
|
|
|
138
129
|
struct RTLIL::IdString
|
|
139
130
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
131
|
+
struct Storage {
|
|
132
|
+
char *buf;
|
|
133
|
+
int size;
|
|
134
|
+
|
|
135
|
+
std::string_view str_view() const { return {buf, static_cast<size_t>(size)}; }
|
|
136
|
+
};
|
|
137
|
+
struct AutoidxStorage {
|
|
138
|
+
// Append the negated (i.e. positive) ID to this string to get
|
|
139
|
+
// the real string. The prefix strings must live forever.
|
|
140
|
+
const std::string *prefix;
|
|
141
|
+
// Cache of the full string, or nullptr if not cached yet.
|
|
142
|
+
std::atomic<char *> full_str;
|
|
143
|
+
|
|
144
|
+
AutoidxStorage(const std::string *prefix) : prefix(prefix), full_str(nullptr) {}
|
|
145
|
+
AutoidxStorage(AutoidxStorage&& other) : prefix(other.prefix), full_str(other.full_str.exchange(nullptr, std::memory_order_relaxed)) {}
|
|
146
|
+
~AutoidxStorage() { delete[] full_str.load(std::memory_order_acquire); }
|
|
147
|
+
};
|
|
144
148
|
|
|
145
149
|
// the global id string cache
|
|
146
150
|
|
|
@@ -150,200 +154,82 @@ struct RTLIL::IdString
|
|
|
150
154
|
~destruct_guard_t() { destruct_guard_ok = false; }
|
|
151
155
|
} destruct_guard;
|
|
152
156
|
|
|
153
|
-
|
|
157
|
+
// String storage for non-autoidx IDs
|
|
158
|
+
static std::vector<Storage> global_id_storage_;
|
|
159
|
+
// Lookup table for non-autoidx IDs
|
|
154
160
|
static std::unordered_map<std::string_view, int> global_id_index_;
|
|
155
|
-
|
|
156
|
-
//
|
|
157
|
-
|
|
158
|
-
//
|
|
159
|
-
|
|
160
|
-
// So, make this unsigned because refcounts of preopulated IdStrings may overflow
|
|
161
|
-
// and overflow of signed integers is undefined behavior.
|
|
162
|
-
static std::vector<uint32_t> global_refcount_storage_;
|
|
161
|
+
// Storage for autoidx IDs, which have negative indices, i.e. all entries in this
|
|
162
|
+
// map have negative keys.
|
|
163
|
+
static std::unordered_map<int, AutoidxStorage> global_autoidx_id_storage_;
|
|
164
|
+
// All (index, refcount) pairs in this map have refcount > 0.
|
|
165
|
+
static std::unordered_map<int, int> global_refcount_storage_;
|
|
163
166
|
static std::vector<int> global_free_idx_list_;
|
|
164
|
-
#endif
|
|
165
167
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
static int refcount(int idx) {
|
|
169
|
+
auto it = global_refcount_storage_.find(idx);
|
|
170
|
+
if (it == global_refcount_storage_.end())
|
|
171
|
+
return 0;
|
|
172
|
+
return it->second;
|
|
173
|
+
}
|
|
170
174
|
|
|
171
175
|
static inline void xtrace_db_dump()
|
|
172
176
|
{
|
|
173
177
|
#ifdef YOSYS_XTRACE_GET_PUT
|
|
174
178
|
for (int idx = 0; idx < GetSize(global_id_storage_); idx++)
|
|
175
179
|
{
|
|
176
|
-
if (global_id_storage_.at(idx) == nullptr)
|
|
180
|
+
if (global_id_storage_.at(idx).buf == nullptr)
|
|
177
181
|
log("#X# DB-DUMP index %d: FREE\n", idx);
|
|
178
182
|
else
|
|
179
|
-
log("#X# DB-DUMP index %d: '%s' (ref %u)\n", idx, global_id_storage_.at(idx),
|
|
183
|
+
log("#X# DB-DUMP index %d: '%s' (ref %u)\n", idx, global_id_storage_.at(idx).buf, refcount(idx));
|
|
180
184
|
}
|
|
181
185
|
#endif
|
|
182
186
|
}
|
|
183
187
|
|
|
184
188
|
static inline void checkpoint()
|
|
185
189
|
{
|
|
186
|
-
#ifdef YOSYS_USE_STICKY_IDS
|
|
187
|
-
last_created_idx_ptr_ = 0;
|
|
188
|
-
for (int i = 0; i < 8; i++) {
|
|
189
|
-
if (last_created_idx_[i])
|
|
190
|
-
put_reference(last_created_idx_[i]);
|
|
191
|
-
last_created_idx_[i] = 0;
|
|
192
|
-
}
|
|
193
|
-
#endif
|
|
194
190
|
#ifdef YOSYS_SORT_ID_FREE_LIST
|
|
195
191
|
std::sort(global_free_idx_list_.begin(), global_free_idx_list_.end(), std::greater<int>());
|
|
196
192
|
#endif
|
|
197
193
|
}
|
|
198
194
|
|
|
199
|
-
static
|
|
200
|
-
{
|
|
201
|
-
#ifndef YOSYS_NO_IDS_REFCNT
|
|
202
|
-
global_refcount_storage_[idx]++;
|
|
203
|
-
#endif
|
|
204
|
-
#ifdef YOSYS_XTRACE_GET_PUT
|
|
205
|
-
if (yosys_xtrace && idx >= static_cast<short>(StaticId::STATIC_ID_END))
|
|
206
|
-
log("#X# GET-BY-INDEX '%s' (index %d, refcount %u)\n", global_id_storage_.at(idx), idx, global_refcount_storage_.at(idx));
|
|
207
|
-
#endif
|
|
208
|
-
return idx;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
static int get_reference(const char *p)
|
|
212
|
-
{
|
|
213
|
-
return get_reference(std::string_view(p));
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
static int get_reference(std::string_view p)
|
|
195
|
+
static int insert(std::string_view p)
|
|
217
196
|
{
|
|
218
197
|
log_assert(destruct_guard_ok);
|
|
198
|
+
log_assert(!Multithreading::active());
|
|
219
199
|
|
|
220
200
|
auto it = global_id_index_.find(p);
|
|
221
201
|
if (it != global_id_index_.end()) {
|
|
222
|
-
#ifndef YOSYS_NO_IDS_REFCNT
|
|
223
|
-
global_refcount_storage_.at(it->second)++;
|
|
224
|
-
#endif
|
|
225
202
|
#ifdef YOSYS_XTRACE_GET_PUT
|
|
226
203
|
if (yosys_xtrace)
|
|
227
|
-
log("#X# GET-BY-NAME '%s' (index %d, refcount %u)\n", global_id_storage_.at(it->second), it->second,
|
|
204
|
+
log("#X# GET-BY-NAME '%s' (index %d, refcount %u)\n", global_id_storage_.at(it->second).buf, it->second, refcount(it->second));
|
|
228
205
|
#endif
|
|
229
206
|
return it->second;
|
|
230
207
|
}
|
|
231
|
-
|
|
232
|
-
ensure_prepopulated();
|
|
233
|
-
|
|
234
|
-
if (p.empty())
|
|
235
|
-
return 0;
|
|
236
|
-
|
|
237
|
-
log_assert(p[0] == '$' || p[0] == '\\');
|
|
238
|
-
for (char ch : p)
|
|
239
|
-
if ((unsigned)ch <= (unsigned)' ')
|
|
240
|
-
log_error("Found control character or space (0x%02x) in string '%s' which is not allowed in RTLIL identifiers\n", ch, std::string(p).c_str());
|
|
241
|
-
|
|
242
|
-
#ifndef YOSYS_NO_IDS_REFCNT
|
|
243
|
-
if (global_free_idx_list_.empty()) {
|
|
244
|
-
log_assert(global_id_storage_.size() < 0x40000000);
|
|
245
|
-
global_free_idx_list_.push_back(global_id_storage_.size());
|
|
246
|
-
global_id_storage_.push_back(nullptr);
|
|
247
|
-
global_refcount_storage_.push_back(0);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
int idx = global_free_idx_list_.back();
|
|
251
|
-
global_free_idx_list_.pop_back();
|
|
252
|
-
char* buf = static_cast<char*>(malloc(p.size() + 1));
|
|
253
|
-
memcpy(buf, p.data(), p.size());
|
|
254
|
-
buf[p.size()] = 0;
|
|
255
|
-
global_id_storage_.at(idx) = buf;
|
|
256
|
-
global_id_index_.insert(it, {std::string_view(buf, p.size()), idx});
|
|
257
|
-
global_refcount_storage_.at(idx)++;
|
|
258
|
-
#else
|
|
259
|
-
int idx = global_id_storage_.size();
|
|
260
|
-
global_id_storage_.push_back(strdup(p));
|
|
261
|
-
global_id_index_[global_id_storage_.back()] = idx;
|
|
262
|
-
#endif
|
|
263
|
-
|
|
264
|
-
if (yosys_xtrace) {
|
|
265
|
-
log("#X# New IdString '%s' with index %d.\n", global_id_storage_.at(idx), idx);
|
|
266
|
-
log_backtrace("-X- ", yosys_xtrace-1);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
#ifdef YOSYS_XTRACE_GET_PUT
|
|
270
|
-
if (yosys_xtrace)
|
|
271
|
-
log("#X# GET-BY-NAME '%s' (index %d, refcount %u)\n", global_id_storage_.at(idx), idx, global_refcount_storage_.at(idx));
|
|
272
|
-
#endif
|
|
273
|
-
|
|
274
|
-
#ifdef YOSYS_USE_STICKY_IDS
|
|
275
|
-
// Avoid Create->Delete->Create pattern
|
|
276
|
-
if (last_created_idx_[last_created_idx_ptr_])
|
|
277
|
-
put_reference(last_created_idx_[last_created_idx_ptr_]);
|
|
278
|
-
last_created_idx_[last_created_idx_ptr_] = idx;
|
|
279
|
-
get_reference(last_created_idx_[last_created_idx_ptr_]);
|
|
280
|
-
last_created_idx_ptr_ = (last_created_idx_ptr_ + 1) & 7;
|
|
281
|
-
#endif
|
|
282
|
-
|
|
283
|
-
return idx;
|
|
208
|
+
return really_insert(p, it);
|
|
284
209
|
}
|
|
285
210
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
{
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
#ifdef YOSYS_XTRACE_GET_PUT
|
|
295
|
-
if (yosys_xtrace) {
|
|
296
|
-
log("#X# PUT '%s' (index %d, refcount %u)\n", global_id_storage_.at(idx), idx, global_refcount_storage_.at(idx));
|
|
297
|
-
}
|
|
298
|
-
#endif
|
|
299
|
-
|
|
300
|
-
uint32_t &refcount = global_refcount_storage_[idx];
|
|
301
|
-
|
|
302
|
-
if (--refcount > 0)
|
|
303
|
-
return;
|
|
304
|
-
|
|
305
|
-
free_reference(idx);
|
|
306
|
-
}
|
|
307
|
-
static inline void free_reference(int idx)
|
|
308
|
-
{
|
|
309
|
-
if (yosys_xtrace) {
|
|
310
|
-
log("#X# Removed IdString '%s' with index %d.\n", global_id_storage_.at(idx), idx);
|
|
311
|
-
log_backtrace("-X- ", yosys_xtrace-1);
|
|
312
|
-
}
|
|
313
|
-
log_assert(idx >= static_cast<short>(StaticId::STATIC_ID_END));
|
|
314
|
-
|
|
315
|
-
global_id_index_.erase(global_id_storage_.at(idx));
|
|
316
|
-
free(global_id_storage_.at(idx));
|
|
317
|
-
global_id_storage_.at(idx) = nullptr;
|
|
318
|
-
global_free_idx_list_.push_back(idx);
|
|
211
|
+
// Inserts an ID with string `prefix + autoidx', incrementing autoidx.
|
|
212
|
+
// `prefix` must start with '$auto$', end with '$', and live forever.
|
|
213
|
+
static IdString new_autoidx_with_prefix(const std::string *prefix) {
|
|
214
|
+
log_assert(!Multithreading::active());
|
|
215
|
+
int index = -(autoidx++);
|
|
216
|
+
global_autoidx_id_storage_.insert({index, prefix});
|
|
217
|
+
return from_index(index);
|
|
319
218
|
}
|
|
320
|
-
#else
|
|
321
|
-
static inline void put_reference(int) { }
|
|
322
|
-
#endif
|
|
323
219
|
|
|
324
220
|
// the actual IdString object is just is a single int
|
|
325
221
|
|
|
326
222
|
int index_;
|
|
327
223
|
|
|
328
|
-
inline IdString() : index_(0) { }
|
|
329
|
-
inline IdString(const char *str) : index_(
|
|
330
|
-
inline IdString(const IdString &str) : index_(
|
|
224
|
+
constexpr inline IdString() : index_(0) { }
|
|
225
|
+
inline IdString(const char *str) : index_(insert(std::string_view(str))) { }
|
|
226
|
+
constexpr inline IdString(const IdString &str) : index_(str.index_) { }
|
|
331
227
|
inline IdString(IdString &&str) : index_(str.index_) { str.index_ = 0; }
|
|
332
|
-
inline IdString(const std::string &str) : index_(
|
|
333
|
-
inline IdString(std::string_view str) : index_(
|
|
334
|
-
inline IdString(StaticId id) : index_(static_cast<short>(id)) {}
|
|
335
|
-
inline ~IdString() { put_reference(index_); }
|
|
336
|
-
|
|
337
|
-
inline void operator=(const IdString &rhs) {
|
|
338
|
-
put_reference(index_);
|
|
339
|
-
index_ = get_reference(rhs.index_);
|
|
340
|
-
}
|
|
228
|
+
inline IdString(const std::string &str) : index_(insert(std::string_view(str))) { }
|
|
229
|
+
inline IdString(std::string_view str) : index_(insert(str)) { }
|
|
230
|
+
constexpr inline IdString(StaticId id) : index_(static_cast<short>(id)) {}
|
|
341
231
|
|
|
342
|
-
|
|
343
|
-
put_reference(index_);
|
|
344
|
-
index_ = rhs.index_;
|
|
345
|
-
rhs.index_ = 0;
|
|
346
|
-
}
|
|
232
|
+
IdString &operator=(const IdString &rhs) = default;
|
|
347
233
|
|
|
348
234
|
inline void operator=(const char *rhs) {
|
|
349
235
|
IdString id(rhs);
|
|
@@ -358,11 +244,159 @@ struct RTLIL::IdString
|
|
|
358
244
|
constexpr inline const IdString &id_string() const { return *this; }
|
|
359
245
|
|
|
360
246
|
inline const char *c_str() const {
|
|
361
|
-
|
|
247
|
+
if (index_ >= 0)
|
|
248
|
+
return global_id_storage_.at(index_).buf;
|
|
249
|
+
|
|
250
|
+
AutoidxStorage &s = global_autoidx_id_storage_.at(index_);
|
|
251
|
+
char *full_str = s.full_str.load(std::memory_order_acquire);
|
|
252
|
+
if (full_str != nullptr)
|
|
253
|
+
return full_str;
|
|
254
|
+
const std::string &prefix = *s.prefix;
|
|
255
|
+
std::string suffix = std::to_string(-index_);
|
|
256
|
+
char *c = new char[prefix.size() + suffix.size() + 1];
|
|
257
|
+
memcpy(c, prefix.data(), prefix.size());
|
|
258
|
+
memcpy(c + prefix.size(), suffix.c_str(), suffix.size() + 1);
|
|
259
|
+
if (s.full_str.compare_exchange_strong(full_str, c, std::memory_order_acq_rel))
|
|
260
|
+
return c;
|
|
261
|
+
delete[] c;
|
|
262
|
+
return full_str;
|
|
362
263
|
}
|
|
363
264
|
|
|
364
265
|
inline std::string str() const {
|
|
365
|
-
|
|
266
|
+
std::string result;
|
|
267
|
+
append_to(&result);
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
inline void append_to(std::string *out) const {
|
|
272
|
+
if (index_ >= 0) {
|
|
273
|
+
*out += global_id_storage_.at(index_).str_view();
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
*out += *global_autoidx_id_storage_.at(index_).prefix;
|
|
277
|
+
*out += std::to_string(-index_);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
class Substrings {
|
|
281
|
+
std::string_view first_;
|
|
282
|
+
int suffix_number;
|
|
283
|
+
char buf[10];
|
|
284
|
+
public:
|
|
285
|
+
Substrings(const Storage &storage) : first_(storage.str_view()), suffix_number(-1) {}
|
|
286
|
+
// suffix_number must be non-negative
|
|
287
|
+
Substrings(const std::string *prefix, int suffix_number)
|
|
288
|
+
: first_(*prefix), suffix_number(suffix_number) {}
|
|
289
|
+
std::string_view first() { return first_; }
|
|
290
|
+
std::optional<std::string_view> next() {
|
|
291
|
+
if (suffix_number < 0)
|
|
292
|
+
return std::nullopt;
|
|
293
|
+
int i = sizeof(buf);
|
|
294
|
+
do {
|
|
295
|
+
--i;
|
|
296
|
+
buf[i] = (suffix_number % 10) + '0';
|
|
297
|
+
suffix_number /= 10;
|
|
298
|
+
} while (suffix_number > 0);
|
|
299
|
+
suffix_number = -1;
|
|
300
|
+
return std::string_view(buf + i, sizeof(buf) - i);
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
class const_iterator {
|
|
305
|
+
const std::string *prefix;
|
|
306
|
+
std::string suffix;
|
|
307
|
+
const char *c_str;
|
|
308
|
+
int c_str_len;
|
|
309
|
+
// When this is INT_MAX it's the generic "end" value.
|
|
310
|
+
int index;
|
|
311
|
+
|
|
312
|
+
public:
|
|
313
|
+
using iterator_category = std::forward_iterator_tag;
|
|
314
|
+
using value_type = char;
|
|
315
|
+
using difference_type = std::ptrdiff_t;
|
|
316
|
+
using pointer = const char*;
|
|
317
|
+
using reference = const char&;
|
|
318
|
+
|
|
319
|
+
const_iterator(const Storage &storage) : prefix(nullptr), c_str(storage.buf), c_str_len(storage.size), index(0) {}
|
|
320
|
+
const_iterator(const std::string *prefix, int number) :
|
|
321
|
+
prefix(prefix), suffix(std::to_string(number)), c_str(nullptr), c_str_len(0), index(0) {}
|
|
322
|
+
// Construct end-marker
|
|
323
|
+
const_iterator() : prefix(nullptr), c_str(nullptr), c_str_len(0), index(INT_MAX) {}
|
|
324
|
+
|
|
325
|
+
int size() const {
|
|
326
|
+
if (c_str != nullptr)
|
|
327
|
+
return c_str_len;
|
|
328
|
+
return GetSize(*prefix) + GetSize(suffix);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
char operator*() const {
|
|
332
|
+
if (c_str != nullptr)
|
|
333
|
+
return c_str[index];
|
|
334
|
+
int prefix_size = GetSize(*prefix);
|
|
335
|
+
if (index < prefix_size)
|
|
336
|
+
return prefix->at(index);
|
|
337
|
+
return suffix[index - prefix_size];
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
const_iterator& operator++() { ++index; return *this; }
|
|
341
|
+
const_iterator operator++(int) { const_iterator result(*this); ++index; return result; }
|
|
342
|
+
const_iterator& operator+=(int i) { index += i; return *this; }
|
|
343
|
+
|
|
344
|
+
const_iterator operator+(int add) {
|
|
345
|
+
const_iterator result = *this;
|
|
346
|
+
result += add;
|
|
347
|
+
return result;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
bool operator==(const const_iterator& other) const {
|
|
351
|
+
return index == other.index || (other.index == INT_MAX && index == size())
|
|
352
|
+
|| (index == INT_MAX && other.index == other.size());
|
|
353
|
+
}
|
|
354
|
+
bool operator!=(const const_iterator& other) const {
|
|
355
|
+
return !(*this == other);
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
const_iterator begin() const {
|
|
359
|
+
if (index_ >= 0) {
|
|
360
|
+
return const_iterator(global_id_storage_.at(index_));
|
|
361
|
+
}
|
|
362
|
+
return const_iterator(global_autoidx_id_storage_.at(index_).prefix, -index_);
|
|
363
|
+
}
|
|
364
|
+
const_iterator end() const {
|
|
365
|
+
return const_iterator();
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
Substrings substrings() const {
|
|
369
|
+
if (index_ >= 0) {
|
|
370
|
+
return Substrings(global_id_storage_.at(index_));
|
|
371
|
+
}
|
|
372
|
+
return Substrings(global_autoidx_id_storage_.at(index_).prefix, -index_);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
inline bool lt_by_name(const IdString &rhs) const {
|
|
376
|
+
Substrings lhs_it = substrings();
|
|
377
|
+
Substrings rhs_it = rhs.substrings();
|
|
378
|
+
std::string_view lhs_substr = lhs_it.first();
|
|
379
|
+
std::string_view rhs_substr = rhs_it.first();
|
|
380
|
+
while (true) {
|
|
381
|
+
int min = std::min(GetSize(lhs_substr), GetSize(rhs_substr));
|
|
382
|
+
int diff = memcmp(lhs_substr.data(), rhs_substr.data(), min);
|
|
383
|
+
if (diff != 0)
|
|
384
|
+
return diff < 0;
|
|
385
|
+
lhs_substr = lhs_substr.substr(min);
|
|
386
|
+
rhs_substr = rhs_substr.substr(min);
|
|
387
|
+
if (rhs_substr.empty()) {
|
|
388
|
+
if (std::optional<std::string_view> s = rhs_it.next())
|
|
389
|
+
rhs_substr = *s;
|
|
390
|
+
else
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
if (lhs_substr.empty()) {
|
|
394
|
+
if (std::optional<std::string_view> s = lhs_it.next())
|
|
395
|
+
lhs_substr = *s;
|
|
396
|
+
else
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
366
400
|
}
|
|
367
401
|
|
|
368
402
|
inline bool operator<(const IdString &rhs) const {
|
|
@@ -371,8 +405,6 @@ struct RTLIL::IdString
|
|
|
371
405
|
|
|
372
406
|
inline bool operator==(const IdString &rhs) const { return index_ == rhs.index_; }
|
|
373
407
|
inline bool operator!=(const IdString &rhs) const { return index_ != rhs.index_; }
|
|
374
|
-
inline bool operator==(const StaticIdString &rhs) const;
|
|
375
|
-
inline bool operator!=(const StaticIdString &rhs) const;
|
|
376
408
|
|
|
377
409
|
// The methods below are just convenience functions for better compatibility with std::string.
|
|
378
410
|
|
|
@@ -383,45 +415,84 @@ struct RTLIL::IdString
|
|
|
383
415
|
bool operator!=(const char *rhs) const { return strcmp(c_str(), rhs) != 0; }
|
|
384
416
|
|
|
385
417
|
char operator[](size_t i) const {
|
|
386
|
-
|
|
418
|
+
if (index_ >= 0) {
|
|
419
|
+
const Storage &storage = global_id_storage_.at(index_);
|
|
387
420
|
#ifndef NDEBUG
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
421
|
+
log_assert(static_cast<int>(i) < storage.size);
|
|
422
|
+
#endif
|
|
423
|
+
return *(storage.buf + i);
|
|
424
|
+
}
|
|
425
|
+
const std::string &id_start = *global_autoidx_id_storage_.at(index_).prefix;
|
|
426
|
+
if (i < id_start.size())
|
|
427
|
+
return id_start[i];
|
|
428
|
+
i -= id_start.size();
|
|
429
|
+
std::string suffix = std::to_string(-index_);
|
|
430
|
+
#ifndef NDEBUG
|
|
431
|
+
// Allow indexing to access the trailing null.
|
|
432
|
+
log_assert(i <= suffix.size());
|
|
393
433
|
#endif
|
|
434
|
+
return suffix[i];
|
|
394
435
|
}
|
|
395
436
|
|
|
396
437
|
std::string substr(size_t pos = 0, size_t len = std::string::npos) const {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
438
|
+
std::string result;
|
|
439
|
+
const_iterator it = begin() + pos;
|
|
440
|
+
const_iterator end_it = end();
|
|
441
|
+
if (len != std::string::npos && len < it.size() - pos) {
|
|
442
|
+
end_it = it + len;
|
|
443
|
+
}
|
|
444
|
+
std::copy(it, end_it, std::back_inserter(result));
|
|
445
|
+
return result;
|
|
401
446
|
}
|
|
402
447
|
|
|
403
448
|
int compare(size_t pos, size_t len, const char* s) const {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
449
|
+
const_iterator it = begin() + pos;
|
|
450
|
+
const_iterator end_it = end();
|
|
451
|
+
while (len > 0 && *s != 0 && it != end_it) {
|
|
452
|
+
int diff = *it - *s;
|
|
453
|
+
if (diff != 0)
|
|
454
|
+
return diff;
|
|
455
|
+
++it;
|
|
456
|
+
++s;
|
|
457
|
+
--len;
|
|
458
|
+
}
|
|
459
|
+
return 0;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
bool begins_with(std::string_view prefix) const {
|
|
463
|
+
Substrings it = substrings();
|
|
464
|
+
std::string_view substr = it.first();
|
|
465
|
+
while (true) {
|
|
466
|
+
int min = std::min(GetSize(substr), GetSize(prefix));
|
|
467
|
+
if (memcmp(substr.data(), prefix.data(), min) != 0)
|
|
468
|
+
return false;
|
|
469
|
+
prefix = prefix.substr(min);
|
|
470
|
+
if (prefix.empty())
|
|
471
|
+
return true;
|
|
472
|
+
substr = substr.substr(min);
|
|
473
|
+
if (substr.empty()) {
|
|
474
|
+
if (std::optional<std::string_view> s = it.next())
|
|
475
|
+
substr = *s;
|
|
476
|
+
else
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
411
480
|
}
|
|
412
481
|
|
|
413
|
-
bool ends_with(
|
|
414
|
-
size_t
|
|
415
|
-
if (
|
|
416
|
-
return compare(size()
|
|
482
|
+
bool ends_with(std::string_view suffix) const {
|
|
483
|
+
size_t sz = size();
|
|
484
|
+
if (sz < suffix.size()) return false;
|
|
485
|
+
return compare(sz - suffix.size(), suffix.size(), suffix.data()) == 0;
|
|
417
486
|
}
|
|
418
487
|
|
|
419
|
-
bool contains(
|
|
420
|
-
|
|
488
|
+
bool contains(std::string_view s) const {
|
|
489
|
+
if (index_ >= 0)
|
|
490
|
+
return global_id_storage_.at(index_).str_view().find(s) != std::string::npos;
|
|
491
|
+
return str().find(s) != std::string::npos;
|
|
421
492
|
}
|
|
422
493
|
|
|
423
494
|
size_t size() const {
|
|
424
|
-
return
|
|
495
|
+
return begin().size();
|
|
425
496
|
}
|
|
426
497
|
|
|
427
498
|
bool empty() const {
|
|
@@ -458,7 +529,6 @@ struct RTLIL::IdString
|
|
|
458
529
|
}
|
|
459
530
|
|
|
460
531
|
bool in(const IdString &rhs) const { return *this == rhs; }
|
|
461
|
-
bool in(const StaticIdString &rhs) const { return *this == rhs; }
|
|
462
532
|
bool in(const char *rhs) const { return *this == rhs; }
|
|
463
533
|
bool in(const std::string &rhs) const { return *this == rhs; }
|
|
464
534
|
inline bool in(const pool<IdString> &rhs) const;
|
|
@@ -468,6 +538,14 @@ struct RTLIL::IdString
|
|
|
468
538
|
|
|
469
539
|
private:
|
|
470
540
|
static void prepopulate();
|
|
541
|
+
static int really_insert(std::string_view p, std::unordered_map<std::string_view, int>::iterator &it);
|
|
542
|
+
|
|
543
|
+
protected:
|
|
544
|
+
static IdString from_index(int index) {
|
|
545
|
+
IdString result;
|
|
546
|
+
result.index_ = index;
|
|
547
|
+
return result;
|
|
548
|
+
}
|
|
471
549
|
|
|
472
550
|
public:
|
|
473
551
|
static void ensure_prepopulated() {
|
|
@@ -476,6 +554,95 @@ public:
|
|
|
476
554
|
}
|
|
477
555
|
};
|
|
478
556
|
|
|
557
|
+
struct RTLIL::OwningIdString : public RTLIL::IdString {
|
|
558
|
+
inline OwningIdString() { }
|
|
559
|
+
inline OwningIdString(const OwningIdString &str) : IdString(str) { get_reference(); }
|
|
560
|
+
inline OwningIdString(const char *str) : IdString(str) { get_reference(); }
|
|
561
|
+
inline OwningIdString(const IdString &str) : IdString(str) { get_reference(); }
|
|
562
|
+
inline OwningIdString(IdString &&str) : IdString(str) { get_reference(); }
|
|
563
|
+
inline OwningIdString(const std::string &str) : IdString(str) { get_reference(); }
|
|
564
|
+
inline OwningIdString(std::string_view str) : IdString(str) { get_reference(); }
|
|
565
|
+
inline OwningIdString(StaticId id) : IdString(id) {}
|
|
566
|
+
inline ~OwningIdString() {
|
|
567
|
+
put_reference();
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
inline OwningIdString &operator=(const OwningIdString &rhs) {
|
|
571
|
+
put_reference();
|
|
572
|
+
index_ = rhs.index_;
|
|
573
|
+
get_reference();
|
|
574
|
+
return *this;
|
|
575
|
+
}
|
|
576
|
+
inline OwningIdString &operator=(const IdString &rhs) {
|
|
577
|
+
put_reference();
|
|
578
|
+
index_ = rhs.index_;
|
|
579
|
+
get_reference();
|
|
580
|
+
return *this;
|
|
581
|
+
}
|
|
582
|
+
inline OwningIdString &operator=(OwningIdString &&rhs) {
|
|
583
|
+
std::swap(index_, rhs.index_);
|
|
584
|
+
return *this;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// Collect all non-owning references.
|
|
588
|
+
static void collect_garbage();
|
|
589
|
+
static int64_t garbage_collection_ns() { return gc_ns; }
|
|
590
|
+
static int garbage_collection_count() { return gc_count; }
|
|
591
|
+
|
|
592
|
+
// Used by the ID() macro to create an IdString with no destructor whose string will
|
|
593
|
+
// never be released. If ID() creates a closure-static `OwningIdString` then
|
|
594
|
+
// initialization of the static registers its destructor to run at exit, which is
|
|
595
|
+
// wasteful.
|
|
596
|
+
static IdString immortal(const char* str) {
|
|
597
|
+
IdString result(str);
|
|
598
|
+
get_reference(result.index_);
|
|
599
|
+
return result;
|
|
600
|
+
}
|
|
601
|
+
private:
|
|
602
|
+
static int64_t gc_ns;
|
|
603
|
+
static int gc_count;
|
|
604
|
+
|
|
605
|
+
void get_reference()
|
|
606
|
+
{
|
|
607
|
+
get_reference(index_);
|
|
608
|
+
}
|
|
609
|
+
static void get_reference(int idx)
|
|
610
|
+
{
|
|
611
|
+
log_assert(!Multithreading::active());
|
|
612
|
+
|
|
613
|
+
if (idx < static_cast<short>(StaticId::STATIC_ID_END))
|
|
614
|
+
return;
|
|
615
|
+
auto it = global_refcount_storage_.find(idx);
|
|
616
|
+
if (it == global_refcount_storage_.end())
|
|
617
|
+
global_refcount_storage_.insert(it, {idx, 1});
|
|
618
|
+
else
|
|
619
|
+
++it->second;
|
|
620
|
+
#ifdef YOSYS_XTRACE_GET_PUT
|
|
621
|
+
if (yosys_xtrace && idx >= static_cast<short>(StaticId::STATIC_ID_END))
|
|
622
|
+
log("#X# GET-BY-INDEX '%s' (index %d, refcount %u)\n", from_index(idx), idx, refcount(idx));
|
|
623
|
+
#endif
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
void put_reference()
|
|
627
|
+
{
|
|
628
|
+
log_assert(!Multithreading::active());
|
|
629
|
+
|
|
630
|
+
// put_reference() may be called from destructors after the destructor of
|
|
631
|
+
// global_refcount_storage_ has been run. in this case we simply do nothing.
|
|
632
|
+
if (index_ < static_cast<short>(StaticId::STATIC_ID_END) || !destruct_guard_ok)
|
|
633
|
+
return;
|
|
634
|
+
#ifdef YOSYS_XTRACE_GET_PUT
|
|
635
|
+
if (yosys_xtrace)
|
|
636
|
+
log("#X# PUT '%s' (index %d, refcount %u)\n", from_index(index_), index_, refcount(index_));
|
|
637
|
+
#endif
|
|
638
|
+
auto it = global_refcount_storage_.find(index_);
|
|
639
|
+
log_assert(it != global_refcount_storage_.end() && it->second >= 1);
|
|
640
|
+
if (--it->second == 0) {
|
|
641
|
+
global_refcount_storage_.erase(it);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
|
|
479
646
|
namespace hashlib {
|
|
480
647
|
template <>
|
|
481
648
|
struct hash_ops<RTLIL::IdString> {
|
|
@@ -501,21 +668,9 @@ inline bool RTLIL::IdString::in(const pool<IdString> &rhs) const { return rhs.co
|
|
|
501
668
|
[[deprecated]]
|
|
502
669
|
inline bool RTLIL::IdString::in(const pool<IdString> &&rhs) const { return rhs.count(*this) != 0; }
|
|
503
670
|
|
|
504
|
-
inline bool RTLIL::IdString::operator==(const RTLIL::StaticIdString &rhs) const {
|
|
505
|
-
return index_ == rhs.index();
|
|
506
|
-
}
|
|
507
|
-
inline bool RTLIL::IdString::operator!=(const RTLIL::StaticIdString &rhs) const {
|
|
508
|
-
return index_ != rhs.index();
|
|
509
|
-
}
|
|
510
|
-
|
|
511
671
|
namespace RTLIL {
|
|
512
|
-
namespace IDInternal {
|
|
513
|
-
#define X(_id) extern const IdString _id;
|
|
514
|
-
#include "kernel/constids.inc"
|
|
515
|
-
#undef X
|
|
516
|
-
}
|
|
517
672
|
namespace ID {
|
|
518
|
-
#define X(_id) constexpr
|
|
673
|
+
#define X(_id) constexpr IdString _id(StaticId::_id);
|
|
519
674
|
#include "kernel/constids.inc"
|
|
520
675
|
#undef X
|
|
521
676
|
}
|
|
@@ -523,7 +678,7 @@ namespace RTLIL {
|
|
|
523
678
|
|
|
524
679
|
struct IdTableEntry {
|
|
525
680
|
const std::string_view name;
|
|
526
|
-
const RTLIL::
|
|
681
|
+
const RTLIL::IdString static_id;
|
|
527
682
|
};
|
|
528
683
|
|
|
529
684
|
constexpr IdTableEntry IdTable[] = {
|
|
@@ -556,15 +711,15 @@ constexpr int lookup_well_known_id(std::string_view name)
|
|
|
556
711
|
//
|
|
557
712
|
// sed -i.orig -r 's/"\\\\([a-zA-Z0-9_]+)"/ID(\1)/g; s/"(\$[a-zA-Z0-9_]+)"/ID(\1)/g;' <filename>
|
|
558
713
|
//
|
|
559
|
-
typedef
|
|
714
|
+
typedef RTLIL::IdString IDMacroHelperFunc();
|
|
560
715
|
|
|
561
716
|
template <int IdTableIndex> struct IDMacroHelper {
|
|
562
|
-
static constexpr RTLIL::
|
|
717
|
+
static constexpr RTLIL::IdString eval(IDMacroHelperFunc) {
|
|
563
718
|
return IdTable[IdTableIndex].static_id;
|
|
564
719
|
}
|
|
565
720
|
};
|
|
566
721
|
template <> struct IDMacroHelper<-1> {
|
|
567
|
-
static constexpr
|
|
722
|
+
static constexpr RTLIL::IdString eval(IDMacroHelperFunc func) {
|
|
568
723
|
return func();
|
|
569
724
|
}
|
|
570
725
|
};
|
|
@@ -574,16 +729,16 @@ template <> struct IDMacroHelper<-1> {
|
|
|
574
729
|
YOSYS_NAMESPACE_PREFIX IDMacroHelper< \
|
|
575
730
|
YOSYS_NAMESPACE_PREFIX lookup_well_known_id(#_id) \
|
|
576
731
|
>::eval([]() \
|
|
577
|
-
->
|
|
732
|
+
-> YOSYS_NAMESPACE_PREFIX RTLIL::IdString { \
|
|
578
733
|
const char *p = "\\" #_id, *q = p[1] == '$' ? p+1 : p; \
|
|
579
|
-
static const YOSYS_NAMESPACE_PREFIX RTLIL::IdString id
|
|
734
|
+
static const YOSYS_NAMESPACE_PREFIX RTLIL::IdString id = \
|
|
735
|
+
YOSYS_NAMESPACE_PREFIX RTLIL::OwningIdString::immortal(q); \
|
|
580
736
|
return id; \
|
|
581
737
|
})
|
|
582
738
|
|
|
583
739
|
namespace RTLIL {
|
|
584
740
|
extern dict<std::string, std::string> constpad;
|
|
585
741
|
|
|
586
|
-
[[deprecated("Call cell->is_builtin_ff() instead")]]
|
|
587
742
|
const pool<IdString> &builtin_ff_cell_types();
|
|
588
743
|
|
|
589
744
|
static inline std::string escape_id(const std::string &str) {
|
|
@@ -620,13 +775,13 @@ namespace RTLIL {
|
|
|
620
775
|
|
|
621
776
|
template <typename T> struct sort_by_name_str {
|
|
622
777
|
bool operator()(T *a, T *b) const {
|
|
623
|
-
return
|
|
778
|
+
return a->name.lt_by_name(b->name);
|
|
624
779
|
}
|
|
625
780
|
};
|
|
626
781
|
|
|
627
782
|
struct sort_by_id_str {
|
|
628
783
|
bool operator()(const RTLIL::IdString &a, const RTLIL::IdString &b) const {
|
|
629
|
-
return
|
|
784
|
+
return a.lt_by_name(b);
|
|
630
785
|
}
|
|
631
786
|
};
|
|
632
787
|
|
|
@@ -1581,6 +1736,8 @@ public:
|
|
|
1581
1736
|
operator std::vector<RTLIL::SigChunk>() const;
|
|
1582
1737
|
operator std::vector<RTLIL::SigBit>() const { return to_sigbit_vector(); }
|
|
1583
1738
|
const RTLIL::SigBit &at(int offset, const RTLIL::SigBit &defval) { return offset < size() ? (*this)[offset] : defval; }
|
|
1739
|
+
RTLIL::SigBit& at(int offset) { return (*this)[offset]; }
|
|
1740
|
+
RTLIL::SigBit at(int offset) const { return (*this)[offset]; }
|
|
1584
1741
|
|
|
1585
1742
|
[[nodiscard]] Hasher hash_into(Hasher h) const {
|
|
1586
1743
|
Hasher::hash_t val;
|
|
@@ -1876,9 +2033,7 @@ struct RTLIL::Design
|
|
|
1876
2033
|
// returns all selected unboxed whole modules, warning the user if any
|
|
1877
2034
|
// partially selected or boxed modules have been ignored
|
|
1878
2035
|
std::vector<RTLIL::Module*> selected_unboxed_whole_modules_warn() const { return selected_modules(SELECT_WHOLE_WARN, SB_UNBOXED_WARN); }
|
|
1879
|
-
#ifdef YOSYS_ENABLE_PYTHON
|
|
1880
2036
|
static std::map<unsigned int, RTLIL::Design*> *get_all_designs(void);
|
|
1881
|
-
#endif
|
|
1882
2037
|
};
|
|
1883
2038
|
|
|
1884
2039
|
struct RTLIL::Module : public RTLIL::NamedObject
|
|
@@ -267,15 +267,41 @@ int ceil_log2(int x) YS_ATTRIBUTE(const);
|
|
|
267
267
|
template<typename T> int GetSize(const T &obj) { return obj.size(); }
|
|
268
268
|
inline int GetSize(RTLIL::Wire *wire);
|
|
269
269
|
|
|
270
|
-
|
|
270
|
+
// When multiple threads are accessing RTLIL, one of these guard objects
|
|
271
|
+
// must exist.
|
|
272
|
+
struct Multithreading
|
|
273
|
+
{
|
|
274
|
+
Multithreading();
|
|
275
|
+
~Multithreading();
|
|
276
|
+
// Returns true when multiple threads are accessing RTLIL.
|
|
277
|
+
// autoidx cannot be used during such times.
|
|
278
|
+
// IdStrings cannot be created during such times.
|
|
279
|
+
static bool active() { return active_; }
|
|
280
|
+
private:
|
|
281
|
+
static bool active_;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
struct Autoidx {
|
|
285
|
+
Autoidx(int value) : value(value) {}
|
|
286
|
+
operator int() const { return value; }
|
|
287
|
+
void ensure_at_least(int v);
|
|
288
|
+
int operator++(int);
|
|
289
|
+
private:
|
|
290
|
+
int value;
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
extern Autoidx autoidx;
|
|
271
294
|
extern int yosys_xtrace;
|
|
272
295
|
extern bool yosys_write_versions;
|
|
273
296
|
|
|
274
|
-
|
|
275
|
-
RTLIL::IdString new_id_suffix(std::
|
|
297
|
+
const std::string *create_id_prefix(std::string_view file, int line, std::string_view func);
|
|
298
|
+
RTLIL::IdString new_id_suffix(std::string_view file, int line, std::string_view func, std::string_view suffix);
|
|
276
299
|
|
|
277
300
|
#define NEW_ID \
|
|
278
|
-
YOSYS_NAMESPACE_PREFIX
|
|
301
|
+
YOSYS_NAMESPACE_PREFIX RTLIL::IdString::new_autoidx_with_prefix([](std::string_view func) -> const std::string * { \
|
|
302
|
+
static const std::string *prefix = YOSYS_NAMESPACE_PREFIX create_id_prefix(__FILE__, __LINE__, func); \
|
|
303
|
+
return prefix; \
|
|
304
|
+
}(__FUNCTION__))
|
|
279
305
|
#define NEW_ID_SUFFIX(suffix) \
|
|
280
306
|
YOSYS_NAMESPACE_PREFIX new_id_suffix(__FILE__, __LINE__, __FUNCTION__, suffix)
|
|
281
307
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
proc unknown {args} {
|
|
2
|
+
# Check if it's a getter
|
|
3
|
+
if {[llength $args] > 0} {
|
|
4
|
+
set first_arg [lindex $args 0]
|
|
5
|
+
if {[string match "get_*" $first_arg]} {
|
|
6
|
+
# It's a getter, has it been redirected from specialized C++ code?
|
|
7
|
+
if {[llength $args] > 1} {
|
|
8
|
+
set second_arg [lindex $args 1]
|
|
9
|
+
if {$second_arg ne "-getter-validated"} {
|
|
10
|
+
error "Unknown getter: $first_arg"
|
|
11
|
+
}
|
|
12
|
+
} else {
|
|
13
|
+
error "Unknown getter: $first_arg"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
# TODO this safety feature could be optional via a global
|
|
18
|
+
|
|
19
|
+
global sdc_call_index
|
|
20
|
+
global sdc_calls
|
|
21
|
+
if {![info exists sdc_call_index]} {
|
|
22
|
+
set sdc_call_index 0
|
|
23
|
+
}
|
|
24
|
+
if {![info exists sdc_calls]} {
|
|
25
|
+
set sdc_calls {}
|
|
26
|
+
}
|
|
27
|
+
set ret "YOSYS_SDC_MAGIC_NODE_$sdc_call_index"
|
|
28
|
+
incr sdc_call_index
|
|
29
|
+
lappend sdc_calls $args
|
|
30
|
+
# puts "unknown $args, returning YOSYS_SDC_MAGIC_NODE_$sdc_call_index"
|
|
31
|
+
return $ret
|
|
32
|
+
}
|
|
33
|
+
proc list {args} {
|
|
34
|
+
return [unknown "list" {*}$args]
|
|
35
|
+
}
|
|
36
|
+
proc get_clocks {args} {
|
|
37
|
+
# get_clocks isn't a design object getter
|
|
38
|
+
# because clocks aren't design objects, just aliases
|
|
39
|
+
# so the referred to clock pin already are being tracked
|
|
40
|
+
# as arguments of uninterpreted create_clock command or similar
|
|
41
|
+
return [unknown "get_clocks" "-getter-validated" {*}$args]
|
|
42
|
+
}
|
yowasp_yosys/yosys.wasm
CHANGED
|
Binary file
|
{yowasp_yosys-0.59.0.0.post1038.dist-info → yowasp_yosys-0.60.0.0.post1055.dist-info}/RECORD
RENAMED
|
@@ -2,12 +2,11 @@ yowasp_yosys/__init__.py,sha256=cxu6bMlZ6zRpCzKp2wdFs7LNt5-btnJD6ghvdkDs6Y0,1189
|
|
|
2
2
|
yowasp_yosys/sby.py,sha256=BZwSqLk064cKvGITogDi3OqlQtRJJ-8J4_KG5Z7ktoc,19736
|
|
3
3
|
yowasp_yosys/smtbmc.py,sha256=kFTdW-sYuRU0f4YxRJuwYNIB1b9AFJeXM1sIIBdPJW0,74358
|
|
4
4
|
yowasp_yosys/witness.py,sha256=m3iV2Nydm0p4G79VRaaX3lGul-nGnuxeKnx20MCJgi0,17279
|
|
5
|
-
yowasp_yosys/yosys.wasm,sha256=
|
|
5
|
+
yowasp_yosys/yosys.wasm,sha256=8x-WIGlfuAP07MDDJRSAmMWVFIbJ_yG__bZC8CKulbA,38249085
|
|
6
6
|
yowasp_yosys/share/abc9_map.v,sha256=uWDqMpBQTeeadH1BlHVwkCy2StKF892xbgBgMKLK5-w,923
|
|
7
7
|
yowasp_yosys/share/abc9_model.v,sha256=IfMyEGOEUBdZyiVule0wMhrVYVYQpmSIcxygbgtHItI,653
|
|
8
8
|
yowasp_yosys/share/abc9_unmap.v,sha256=w107Y3iJjMU6D_6_aYLf2NziXTnAhpa5_CFAwaYO1iU,638
|
|
9
9
|
yowasp_yosys/share/adff2dff.v,sha256=vrBTKA3JWb574eiFkrK-XMaPDW6lxXdpHk_Rfup86vI,575
|
|
10
|
-
yowasp_yosys/share/cells.lib,sha256=ky_1Q27Tvqm2ksZuNABsZJAlBxjqrGdSbZQM2vGw7lE,2432
|
|
11
10
|
yowasp_yosys/share/cmp2lcu.v,sha256=3UE5bFljaievVjQnb4JiQmROBGbAbvkbMJ0zuVaz_fI,5260
|
|
12
11
|
yowasp_yosys/share/cmp2lut.v,sha256=DFxt94XQ-MMzz-3CoJvq4TD6XqtQU1tQdNWGvP9mdVk,2540
|
|
13
12
|
yowasp_yosys/share/cmp2softlogic.v,sha256=IjDw9-8Rt8dqzhpoFx2mHRX8E5KbFewJYSBIgTtaJWs,2716
|
|
@@ -119,10 +118,10 @@ yowasp_yosys/share/include/kernel/cellaigs.h,sha256=CdYos67IpmAgLvBbJ8EC3hWg6WhB
|
|
|
119
118
|
yowasp_yosys/share/include/kernel/celledges.h,sha256=fF_sHJOpN_qQ1P0x8KKoJE9ulDMusfjkF0dBpTMs19E,2216
|
|
120
119
|
yowasp_yosys/share/include/kernel/celltypes.h,sha256=wO-YpmQMvOzSk-sX06kmND3TfsODAbYeqPIfH13uX5A,19355
|
|
121
120
|
yowasp_yosys/share/include/kernel/consteval.h,sha256=lPo6CAW42gdhVLBTd-nBiIp25UrWIzR0f2R0JQo3Dzk,11038
|
|
122
|
-
yowasp_yosys/share/include/kernel/constids.inc,sha256=
|
|
121
|
+
yowasp_yosys/share/include/kernel/constids.inc,sha256=AaGaUMW3jnbdKfG3RvgrXkQ0aM7M3Y3Wh6FzuzpWwLo,12927
|
|
123
122
|
yowasp_yosys/share/include/kernel/cost.h,sha256=TRW3KGPVLv5MxAmNbSh1mnzwTc-QHvZXSh9Wfc6mw3U,2921
|
|
124
123
|
yowasp_yosys/share/include/kernel/drivertools.h,sha256=jHPImO2CxM9Y7XzEIyDj8Z8agW8IUfQ41veC2g2OosM,33555
|
|
125
|
-
yowasp_yosys/share/include/kernel/ff.h,sha256=
|
|
124
|
+
yowasp_yosys/share/include/kernel/ff.h,sha256=DZTapOpnAa6ykHC3NBP6JxwSDnv0ICMrWYwYSQQSrcM,7805
|
|
126
125
|
yowasp_yosys/share/include/kernel/ffinit.h,sha256=3O8XfLnskgmxpMUn9te-HI9XAa_BabBHs0l8ORBIxEo,3532
|
|
127
126
|
yowasp_yosys/share/include/kernel/ffmerge.h,sha256=xl1_h88ZmLIxpli7vpiiU35R_Y4cZq728-A72abuzMg,6309
|
|
128
127
|
yowasp_yosys/share/include/kernel/fmt.h,sha256=0UT-aDVX7_KnzlaNyK3iMsSzoICa4Q0HhqsFIrwHBMw,2790
|
|
@@ -130,13 +129,13 @@ yowasp_yosys/share/include/kernel/gzip.h,sha256=wpAZ9hA13HEpWgZnth46JHvVLSA_qdS-
|
|
|
130
129
|
yowasp_yosys/share/include/kernel/hashlib.h,sha256=fPOd7Sy-ZAjWOOl2JNEg-f2BB2dobns9OENzZUhefGI,39598
|
|
131
130
|
yowasp_yosys/share/include/kernel/io.h,sha256=7f9YHpRlplk9cskEYF4ZN7BahXq831McRkuHZ4-PeV4,15791
|
|
132
131
|
yowasp_yosys/share/include/kernel/json.h,sha256=i2wmIMZ2SCE5zc6IIIVLx4XZ2-HQiZEFJ0ao_cMInK0,2849
|
|
133
|
-
yowasp_yosys/share/include/kernel/log.h,sha256=
|
|
132
|
+
yowasp_yosys/share/include/kernel/log.h,sha256=pB-dTx-quNH64wgF9pFKWRDSrqg8M2CwsbDzE27WFbI,17020
|
|
134
133
|
yowasp_yosys/share/include/kernel/macc.h,sha256=pBdSo9tnjpOC77UUqFDzgQMzZCjixdhmOrLnSi9QUeI,8918
|
|
135
134
|
yowasp_yosys/share/include/kernel/mem.h,sha256=2mCPY8QygVoDI1NC-cG0a0xaMwSihpcjfaGEyEDN7vs,15498
|
|
136
135
|
yowasp_yosys/share/include/kernel/modtools.h,sha256=mRnzc5TIsdIbHlFSTk2Yc0y85ttknhK-dAlti3neSI8,14388
|
|
137
136
|
yowasp_yosys/share/include/kernel/qcsat.h,sha256=ibhpJRu0youjDXPllXrDJi851VpwW1kbJ_y94_X6JhU,2804
|
|
138
|
-
yowasp_yosys/share/include/kernel/register.h,sha256=
|
|
139
|
-
yowasp_yosys/share/include/kernel/rtlil.h,sha256=
|
|
137
|
+
yowasp_yosys/share/include/kernel/register.h,sha256=RY6IBb9hTKx9dY11He7eiCBmOEiyGenoD3qof6dJH_I,7987
|
|
138
|
+
yowasp_yosys/share/include/kernel/rtlil.h,sha256=09Q1hJEkq_XD-_1K750JOymES_7B_idU2ZHftFcH27c,116926
|
|
140
139
|
yowasp_yosys/share/include/kernel/satgen.h,sha256=KcGW7ofH4_oTw0TtT22-azGaOOc_2yCTsz6N1-AeDiY,10535
|
|
141
140
|
yowasp_yosys/share/include/kernel/scopeinfo.h,sha256=EAU3vSTIwH1RrbSC7HVoTWh4SLfHMSIoidQPvT1Mo7g,11797
|
|
142
141
|
yowasp_yosys/share/include/kernel/sexpr.h,sha256=CUDKFehVoGmakYBYLpEKUtlM0Dd3oI6TNW_cKz-qe0g,4720
|
|
@@ -145,7 +144,7 @@ yowasp_yosys/share/include/kernel/threading.h,sha256=OidU8rY1QCeTdMR6DD_heUg8BUO
|
|
|
145
144
|
yowasp_yosys/share/include/kernel/timinginfo.h,sha256=JNRktUWp7ow_wn4P5BxlOkv7hNS7qKbws7Gjs6VSUx8,7367
|
|
146
145
|
yowasp_yosys/share/include/kernel/utils.h,sha256=6WTFqPm117PbGUDjQVhFlzSnkuE8N2LfO2RXungS1xo,7925
|
|
147
146
|
yowasp_yosys/share/include/kernel/yosys.h,sha256=g-tNpYJFkJtChmou9eVZxM7BFplJWra7WZ_y7hdRR_o,3454
|
|
148
|
-
yowasp_yosys/share/include/kernel/yosys_common.h,sha256=
|
|
147
|
+
yowasp_yosys/share/include/kernel/yosys_common.h,sha256=fPQxbE7bjqcUl5nmHx7DH9uGbtBWe_vjOpQOOeNTJgw,8642
|
|
149
148
|
yowasp_yosys/share/include/kernel/yw.h,sha256=Gr5zqBNUSKXOKhdw7tl9-KcCiZg3xFcK9Msj7LMawdI,5470
|
|
150
149
|
yowasp_yosys/share/include/libs/ezsat/ezminisat.h,sha256=bSrDL6VRinpXdULoR8P9lQaT1Dy4kAEZfTcKjRKOdjg,2098
|
|
151
150
|
yowasp_yosys/share/include/libs/ezsat/ezsat.h,sha256=eggeGwS9pFyxSYGT0RtOqX189pbXFAKDfPZzIYTmqIk,14523
|
|
@@ -297,6 +296,7 @@ yowasp_yosys/share/quicklogic/qlf_k6n10f/libmap_brams.txt,sha256=GKOIH1ZWb7jFLY0
|
|
|
297
296
|
yowasp_yosys/share/quicklogic/qlf_k6n10f/libmap_brams_map.v,sha256=GgDi62vFlesuCXuhs5K6EY9bH7FGGCo59uMecNYbwKI,14121
|
|
298
297
|
yowasp_yosys/share/quicklogic/qlf_k6n10f/sram1024x18_mem.v,sha256=tVO79TafQHC_V5vSii0soeaLTMoUrRCwDP3OCNFQThI,1128
|
|
299
298
|
yowasp_yosys/share/quicklogic/qlf_k6n10f/ufifo_ctl.v,sha256=R2SalyyHfGSXyB6zhM88kjSiHht16s2HJMSZjoG5XKs,19068
|
|
299
|
+
yowasp_yosys/share/sdc/graph-stubs.sdc,sha256=jcIgfT_DQtwgaYIgkVLRuBmTNJJu9pCxBITihHADeBw,1398
|
|
300
300
|
yowasp_yosys/share/sf2/arith_map.v,sha256=8W5rnBPURSqALF2FpoMCTDfLnSFBo1te1-cigwdAtFI,1942
|
|
301
301
|
yowasp_yosys/share/sf2/cells_map.v,sha256=er3vY75llifpyKNvJ7lZav__l5CboAGp9O8iVxOgpoU,1745
|
|
302
302
|
yowasp_yosys/share/sf2/cells_sim.v,sha256=JEtn2ssacmkF1j-LO2w_JNxyUToCmDz0IlZUFYaue3U,8449
|
|
@@ -334,8 +334,8 @@ yowasp_yosys/share/xilinx/xc5v_dsp_map.v,sha256=I4lg0RQ54fBBba_7NNvUgwS4tQ1yLIsU
|
|
|
334
334
|
yowasp_yosys/share/xilinx/xc6s_dsp_map.v,sha256=gTxHocB-Dn5G4BplWgri_tLhT6DIO2S0X-yu4iBKYyk,562
|
|
335
335
|
yowasp_yosys/share/xilinx/xc7_dsp_map.v,sha256=zrzreQi7mElrAMtrayxtiO_Bw00S6zsjSjSVcjmJPH0,884
|
|
336
336
|
yowasp_yosys/share/xilinx/xcu_dsp_map.v,sha256=gzCgl1emrHGcigVmU0nP0pW7dlhQ01SaWwXzHHcqt-o,882
|
|
337
|
-
yowasp_yosys-0.
|
|
338
|
-
yowasp_yosys-0.
|
|
339
|
-
yowasp_yosys-0.
|
|
340
|
-
yowasp_yosys-0.
|
|
341
|
-
yowasp_yosys-0.
|
|
337
|
+
yowasp_yosys-0.60.0.0.post1055.dist-info/METADATA,sha256=gGpDRSrohNQfGxdjcwyc84sHRv4vpGVbHNjAT81D41g,2523
|
|
338
|
+
yowasp_yosys-0.60.0.0.post1055.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
|
|
339
|
+
yowasp_yosys-0.60.0.0.post1055.dist-info/entry_points.txt,sha256=p_9sIVi2ZqsqgYYo14PywYkwHYTa76fMEq3LxweXJpc,220
|
|
340
|
+
yowasp_yosys-0.60.0.0.post1055.dist-info/top_level.txt,sha256=_yiNT8kLYkcD1TEuUCzQ_MkON1c3xuIRV59zXds4zd4,13
|
|
341
|
+
yowasp_yosys-0.60.0.0.post1055.dist-info/RECORD,,
|
yowasp_yosys/share/cells.lib
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
library(yosys_cells) {
|
|
2
|
-
cell(DFF_N) {
|
|
3
|
-
ff(IQ, IQN) {
|
|
4
|
-
clocked_on: "!C";
|
|
5
|
-
next_state: "D";
|
|
6
|
-
}
|
|
7
|
-
pin(D) { direction: input; }
|
|
8
|
-
pin(C) { direction: input; clock: true; }
|
|
9
|
-
pin(Q) { direction: output; function: "IQ"; }
|
|
10
|
-
}
|
|
11
|
-
cell(DFF_P) {
|
|
12
|
-
ff(IQ, IQN) {
|
|
13
|
-
clocked_on: "C";
|
|
14
|
-
next_state: "D";
|
|
15
|
-
}
|
|
16
|
-
pin(D) { direction: input; }
|
|
17
|
-
pin(C) { direction: input; clock: true; }
|
|
18
|
-
pin(Q) { direction: output; function: "IQ"; }
|
|
19
|
-
}
|
|
20
|
-
cell(DFF_NN0) {
|
|
21
|
-
ff(IQ, IQN) {
|
|
22
|
-
clocked_on: "!C";
|
|
23
|
-
next_state: "D";
|
|
24
|
-
clear: "!R";
|
|
25
|
-
}
|
|
26
|
-
pin(D) { direction: input; }
|
|
27
|
-
pin(R) { direction: input; }
|
|
28
|
-
pin(C) { direction: input; clock: true; }
|
|
29
|
-
pin(Q) { direction: output; function: "IQ"; }
|
|
30
|
-
}
|
|
31
|
-
cell(DFF_NN1) {
|
|
32
|
-
ff(IQ, IQN) {
|
|
33
|
-
clocked_on: "!C";
|
|
34
|
-
next_state: "D";
|
|
35
|
-
preset: "!R";
|
|
36
|
-
}
|
|
37
|
-
pin(D) { direction: input; }
|
|
38
|
-
pin(R) { direction: input; }
|
|
39
|
-
pin(C) { direction: input; clock: true; }
|
|
40
|
-
pin(Q) { direction: output; function: "IQ"; }
|
|
41
|
-
}
|
|
42
|
-
cell(DFF_NP0) {
|
|
43
|
-
ff(IQ, IQN) {
|
|
44
|
-
clocked_on: "!C";
|
|
45
|
-
next_state: "D";
|
|
46
|
-
clear: "R";
|
|
47
|
-
}
|
|
48
|
-
pin(D) { direction: input; }
|
|
49
|
-
pin(R) { direction: input; }
|
|
50
|
-
pin(C) { direction: input; clock: true; }
|
|
51
|
-
pin(Q) { direction: output; function: "IQ"; }
|
|
52
|
-
}
|
|
53
|
-
cell(DFF_NP1) {
|
|
54
|
-
ff(IQ, IQN) {
|
|
55
|
-
clocked_on: "!C";
|
|
56
|
-
next_state: "D";
|
|
57
|
-
preset: "R";
|
|
58
|
-
}
|
|
59
|
-
pin(D) { direction: input; }
|
|
60
|
-
pin(R) { direction: input; }
|
|
61
|
-
pin(C) { direction: input; clock: true; }
|
|
62
|
-
pin(Q) { direction: output; function: "IQ"; }
|
|
63
|
-
}
|
|
64
|
-
cell(DFF_PN0) {
|
|
65
|
-
ff(IQ, IQN) {
|
|
66
|
-
clocked_on: "C";
|
|
67
|
-
next_state: "D";
|
|
68
|
-
clear: "!R";
|
|
69
|
-
}
|
|
70
|
-
pin(D) { direction: input; }
|
|
71
|
-
pin(R) { direction: input; }
|
|
72
|
-
pin(C) { direction: input; clock: true; }
|
|
73
|
-
pin(Q) { direction: output; function: "IQ"; }
|
|
74
|
-
}
|
|
75
|
-
cell(DFF_PN1) {
|
|
76
|
-
ff(IQ, IQN) {
|
|
77
|
-
clocked_on: "C";
|
|
78
|
-
next_state: "D";
|
|
79
|
-
preset: "!R";
|
|
80
|
-
}
|
|
81
|
-
pin(D) { direction: input; }
|
|
82
|
-
pin(R) { direction: input; }
|
|
83
|
-
pin(C) { direction: input; clock: true; }
|
|
84
|
-
pin(Q) { direction: output; function: "IQ"; }
|
|
85
|
-
}
|
|
86
|
-
cell(DFF_PP0) {
|
|
87
|
-
ff(IQ, IQN) {
|
|
88
|
-
clocked_on: "C";
|
|
89
|
-
next_state: "D";
|
|
90
|
-
clear: "R";
|
|
91
|
-
}
|
|
92
|
-
pin(D) { direction: input; }
|
|
93
|
-
pin(R) { direction: input; }
|
|
94
|
-
pin(C) { direction: input; clock: true; }
|
|
95
|
-
pin(Q) { direction: output; function: "IQ"; }
|
|
96
|
-
}
|
|
97
|
-
cell(DFF_PP1) {
|
|
98
|
-
ff(IQ, IQN) {
|
|
99
|
-
clocked_on: "C";
|
|
100
|
-
next_state: "D";
|
|
101
|
-
preset: "R";
|
|
102
|
-
}
|
|
103
|
-
pin(D) { direction: input; }
|
|
104
|
-
pin(R) { direction: input; }
|
|
105
|
-
pin(C) { direction: input; clock: true; }
|
|
106
|
-
pin(Q) { direction: output; function: "IQ"; }
|
|
107
|
-
}
|
|
108
|
-
}
|
|
File without changes
|
|
File without changes
|
{yowasp_yosys-0.59.0.0.post1038.dist-info → yowasp_yosys-0.60.0.0.post1055.dist-info}/top_level.txt
RENAMED
|
File without changes
|