yowasp-yosys 0.56.0.0.post964__py3-none-any.whl → 0.57.0.0.post986__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.
@@ -28,6 +28,7 @@
28
28
 
29
29
  #include "kernel/rtlil.h"
30
30
  #include "kernel/fmt.h"
31
+ #include "frontends/verilog/verilog_location.h"
31
32
  #include <stdint.h>
32
33
  #include <set>
33
34
 
@@ -153,6 +154,7 @@ namespace AST
153
154
  AST_MODPORT,
154
155
  AST_MODPORTMEMBER,
155
156
  AST_PACKAGE,
157
+ AST_IMPORT,
156
158
 
157
159
  AST_WIRETYPE,
158
160
  AST_TYPEDEF,
@@ -162,12 +164,7 @@ namespace AST
162
164
  AST_BIND
163
165
  };
164
166
 
165
- struct AstSrcLocType {
166
- unsigned int first_line, last_line;
167
- unsigned int first_column, last_column;
168
- AstSrcLocType() : first_line(0), last_line(0), first_column(0), last_column(0) {}
169
- AstSrcLocType(int _first_line, int _first_column, int _last_line, int _last_column) : first_line(_first_line), last_line(_last_line), first_column(_first_column), last_column(_last_column) {}
170
- };
167
+ using AstSrcLocType = Location;
171
168
 
172
169
  // convert an node type to a string (e.g. for debug output)
173
170
  std::string type2str(AstNodeType type);
@@ -183,10 +180,10 @@ namespace AST
183
180
  AstNodeType type;
184
181
 
185
182
  // the list of child nodes for this node
186
- std::vector<AstNode*> children;
183
+ std::vector<std::unique_ptr<AstNode>> children;
187
184
 
188
185
  // the list of attributes assigned to this node
189
- std::map<RTLIL::IdString, AstNode*> attributes;
186
+ std::map<RTLIL::IdString, std::unique_ptr<AstNode>> attributes;
190
187
  bool get_bool_attribute(RTLIL::IdString id);
191
188
 
192
189
  // node content - most of it is unused in most node types
@@ -212,7 +209,7 @@ namespace AST
212
209
  int unpacked_dimensions;
213
210
 
214
211
  // this is set by simplify and used during RTLIL generation
215
- AstNode *id2ast;
212
+ AstNode* id2ast;
216
213
 
217
214
  // this is used by simplify to detect if basic analysis has been performed already on the node
218
215
  bool basic_prep;
@@ -223,7 +220,6 @@ namespace AST
223
220
  // this is the original sourcecode location that resulted in this AST node
224
221
  // it is automatically set by the constructor using AST::current_filename and
225
222
  // the AST::get_line_num() callback function.
226
- std::string filename;
227
223
  AstSrcLocType location;
228
224
 
229
225
  // are we embedded in an lvalue, param?
@@ -234,9 +230,9 @@ namespace AST
234
230
  bool in_param_from_above;
235
231
 
236
232
  // creating and deleting nodes
237
- AstNode(AstNodeType type = AST_NONE, AstNode *child1 = nullptr, AstNode *child2 = nullptr, AstNode *child3 = nullptr, AstNode *child4 = nullptr);
238
- AstNode *clone() const;
239
- void cloneInto(AstNode *other) const;
233
+ AstNode(AstSrcLocType loc, AstNodeType type = AST_NONE, std::unique_ptr<AstNode> child1 = nullptr, std::unique_ptr<AstNode> child2 = nullptr, std::unique_ptr<AstNode> child3 = nullptr, std::unique_ptr<AstNode> child4 = nullptr);
234
+ std::unique_ptr<AstNode> clone() const;
235
+ void cloneInto(AstNode &other) const;
240
236
  void delete_children();
241
237
  ~AstNode();
242
238
 
@@ -265,14 +261,14 @@ namespace AST
265
261
  // it also sets the id2ast pointers so that identifier lookups are fast in genRTLIL()
266
262
  bool simplify(bool const_fold, int stage, int width_hint, bool sign_hint);
267
263
  void replace_result_wire_name_in_function(const std::string &from, const std::string &to);
268
- AstNode *readmem(bool is_readmemh, std::string mem_filename, AstNode *memory, int start_addr, int finish_addr, bool unconditional_init);
264
+ std::unique_ptr<AstNode> readmem(bool is_readmemh, std::string mem_filename, AstNode *memory, int start_addr, int finish_addr, bool unconditional_init);
269
265
  void expand_genblock(const std::string &prefix);
270
266
  void label_genblks(std::set<std::string>& existing, int &counter);
271
267
  void mem2reg_as_needed_pass1(dict<AstNode*, pool<std::string>> &mem2reg_places,
272
268
  dict<AstNode*, uint32_t> &mem2reg_flags, dict<AstNode*, uint32_t> &proc_flags, uint32_t &status_flags);
273
- bool mem2reg_as_needed_pass2(pool<AstNode*> &mem2reg_set, AstNode *mod, AstNode *block, AstNode *&async_block);
269
+ bool mem2reg_as_needed_pass2(pool<AstNode*> &mem2reg_set, AstNode *mod, AstNode *block, AstNode* async_block);
274
270
  bool mem2reg_check(pool<AstNode*> &mem2reg_set);
275
- void mem2reg_remove(pool<AstNode*> &mem2reg_set, vector<AstNode*> &delnodes);
271
+ void mem2reg_remove(pool<AstNode*> &mem2reg_set);
276
272
  void meminfo(int &mem_width, int &mem_size, int &addr_bits);
277
273
  bool detect_latch(const std::string &var);
278
274
  const RTLIL::Module* lookup_cell_module();
@@ -288,7 +284,7 @@ namespace AST
288
284
  };
289
285
  bool has_const_only_constructs();
290
286
  bool replace_variables(std::map<std::string, varinfo_t> &variables, AstNode *fcall, bool must_succeed);
291
- AstNode *eval_const_function(AstNode *fcall, bool must_succeed);
287
+ std::unique_ptr<AstNode> eval_const_function(AstNode *fcall, bool must_succeed);
292
288
  bool is_simple_const_expr();
293
289
 
294
290
  // helper for parsing format strings
@@ -305,29 +301,30 @@ namespace AST
305
301
  std::vector<RTLIL::Binding *> genBindings() const;
306
302
 
307
303
  // used by genRTLIL() for detecting expression width and sign
308
- void detectSignWidthWorker(int &width_hint, bool &sign_hint, bool *found_real = NULL);
309
- void detectSignWidth(int &width_hint, bool &sign_hint, bool *found_real = NULL);
304
+ void detectSignWidthWorker(int &width_hint, bool &sign_hint, bool *found_real = nullptr);
305
+ void detectSignWidth(int &width_hint, bool &sign_hint, bool *found_real = nullptr);
310
306
 
311
307
  // create RTLIL code for this AST node
312
308
  // for expressions the resulting signal vector is returned
313
309
  // all generated cell instances, etc. are written to the RTLIL::Module pointed to by AST_INTERNAL::current_module
314
310
  RTLIL::SigSpec genRTLIL(int width_hint = -1, bool sign_hint = false);
315
- RTLIL::SigSpec genWidthRTLIL(int width, bool sgn, const dict<RTLIL::SigBit, RTLIL::SigBit> *new_subst_ptr = NULL);
311
+ RTLIL::SigSpec genWidthRTLIL(int width, bool sgn, const dict<RTLIL::SigBit, RTLIL::SigBit> *new_subst_ptr = nullptr);
316
312
 
317
313
  // compare AST nodes
318
314
  bool operator==(const AstNode &other) const;
319
315
  bool operator!=(const AstNode &other) const;
320
316
  bool contains(const AstNode *other) const;
317
+ AstNode operator=(AstNode) = delete;
321
318
 
322
319
  // helper functions for creating AST nodes for constants
323
- static AstNode *mkconst_int(uint32_t v, bool is_signed, int width = 32);
324
- static AstNode *mkconst_bits(const std::vector<RTLIL::State> &v, bool is_signed, bool is_unsized);
325
- static AstNode *mkconst_bits(const std::vector<RTLIL::State> &v, bool is_signed);
326
- static AstNode *mkconst_str(const std::vector<RTLIL::State> &v);
327
- static AstNode *mkconst_str(const std::string &str);
320
+ static std::unique_ptr<AstNode> mkconst_int(AstSrcLocType loc, uint32_t v, bool is_signed, int width = 32);
321
+ static std::unique_ptr<AstNode> mkconst_bits(AstSrcLocType loc, const std::vector<RTLIL::State> &v, bool is_signed, bool is_unsized);
322
+ static std::unique_ptr<AstNode> mkconst_bits(AstSrcLocType loc, const std::vector<RTLIL::State> &v, bool is_signed);
323
+ static std::unique_ptr<AstNode> mkconst_str(AstSrcLocType loc, const std::vector<RTLIL::State> &v);
324
+ static std::unique_ptr<AstNode> mkconst_str(AstSrcLocType loc, const std::string &str);
328
325
 
329
326
  // helper function to create an AST node for a temporary register
330
- AstNode *mktemp_logic(const std::string &name, AstNode *mod, bool nosync, int range_left, int range_right, bool is_signed);
327
+ std::unique_ptr<AstNode> mktemp_logic(AstSrcLocType loc, const std::string &name, AstNode *mod, bool nosync, int range_left, int range_right, bool is_signed);
331
328
 
332
329
  // helper function for creating sign-extended const objects
333
330
  RTLIL::Const bitsAsConst(int width, bool is_signed);
@@ -356,12 +353,12 @@ namespace AST
356
353
 
357
354
  // helper to clone the node with some of its subexpressions replaced with zero (this is used
358
355
  // to evaluate widths of dynamic ranges)
359
- AstNode *clone_at_zero();
356
+ std::unique_ptr<AstNode> clone_at_zero();
360
357
 
361
- void set_attribute(RTLIL::IdString key, AstNode *node)
358
+ void set_attribute(RTLIL::IdString key, std::unique_ptr<AstNode> node)
362
359
  {
363
- attributes[key] = node;
364
360
  node->set_in_param_flag(true);
361
+ attributes[key] = std::move(node);
365
362
  }
366
363
 
367
364
  // helper to set in_lvalue/in_param flags from the hierarchy context (the actual flag
@@ -377,7 +374,7 @@ namespace AST
377
374
  void fixup_hierarchy_flags(bool force_descend = false);
378
375
 
379
376
  // helpers for indexing
380
- AstNode *make_index_range(AstNode *node, bool unpacked_range = false);
377
+ std::unique_ptr<AstNode> make_index_range(AstNode *node, bool unpacked_range = false);
381
378
  AstNode *get_struct_member() const;
382
379
 
383
380
  // helper to print errors from simplify/genrtlil code
@@ -391,12 +388,11 @@ namespace AST
391
388
  // parametric modules are supported directly by the AST library
392
389
  // therefore we need our own derivate of RTLIL::Module with overloaded virtual functions
393
390
  struct AstModule : RTLIL::Module {
394
- AstNode *ast;
391
+ std::unique_ptr<AstNode> ast;
395
392
  bool nolatches, nomeminit, nomem2reg, mem2reg, noblackbox, lib, nowb, noopt, icells, pwires, autowire;
396
- ~AstModule() override;
397
393
  RTLIL::IdString derive(RTLIL::Design *design, const dict<RTLIL::IdString, RTLIL::Const> &parameters, bool mayfail) override;
398
394
  RTLIL::IdString derive(RTLIL::Design *design, const dict<RTLIL::IdString, RTLIL::Const> &parameters, const dict<RTLIL::IdString, RTLIL::Module*> &interfaces, const dict<RTLIL::IdString, RTLIL::IdString> &modports, bool mayfail) override;
399
- std::string derive_common(RTLIL::Design *design, const dict<RTLIL::IdString, RTLIL::Const> &parameters, AstNode **new_ast_out, bool quiet = false);
395
+ std::string derive_common(RTLIL::Design *design, const dict<RTLIL::IdString, RTLIL::Const> &parameters, std::unique_ptr<AstNode>* new_ast_out, bool quiet = false);
400
396
  void expand_interfaces(RTLIL::Design *design, const dict<RTLIL::IdString, RTLIL::Module *> &local_interfaces) override;
401
397
  bool reprocess_if_necessary(RTLIL::Design *design) override;
402
398
  RTLIL::Module *clone() const override;
@@ -406,9 +402,9 @@ namespace AST
406
402
  // this must be set by the language frontend before parsing the sources
407
403
  // the AstNode constructor then uses current_filename and get_line_num()
408
404
  // to initialize the filename and linenum properties of new nodes
409
- extern std::string current_filename;
410
- extern void (*set_line_num)(int);
411
- extern int (*get_line_num)();
405
+ // extern std::string current_filename;
406
+ // also set by the language frontend to control some AST processing
407
+ extern bool sv_mode_but_global_and_used_for_literally_one_condition;
412
408
 
413
409
  // for stats
414
410
  unsigned long long astnode_count();
@@ -418,7 +414,7 @@ namespace AST
418
414
  void use_internal_line_num();
419
415
 
420
416
  // call a DPI function
421
- AstNode *dpi_call(const std::string &rtype, const std::string &fname, const std::vector<std::string> &argtypes, const std::vector<AstNode*> &args);
417
+ std::unique_ptr<AstNode> dpi_call(AstSrcLocType loc, const std::string &rtype, const std::string &fname, const std::vector<std::string> &argtypes, const std::vector<std::unique_ptr<AstNode>> &args);
422
418
 
423
419
  // Helper functions related to handling SystemVerilog interfaces
424
420
  std::pair<std::string,std::string> split_modport_from_type(std::string name_type);
@@ -464,7 +460,7 @@ namespace AST_INTERNAL
464
460
  process_and_replace_module(RTLIL::Design *design,
465
461
  RTLIL::Module *old_module,
466
462
  AST::AstNode *new_ast,
467
- AST::AstNode *original_ast = nullptr);
463
+ std::unique_ptr<AST::AstNode> original_ast = nullptr);
468
464
  }
469
465
 
470
466
  YOSYS_NAMESPACE_END
@@ -25,6 +25,18 @@
25
25
 
26
26
  YOSYS_NAMESPACE_BEGIN
27
27
 
28
+ /**
29
+ * This file implements BitPatternPool for efficiently storing and querying
30
+ * sets of fixed-width 2-valued logic constants compressed as "bit patterns".
31
+ * A bit pattern can have don't cares on one or more bit positions (State::Sa).
32
+ *
33
+ * In terms of logic synthesis:
34
+ * A BitPatternPool is a sum of products (SOP).
35
+ * BitPatternPool::bits_t is a cube.
36
+ *
37
+ * BitPatternPool does not permit adding new patterns, only removing.
38
+ * Its intended use case is in analysing cases in case/match constructs in HDL.
39
+ */
28
40
  struct BitPatternPool
29
41
  {
30
42
  int width;
@@ -67,6 +79,9 @@ struct BitPatternPool
67
79
  }
68
80
  }
69
81
 
82
+ /**
83
+ * Constructs a pool of all possible patterns (all don't-care bits)
84
+ */
70
85
  BitPatternPool(int width)
71
86
  {
72
87
  this->width = width;
@@ -78,6 +93,10 @@ struct BitPatternPool
78
93
  }
79
94
  }
80
95
 
96
+ /**
97
+ * Convert a constant SigSpec to a pattern. Normalize Yosys many-valued
98
+ * to three-valued logic.
99
+ */
81
100
  bits_t sig2bits(RTLIL::SigSpec sig)
82
101
  {
83
102
  bits_t bits;
@@ -88,6 +107,9 @@ struct BitPatternPool
88
107
  return bits;
89
108
  }
90
109
 
110
+ /**
111
+ * Two cubes match if their intersection is non-empty.
112
+ */
91
113
  bool match(bits_t a, bits_t b)
92
114
  {
93
115
  log_assert(int(a.bitdata.size()) == width);
@@ -98,6 +120,15 @@ struct BitPatternPool
98
120
  return true;
99
121
  }
100
122
 
123
+ /**
124
+ * Does cube sig overlap any cube in the pool?
125
+ * For example:
126
+ * pool({aaa}).has_any(01a) == true
127
+ * pool({01a}).has_any(01a) == true
128
+ * pool({011}).has_any(01a) == true
129
+ * pool({01a}).has_any(011) == true
130
+ * pool({111}).has_any(01a) == false
131
+ */
101
132
  bool has_any(RTLIL::SigSpec sig)
102
133
  {
103
134
  bits_t bits = sig2bits(sig);
@@ -107,6 +138,15 @@ struct BitPatternPool
107
138
  return false;
108
139
  }
109
140
 
141
+ /**
142
+ * Is cube sig covered by a cube in the pool?
143
+ * For example:
144
+ * pool({aaa}).has_all(01a) == true
145
+ * pool({01a}).has_any(01a) == true
146
+ * pool({01a}).has_any(011) == true
147
+ * pool({011}).has_all(01a) == false
148
+ * pool({111}).has_all(01a) == false
149
+ */
110
150
  bool has_all(RTLIL::SigSpec sig)
111
151
  {
112
152
  bits_t bits = sig2bits(sig);
@@ -121,6 +161,12 @@ struct BitPatternPool
121
161
  return false;
122
162
  }
123
163
 
164
+ /**
165
+ * Remove cube sig from the pool, splitting the remaining cubes. True if success.
166
+ * For example:
167
+ * Taking 011 out of pool({01a}) -> pool({010}), returns true.
168
+ * Taking 011 out of pool({010}) does nothing, returns false.
169
+ */
124
170
  bool take(RTLIL::SigSpec sig)
125
171
  {
126
172
  bool status = false;
@@ -143,6 +189,9 @@ struct BitPatternPool
143
189
  return status;
144
190
  }
145
191
 
192
+ /**
193
+ * Remove all patterns. Returns false if already empty.
194
+ */
146
195
  bool take_all()
147
196
  {
148
197
  if (database.empty())
@@ -334,6 +334,7 @@ struct CellTypes
334
334
  return v;
335
335
  }
336
336
 
337
+ // Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
337
338
  static RTLIL::Const eval(RTLIL::IdString type, const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len, bool *errp = nullptr)
338
339
  {
339
340
  if (type == ID($sshr) && !signed1)
@@ -416,6 +417,7 @@ struct CellTypes
416
417
  log_abort();
417
418
  }
418
419
 
420
+ // Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
419
421
  static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool *errp = nullptr)
420
422
  {
421
423
  if (cell->type == ID($slice)) {
@@ -503,10 +505,13 @@ struct CellTypes
503
505
  return eval(cell->type, arg1, arg2, signed_a, signed_b, result_len, errp);
504
506
  }
505
507
 
508
+ // Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
506
509
  static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, const RTLIL::Const &arg3, bool *errp = nullptr)
507
510
  {
508
511
  if (cell->type.in(ID($mux), ID($_MUX_)))
509
512
  return const_mux(arg1, arg2, arg3);
513
+ if (cell->type == ID($_NMUX_))
514
+ return eval_not(const_mux(arg1, arg2, arg3));
510
515
  if (cell->type == ID($bwmux))
511
516
  return const_bwmux(arg1, arg2, arg3);
512
517
  if (cell->type == ID($pmux))
@@ -520,6 +525,7 @@ struct CellTypes
520
525
  return eval(cell, arg1, arg2, errp);
521
526
  }
522
527
 
528
+ // Consider using the ConstEval struct instead if you need named ports and/or multiple outputs
523
529
  static RTLIL::Const eval(RTLIL::Cell *cell, const RTLIL::Const &arg1, const RTLIL::Const &arg2, const RTLIL::Const &arg3, const RTLIL::Const &arg4, bool *errp = nullptr)
524
530
  {
525
531
  if (cell->type == ID($_AOI4_))
@@ -349,7 +349,11 @@ struct ConstEval
349
349
  return false;
350
350
 
351
351
  bool eval_err = false;
352
- RTLIL::Const eval_ret = CellTypes::eval(cell, sig_a.as_const(), sig_b.as_const(), sig_c.as_const(), sig_d.as_const(), &eval_err);
352
+ RTLIL::Const eval_ret;
353
+ if (sig_s.size() > 0 && eval(sig_s, undef, cell)) {
354
+ eval_ret = CellTypes::eval(cell, sig_a.as_const(), sig_b.as_const(), sig_s.as_const(), &eval_err);
355
+ } else
356
+ eval_ret = CellTypes::eval(cell, sig_a.as_const(), sig_b.as_const(), sig_c.as_const(), sig_d.as_const(), &eval_err);
353
357
 
354
358
  if (eval_err)
355
359
  return false;
@@ -27,10 +27,10 @@ YOSYS_NAMESPACE_BEGIN
27
27
 
28
28
  struct FfInitVals
29
29
  {
30
- const SigMap *sigmap;
30
+ const SigMapView *sigmap;
31
31
  dict<SigBit, std::pair<State,SigBit>> initbits;
32
32
 
33
- void set(const SigMap *sigmap_, RTLIL::Module *module)
33
+ void set(const SigMapView *sigmap_, RTLIL::Module *module)
34
34
  {
35
35
  sigmap = sigmap_;
36
36
  initbits.clear();
@@ -126,7 +126,7 @@ struct FfInitVals
126
126
  initbits.clear();
127
127
  }
128
128
 
129
- FfInitVals (const SigMap *sigmap, RTLIL::Module *module)
129
+ FfInitVals (const SigMapView *sigmap, RTLIL::Module *module)
130
130
  {
131
131
  set(sigmap, module);
132
132
  }
@@ -58,7 +58,7 @@ YOSYS_NAMESPACE_BEGIN
58
58
 
59
59
  struct FfMergeHelper
60
60
  {
61
- const SigMap *sigmap;
61
+ const SigMapView *sigmap;
62
62
  RTLIL::Module *module;
63
63
  FfInitVals *initvals;
64
64
 
@@ -12,6 +12,7 @@
12
12
  #ifndef HASHLIB_H
13
13
  #define HASHLIB_H
14
14
 
15
+ #include <array>
15
16
  #include <stdexcept>
16
17
  #include <algorithm>
17
18
  #include <optional>
@@ -100,7 +101,7 @@ private:
100
101
  uint32_t hash = ((a << 5) + a) ^ b;
101
102
  return hash;
102
103
  }
103
- public:
104
+ public:
104
105
  void hash32(uint32_t i) {
105
106
  state = djb2_xor(i, state);
106
107
  state = mkhash_xorshift(fudge ^ state);
@@ -127,6 +128,7 @@ private:
127
128
  *this = hash_ops<T>::hash_into(t, *this);
128
129
  }
129
130
 
131
+ [[deprecated]]
130
132
  void commutative_eat(hash_t t) {
131
133
  state ^= t;
132
134
  }
@@ -177,58 +179,58 @@ struct hash_ops {
177
179
  };
178
180
 
179
181
  template<typename P, typename Q> struct hash_ops<std::pair<P, Q>> {
180
- static inline bool cmp(std::pair<P, Q> a, std::pair<P, Q> b) {
182
+ static inline bool cmp(const std::pair<P, Q> &a, const std::pair<P, Q> &b) {
181
183
  return a == b;
182
184
  }
183
- [[nodiscard]] static inline Hasher hash_into(std::pair<P, Q> a, Hasher h) {
185
+ [[nodiscard]] static inline Hasher hash_into(const std::pair<P, Q> &a, Hasher h) {
184
186
  h = hash_ops<P>::hash_into(a.first, h);
185
187
  h = hash_ops<Q>::hash_into(a.second, h);
186
188
  return h;
187
189
  }
188
- HASH_TOP_LOOP_FST (std::pair<P, Q> a) HASH_TOP_LOOP_SND
190
+ HASH_TOP_LOOP_FST (const std::pair<P, Q> &a) HASH_TOP_LOOP_SND
189
191
  };
190
192
 
191
193
  template<typename... T> struct hash_ops<std::tuple<T...>> {
192
- static inline bool cmp(std::tuple<T...> a, std::tuple<T...> b) {
194
+ static inline bool cmp(const std::tuple<T...> &a, const std::tuple<T...> &b) {
193
195
  return a == b;
194
196
  }
195
197
  template<size_t I = 0>
196
- static inline typename std::enable_if<I == sizeof...(T), Hasher>::type hash_into(std::tuple<T...>, Hasher h) {
198
+ static inline typename std::enable_if<I == sizeof...(T), Hasher>::type hash_into(const std::tuple<T...> &, Hasher h) {
197
199
  return h;
198
200
  }
199
201
  template<size_t I = 0>
200
- static inline typename std::enable_if<I != sizeof...(T), Hasher>::type hash_into(std::tuple<T...> a, Hasher h) {
202
+ static inline typename std::enable_if<I != sizeof...(T), Hasher>::type hash_into(const std::tuple<T...> &a, Hasher h) {
201
203
  typedef hash_ops<typename std::tuple_element<I, std::tuple<T...>>::type> element_ops_t;
202
204
  h = hash_into<I+1>(a, h);
203
205
  h = element_ops_t::hash_into(std::get<I>(a), h);
204
206
  return h;
205
207
  }
206
- HASH_TOP_LOOP_FST (std::tuple<T...> a) HASH_TOP_LOOP_SND
208
+ HASH_TOP_LOOP_FST (const std::tuple<T...> &a) HASH_TOP_LOOP_SND
207
209
  };
208
210
 
209
211
  template<typename T> struct hash_ops<std::vector<T>> {
210
- static inline bool cmp(std::vector<T> a, std::vector<T> b) {
212
+ static inline bool cmp(const std::vector<T> &a, const std::vector<T> &b) {
211
213
  return a == b;
212
214
  }
213
- [[nodiscard]] static inline Hasher hash_into(std::vector<T> a, Hasher h) {
215
+ [[nodiscard]] static inline Hasher hash_into(const std::vector<T> &a, Hasher h) {
214
216
  h.eat((uint32_t)a.size());
215
217
  for (auto k : a)
216
218
  h.eat(k);
217
219
  return h;
218
220
  }
219
- HASH_TOP_LOOP_FST (std::vector<T> a) HASH_TOP_LOOP_SND
221
+ HASH_TOP_LOOP_FST (const std::vector<T> &a) HASH_TOP_LOOP_SND
220
222
  };
221
223
 
222
224
  template<typename T, size_t N> struct hash_ops<std::array<T, N>> {
223
- static inline bool cmp(std::array<T, N> a, std::array<T, N> b) {
225
+ static inline bool cmp(const std::array<T, N> &a, const std::array<T, N> &b) {
224
226
  return a == b;
225
227
  }
226
- [[nodiscard]] static inline Hasher hash_into(std::array<T, N> a, Hasher h) {
228
+ [[nodiscard]] static inline Hasher hash_into(const std::array<T, N> &a, Hasher h) {
227
229
  for (const auto& k : a)
228
230
  h = hash_ops<T>::hash_into(k, h);
229
231
  return h;
230
232
  }
231
- HASH_TOP_LOOP_FST (std::array<T, N> a) HASH_TOP_LOOP_SND
233
+ HASH_TOP_LOOP_FST (const std::array<T, N> &a) HASH_TOP_LOOP_SND
232
234
  };
233
235
 
234
236
  struct hash_cstr_ops {
@@ -300,10 +302,10 @@ template<> struct hash_ops<std::monostate> {
300
302
  };
301
303
 
302
304
  template<typename... T> struct hash_ops<std::variant<T...>> {
303
- static inline bool cmp(std::variant<T...> a, std::variant<T...> b) {
305
+ static inline bool cmp(const std::variant<T...> &a, const std::variant<T...> &b) {
304
306
  return a == b;
305
307
  }
306
- [[nodiscard]] static inline Hasher hash_into(std::variant<T...> a, Hasher h) {
308
+ [[nodiscard]] static inline Hasher hash_into(const std::variant<T...> &a, Hasher h) {
307
309
  std::visit([& h](const auto &v) { h.eat(v); }, a);
308
310
  h.eat(a.index());
309
311
  return h;
@@ -311,10 +313,10 @@ template<typename... T> struct hash_ops<std::variant<T...>> {
311
313
  };
312
314
 
313
315
  template<typename T> struct hash_ops<std::optional<T>> {
314
- static inline bool cmp(std::optional<T> a, std::optional<T> b) {
316
+ static inline bool cmp(const std::optional<T> &a, const std::optional<T> &b) {
315
317
  return a == b;
316
318
  }
317
- [[nodiscard]] static inline Hasher hash_into(std::optional<T> a, Hasher h) {
319
+ [[nodiscard]] static inline Hasher hash_into(const std::optional<T> &a, Hasher h) {
318
320
  if(a.has_value())
319
321
  h.eat(*a);
320
322
  else
@@ -356,6 +358,29 @@ template<typename K, int offset = 0, typename OPS = hash_ops<K>> class idict;
356
358
  template<typename K, typename OPS = hash_ops<K>> class pool;
357
359
  template<typename K, typename OPS = hash_ops<K>> class mfp;
358
360
 
361
+ // Computes the hash value of an unordered set of elements.
362
+ // See https://www.preprints.org/manuscript/201710.0192/v1/download.
363
+ // This is the Sum(4) algorithm from that paper, which has good collision resistance,
364
+ // much better than Sum(1) or Xor(1) (and somewhat better than Xor(4)).
365
+ class commutative_hash {
366
+ public:
367
+ commutative_hash() {
368
+ buckets.fill(0);
369
+ }
370
+ void eat(Hasher h) {
371
+ Hasher::hash_t v = h.yield();
372
+ size_t index = v & (buckets.size() - 1);
373
+ buckets[index] += v;
374
+ }
375
+ [[nodiscard]] Hasher hash_into(Hasher h) const {
376
+ for (auto b : buckets)
377
+ h.eat(b);
378
+ return h;
379
+ }
380
+ private:
381
+ std::array<Hasher::hash_t, 4> buckets;
382
+ };
383
+
359
384
  template<typename K, typename T, typename OPS>
360
385
  class dict {
361
386
  struct entry_t
@@ -451,16 +476,21 @@ class dict {
451
476
  return 1;
452
477
  }
453
478
 
454
- int do_lookup(const K &key, Hasher::hash_t &hash) const
479
+ int do_lookup(const K &key, Hasher::hash_t &hash)
455
480
  {
456
481
  if (hashtable.empty())
457
482
  return -1;
458
483
 
459
484
  if (entries.size() * hashtable_size_trigger > hashtable.size()) {
460
- ((dict*)this)->do_rehash();
485
+ do_rehash();
461
486
  hash = do_hash(key);
462
487
  }
463
488
 
489
+ return do_lookup_internal(key, hash);
490
+ }
491
+
492
+ int do_lookup_internal(const K &key, Hasher::hash_t hash) const
493
+ {
464
494
  int index = hashtable[hash];
465
495
 
466
496
  while (index >= 0 && !ops.cmp(entries[index].udata.first, key)) {
@@ -471,6 +501,14 @@ class dict {
471
501
  return index;
472
502
  }
473
503
 
504
+ int do_lookup_no_rehash(const K &key, Hasher::hash_t hash) const
505
+ {
506
+ if (hashtable.empty())
507
+ return -1;
508
+
509
+ return do_lookup_internal(key, hash);
510
+ }
511
+
474
512
  int do_insert(const K &key, Hasher::hash_t &hash)
475
513
  {
476
514
  if (hashtable.empty()) {
@@ -694,14 +732,14 @@ public:
694
732
  int count(const K &key) const
695
733
  {
696
734
  Hasher::hash_t hash = do_hash(key);
697
- int i = do_lookup(key, hash);
735
+ int i = do_lookup_no_rehash(key, hash);
698
736
  return i < 0 ? 0 : 1;
699
737
  }
700
738
 
701
739
  int count(const K &key, const_iterator it) const
702
740
  {
703
741
  Hasher::hash_t hash = do_hash(key);
704
- int i = do_lookup(key, hash);
742
+ int i = do_lookup_no_rehash(key, hash);
705
743
  return i < 0 || i > it.index ? 0 : 1;
706
744
  }
707
745
 
@@ -717,7 +755,7 @@ public:
717
755
  const_iterator find(const K &key) const
718
756
  {
719
757
  Hasher::hash_t hash = do_hash(key);
720
- int i = do_lookup(key, hash);
758
+ int i = do_lookup_no_rehash(key, hash);
721
759
  if (i < 0)
722
760
  return end();
723
761
  return const_iterator(this, i);
@@ -735,7 +773,7 @@ public:
735
773
  const T& at(const K &key) const
736
774
  {
737
775
  Hasher::hash_t hash = do_hash(key);
738
- int i = do_lookup(key, hash);
776
+ int i = do_lookup_no_rehash(key, hash);
739
777
  if (i < 0)
740
778
  throw std::out_of_range("dict::at()");
741
779
  return entries[i].udata.second;
@@ -744,7 +782,7 @@ public:
744
782
  const T& at(const K &key, const T &defval) const
745
783
  {
746
784
  Hasher::hash_t hash = do_hash(key);
747
- int i = do_lookup(key, hash);
785
+ int i = do_lookup_no_rehash(key, hash);
748
786
  if (i < 0)
749
787
  return defval;
750
788
  return entries[i].udata.second;
@@ -788,14 +826,14 @@ public:
788
826
  }
789
827
 
790
828
  [[nodiscard]] Hasher hash_into(Hasher h) const {
829
+ commutative_hash comm;
791
830
  for (auto &it : entries) {
792
831
  Hasher entry_hash;
793
832
  entry_hash.eat(it.udata.first);
794
833
  entry_hash.eat(it.udata.second);
795
- h.commutative_eat(entry_hash.yield());
834
+ comm.eat(entry_hash);
796
835
  }
797
- h.eat(entries.size());
798
- return h;
836
+ return comm.hash_into(h);
799
837
  }
800
838
 
801
839
  void reserve(size_t n) { entries.reserve(n); }
@@ -906,16 +944,21 @@ protected:
906
944
  return 1;
907
945
  }
908
946
 
909
- int do_lookup(const K &key, Hasher::hash_t &hash) const
947
+ int do_lookup(const K &key, Hasher::hash_t &hash)
910
948
  {
911
949
  if (hashtable.empty())
912
950
  return -1;
913
951
 
914
952
  if (entries.size() * hashtable_size_trigger > hashtable.size()) {
915
- ((pool*)this)->do_rehash();
953
+ do_rehash();
916
954
  hash = do_hash(key);
917
955
  }
918
956
 
957
+ return do_lookup_internal(key, hash);
958
+ }
959
+
960
+ int do_lookup_internal(const K &key, Hasher::hash_t hash) const
961
+ {
919
962
  int index = hashtable[hash];
920
963
 
921
964
  while (index >= 0 && !ops.cmp(entries[index].udata, key)) {
@@ -926,6 +969,14 @@ protected:
926
969
  return index;
927
970
  }
928
971
 
972
+ int do_lookup_no_rehash(const K &key, Hasher::hash_t hash) const
973
+ {
974
+ if (hashtable.empty())
975
+ return -1;
976
+
977
+ return do_lookup_internal(key, hash);
978
+ }
979
+
929
980
  int do_insert(const K &value, Hasher::hash_t &hash)
930
981
  {
931
982
  if (hashtable.empty()) {
@@ -1087,14 +1138,14 @@ public:
1087
1138
  int count(const K &key) const
1088
1139
  {
1089
1140
  Hasher::hash_t hash = do_hash(key);
1090
- int i = do_lookup(key, hash);
1141
+ int i = do_lookup_no_rehash(key, hash);
1091
1142
  return i < 0 ? 0 : 1;
1092
1143
  }
1093
1144
 
1094
1145
  int count(const K &key, const_iterator it) const
1095
1146
  {
1096
1147
  Hasher::hash_t hash = do_hash(key);
1097
- int i = do_lookup(key, hash);
1148
+ int i = do_lookup_no_rehash(key, hash);
1098
1149
  return i < 0 || i > it.index ? 0 : 1;
1099
1150
  }
1100
1151
 
@@ -1110,7 +1161,7 @@ public:
1110
1161
  const_iterator find(const K &key) const
1111
1162
  {
1112
1163
  Hasher::hash_t hash = do_hash(key);
1113
- int i = do_lookup(key, hash);
1164
+ int i = do_lookup_no_rehash(key, hash);
1114
1165
  if (i < 0)
1115
1166
  return end();
1116
1167
  return const_iterator(this, i);
@@ -1158,11 +1209,11 @@ public:
1158
1209
  }
1159
1210
 
1160
1211
  [[nodiscard]] Hasher hash_into(Hasher h) const {
1212
+ commutative_hash comm;
1161
1213
  for (auto &it : entries) {
1162
- h.commutative_eat(ops.hash(it.udata).yield());
1214
+ comm.eat(ops.hash(it.udata));
1163
1215
  }
1164
- h.eat(entries.size());
1165
- return h;
1216
+ return comm.hash_into(h);
1166
1217
  }
1167
1218
 
1168
1219
  void reserve(size_t n) { entries.reserve(n); }
@@ -1222,7 +1273,7 @@ public:
1222
1273
  int at(const K &key) const
1223
1274
  {
1224
1275
  Hasher::hash_t hash = database.do_hash(key);
1225
- int i = database.do_lookup(key, hash);
1276
+ int i = database.do_lookup_no_rehash(key, hash);
1226
1277
  if (i < 0)
1227
1278
  throw std::out_of_range("idict::at()");
1228
1279
  return i + offset;
@@ -1231,7 +1282,7 @@ public:
1231
1282
  int at(const K &key, int defval) const
1232
1283
  {
1233
1284
  Hasher::hash_t hash = database.do_hash(key);
1234
- int i = database.do_lookup(key, hash);
1285
+ int i = database.do_lookup_no_rehash(key, hash);
1235
1286
  if (i < 0)
1236
1287
  return defval;
1237
1288
  return i + offset;
@@ -1240,7 +1291,7 @@ public:
1240
1291
  int count(const K &key) const
1241
1292
  {
1242
1293
  Hasher::hash_t hash = database.do_hash(key);
1243
- int i = database.do_lookup(key, hash);
1294
+ int i = database.do_lookup_no_rehash(key, hash);
1244
1295
  return i < 0 ? 0 : 1;
1245
1296
  }
1246
1297
 
@@ -1327,7 +1378,8 @@ public:
1327
1378
  return p;
1328
1379
  }
1329
1380
 
1330
- // Merge sets if the given indices belong to different sets
1381
+ // Merge sets if the given indices belong to different sets.
1382
+ // Makes ifind(j) the root of the merged set.
1331
1383
  void imerge(int i, int j)
1332
1384
  {
1333
1385
  i = ifind(i);
@@ -201,6 +201,7 @@ struct LogExpectedItem
201
201
  };
202
202
 
203
203
  extern dict<std::string, LogExpectedItem> log_expect_log, log_expect_warning, log_expect_error;
204
+ extern dict<std::string, LogExpectedItem> log_expect_prefix_log, log_expect_prefix_warning, log_expect_prefix_error;
204
205
  void log_check_expected();
205
206
 
206
207
  const char *log_signal(const RTLIL::SigSpec &sig, bool autoint = true);
@@ -1334,7 +1334,7 @@ struct RTLIL::Design
1334
1334
  dict<RTLIL::IdString, RTLIL::Module*> modules_;
1335
1335
  std::vector<RTLIL::Binding*> bindings_;
1336
1336
 
1337
- std::vector<AST::AstNode*> verilog_packages, verilog_globals;
1337
+ std::vector<std::unique_ptr<AST::AstNode>> verilog_packages, verilog_globals;
1338
1338
  std::unique_ptr<define_map_t> verilog_defines;
1339
1339
 
1340
1340
  std::vector<RTLIL::Selection> selection_stack;
@@ -64,7 +64,7 @@ struct ezSatPtr : public std::unique_ptr<ezSAT> {
64
64
  struct SatGen
65
65
  {
66
66
  ezSAT *ez;
67
- SigMap *sigmap;
67
+ const SigMap *sigmap;
68
68
  std::string prefix;
69
69
  SigPool initial_state;
70
70
  std::map<std::string, RTLIL::SigSpec> asserts_a, asserts_en;
@@ -75,12 +75,12 @@ struct SatGen
75
75
  bool model_undef;
76
76
  bool def_formal = false;
77
77
 
78
- SatGen(ezSAT *ez, SigMap *sigmap, std::string prefix = std::string()) :
78
+ SatGen(ezSAT *ez, const SigMap *sigmap, std::string prefix = std::string()) :
79
79
  ez(ez), sigmap(sigmap), prefix(prefix), ignore_div_by_zero(false), model_undef(false)
80
80
  {
81
81
  }
82
82
 
83
- void setContext(SigMap *sigmap, std::string prefix = std::string())
83
+ void setContext(const SigMap *sigmap, std::string prefix = std::string())
84
84
  {
85
85
  this->sigmap = sigmap;
86
86
  this->prefix = prefix;
@@ -237,6 +237,42 @@ using sort_by_name_id_guard = typename std::enable_if<std::is_same<T,RTLIL::Cell
237
237
  template<typename T>
238
238
  class SigSet<T, sort_by_name_id_guard<T>> : public SigSet<T, RTLIL::sort_by_name_id<typename std::remove_pointer<T>::type>> {};
239
239
 
240
+ struct SigMapView
241
+ {
242
+ mfp<SigBit> database;
243
+
244
+ // Modify bit to its representative
245
+ void apply(RTLIL::SigBit &bit) const
246
+ {
247
+ bit = database.find(bit);
248
+ }
249
+
250
+ void apply(RTLIL::SigSpec &sig) const
251
+ {
252
+ for (auto &bit : sig)
253
+ apply(bit);
254
+ }
255
+
256
+ RTLIL::SigBit operator()(RTLIL::SigBit bit) const
257
+ {
258
+ apply(bit);
259
+ return bit;
260
+ }
261
+
262
+ RTLIL::SigSpec operator()(RTLIL::SigSpec sig) const
263
+ {
264
+ apply(sig);
265
+ return sig;
266
+ }
267
+
268
+ RTLIL::SigSpec operator()(RTLIL::Wire *wire) const
269
+ {
270
+ SigSpec sig(wire);
271
+ apply(sig);
272
+ return sig;
273
+ }
274
+ };
275
+
240
276
  /**
241
277
  * SigMap wraps a union-find "database"
242
278
  * to map SigBits of a module to canonical representative SigBits.
@@ -244,10 +280,8 @@ class SigSet<T, sort_by_name_id_guard<T>> : public SigSet<T, RTLIL::sort_by_name
244
280
  * If a SigBit has a const state (impl: bit.wire is nullptr),
245
281
  * it's promoted to a representative.
246
282
  */
247
- struct SigMap
283
+ struct SigMap final : public SigMapView
248
284
  {
249
- mfp<SigBit> database;
250
-
251
285
  SigMap(RTLIL::Module *module = NULL)
252
286
  {
253
287
  if (module != NULL)
@@ -320,45 +354,115 @@ struct SigMap
320
354
 
321
355
  inline void add(Wire *wire) { return add(RTLIL::SigSpec(wire)); }
322
356
 
323
- // Modify bit to its representative
324
- void apply(RTLIL::SigBit &bit) const
357
+ // All non-const bits
358
+ RTLIL::SigSpec allbits() const
325
359
  {
326
- bit = database.find(bit);
360
+ RTLIL::SigSpec sig;
361
+ for (const auto &bit : database)
362
+ if (bit.wire != nullptr)
363
+ sig.append(bit);
364
+ return sig;
327
365
  }
366
+ };
328
367
 
329
- void apply(RTLIL::SigSpec &sig) const
368
+ /**
369
+ * SiValgMap wraps a union-find "database" to map SigBits of a module to
370
+ * canonical representative SigBits plus some optional Val value associated with the bits.
371
+ * Val has a commutative, associative, idempotent operator|=, a default constructor
372
+ * which constructs an identity element, and a copy constructor.
373
+ * SigBits that are connected share a set in the underlying database;
374
+ * the associated value is the "sum" of all the values associated with the contributing bits.
375
+ * If any of the SigBits in a set are a constant, the canonical SigBit is a constant.
376
+ */
377
+ template <class Val>
378
+ struct SigValMap final : public SigMapView
379
+ {
380
+ dict<SigBit, Val> values;
381
+
382
+ void swap(SigValMap<Val> &other)
330
383
  {
331
- for (auto &bit : sig)
332
- apply(bit);
384
+ database.swap(other.database);
385
+ values.swap(other.values);
333
386
  }
334
387
 
335
- RTLIL::SigBit operator()(RTLIL::SigBit bit) const
388
+ void clear()
336
389
  {
337
- apply(bit);
338
- return bit;
390
+ database.clear();
391
+ values.clear();
339
392
  }
340
393
 
341
- RTLIL::SigSpec operator()(RTLIL::SigSpec sig) const
394
+ // Rebuild SigMap for all connections in module
395
+ void set(RTLIL::Module *module)
342
396
  {
343
- apply(sig);
344
- return sig;
397
+ int bitcount = 0;
398
+ for (auto &it : module->connections())
399
+ bitcount += it.first.size();
400
+
401
+ database.clear();
402
+ values.clear();
403
+ database.reserve(bitcount);
404
+
405
+ for (auto &it : module->connections())
406
+ add(it.first, it.second);
345
407
  }
346
408
 
347
- RTLIL::SigSpec operator()(RTLIL::Wire *wire) const
409
+ // Add connections from "from" to "to", bit-by-bit.
410
+ void add(const RTLIL::SigSpec& from, const RTLIL::SigSpec& to)
348
411
  {
349
- SigSpec sig(wire);
350
- apply(sig);
351
- return sig;
412
+ log_assert(GetSize(from) == GetSize(to));
413
+
414
+ for (int i = 0; i < GetSize(from); i++)
415
+ {
416
+ int bfi = database.lookup(from[i]);
417
+ int bti = database.lookup(to[i]);
418
+ if (bfi == bti) {
419
+ continue;
420
+ }
421
+
422
+ const RTLIL::SigBit &bf = database[bfi];
423
+ const RTLIL::SigBit &bt = database[bti];
424
+ if (bf.wire == nullptr) {
425
+ // bf is constant so make it the canonical representative.
426
+ database.imerge(bti, bfi);
427
+ merge_value(bt, bf);
428
+ } else {
429
+ // Make bt the canonical representative.
430
+ database.imerge(bfi, bti);
431
+ merge_value(bf, bt);
432
+ }
433
+ }
352
434
  }
353
435
 
354
- // All non-const bits
355
- RTLIL::SigSpec allbits() const
436
+ void addVal(const RTLIL::SigBit &bit, const Val &val)
356
437
  {
357
- RTLIL::SigSpec sig;
358
- for (const auto &bit : database)
359
- if (bit.wire != nullptr)
360
- sig.append(bit);
361
- return sig;
438
+ values[database.find(bit)] |= val;
439
+ }
440
+
441
+ void addVal(const RTLIL::SigSpec &sig, const Val &val)
442
+ {
443
+ for (const auto &bit : sig)
444
+ addVal(bit, val);
445
+ }
446
+
447
+ Val apply_and_get_value(RTLIL::SigBit &bit) const
448
+ {
449
+ bit = database.find(bit);
450
+ auto it = values.find(bit);
451
+ return it == values.end() ? Val() : it->second;
452
+ }
453
+
454
+ private:
455
+ void merge_value(const RTLIL::SigBit &from, const RTLIL::SigBit &to)
456
+ {
457
+ auto it = values.find(from);
458
+ if (it == values.end()) {
459
+ return;
460
+ }
461
+ // values[to] could resize the underlying `entries` so
462
+ // finish using `it` first.
463
+ Val v = it->second;
464
+ values.erase(it);
465
+ values[to] |= v;
362
466
  }
363
467
  };
364
468
 
@@ -20,6 +20,7 @@
20
20
  #ifndef YOSYS_COMMON_H
21
21
  #define YOSYS_COMMON_H
22
22
 
23
+ #include <array>
23
24
  #include <map>
24
25
  #include <set>
25
26
  #include <tuple>
@@ -19,6 +19,8 @@ endmodule
19
19
 
20
20
  (* blackbox *)
21
21
  module DP16KD (...);
22
+ parameter CLKAMUX = "CLKA";
23
+ parameter CLKBMUX = "CLKB";
22
24
  parameter DATA_WIDTH_A = 18;
23
25
  parameter DATA_WIDTH_B = 18;
24
26
  parameter REGMODE_A = "NOREG";
@@ -215,6 +217,8 @@ endmodule
215
217
 
216
218
  (* blackbox *)
217
219
  module PDPW16KD (...);
220
+ parameter CLKRMUX = "CLKR";
221
+ parameter CLKWMUX = "CLKW";
218
222
  parameter DATA_WIDTH_W = 36;
219
223
  parameter DATA_WIDTH_R = 36;
220
224
  parameter GSR = "ENABLED";
yowasp_yosys/smtbmc.py CHANGED
@@ -1875,6 +1875,11 @@ elif covermode:
1875
1875
  smt_assert_antecedent("(|%s_t| s%d s%d)" % (topmod, step-1, step))
1876
1876
  smt_assert_antecedent("(not (|%s_is| s%d))" % (topmod, step))
1877
1877
 
1878
+ if step < skip_steps:
1879
+ print_msg("Skipping step %d.." % (step))
1880
+ step += 1
1881
+ continue
1882
+
1878
1883
  while "1" in cover_mask:
1879
1884
  print_msg("Checking cover reachability in step %d.." % (step))
1880
1885
  smt_push()
yowasp_yosys/yosys.wasm CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yowasp-yosys
3
- Version: 0.56.0.0.post964
3
+ Version: 0.57.0.0.post986
4
4
  Summary: Yosys Open SYnthesis Suite
5
5
  Author-email: Catherine <whitequark@whitequark.org>
6
6
  License-Expression: ISC
@@ -1,8 +1,8 @@
1
1
  yowasp_yosys/__init__.py,sha256=cxu6bMlZ6zRpCzKp2wdFs7LNt5-btnJD6ghvdkDs6Y0,1189
2
2
  yowasp_yosys/sby.py,sha256=BZwSqLk064cKvGITogDi3OqlQtRJJ-8J4_KG5Z7ktoc,19736
3
- yowasp_yosys/smtbmc.py,sha256=yiI93tHys5c8aXfCdk2dNtw2mwukRXqeT8YGx5Th8eg,74231
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=g5VDCRlmu6vbH2ewagXlh-hz6w2saUFj5_RWVPhCySM,37878780
5
+ yowasp_yosys/yosys.wasm,sha256=akqkYNIpY9e04P0i4eAN3SaV88KEDtaPAFQW7z7PxLw,38079548
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
@@ -115,41 +115,41 @@ yowasp_yosys/share/include/backends/cxxrtl/runtime/cxxrtl/capi/cxxrtl_capi.h,sha
115
115
  yowasp_yosys/share/include/backends/cxxrtl/runtime/cxxrtl/capi/cxxrtl_capi_vcd.cc,sha256=5A6IK46tg8BWgs_vzS183p9HMZfWP7FZfJzCjnB3vW8,2815
116
116
  yowasp_yosys/share/include/backends/cxxrtl/runtime/cxxrtl/capi/cxxrtl_capi_vcd.h,sha256=P6KBEs-76IK4LwKBhXbju9nwkH3rmmqUm4uSuiaS88M,4286
117
117
  yowasp_yosys/share/include/backends/rtlil/rtlil_backend.h,sha256=h-kkdWtAosSZDzvAW511jAHao-dDUm3fyTJhfMXsZDk,2407
118
- yowasp_yosys/share/include/frontends/ast/ast.h,sha256=rjvkPnIrXBsH3TosMTsuoKpgKyUBUmiWw8rxBgDhuxg,16930
118
+ yowasp_yosys/share/include/frontends/ast/ast.h,sha256=p_nm0-fYc1xyPngvCtvzKFH5rWgydpNq5Q9XPBzokcc,17216
119
119
  yowasp_yosys/share/include/frontends/ast/ast_binding.h,sha256=NdII3-d38NWB_87m9AOzqQLjkkYaYToz3xHTsHNelU0,1756
120
120
  yowasp_yosys/share/include/frontends/blif/blifparse.h,sha256=GGceOEm-flPK0QdPIVDZ6ZGpkTphT14oTxJhAYIb2RY,1139
121
121
  yowasp_yosys/share/include/kernel/binding.h,sha256=BKfMhNf_HflihwCXEqyZuB1zp9xzVi0NRKe-5MvIidM,1947
122
- yowasp_yosys/share/include/kernel/bitpattern.h,sha256=V_gds0rvxcrRMTFhIm8Zv4PRFowNspJldfURho00lqo,3900
122
+ yowasp_yosys/share/include/kernel/bitpattern.h,sha256=zxsZkQlp043mWDWXxf2uyh2KtN75YHdRJtLsPmH33X0,5496
123
123
  yowasp_yosys/share/include/kernel/cellaigs.h,sha256=CdYos67IpmAgLvBbJ8EC3hWg6WhBIBy9jmhdoZ36HVE,1391
124
124
  yowasp_yosys/share/include/kernel/celledges.h,sha256=fF_sHJOpN_qQ1P0x8KKoJE9ulDMusfjkF0dBpTMs19E,2216
125
- yowasp_yosys/share/include/kernel/celltypes.h,sha256=W44T0u789-fy_tj7fGRTNI7s1jshewrPwmS3_-Oz6-A,18561
126
- yowasp_yosys/share/include/kernel/consteval.h,sha256=oEPSKbbgqvNmlLqYFSozZX2cjFQA5IM-d69HmyuZiGo,10864
125
+ yowasp_yosys/share/include/kernel/celltypes.h,sha256=sDqHEa3XqKD-0l-w5bvle5TI-wVABEpF6W1-ThvO7Eg,19027
126
+ yowasp_yosys/share/include/kernel/consteval.h,sha256=nYMALfx9WfaEr4c5VagL0lJta2QT_YdB0MdfXgEO0lU,11046
127
127
  yowasp_yosys/share/include/kernel/constids.inc,sha256=lW_aOEkMMVFonK8BAhc6JgmP95X9Q2yBJWg-xfhCc5c,3745
128
128
  yowasp_yosys/share/include/kernel/cost.h,sha256=TRW3KGPVLv5MxAmNbSh1mnzwTc-QHvZXSh9Wfc6mw3U,2921
129
129
  yowasp_yosys/share/include/kernel/drivertools.h,sha256=jHGOmnyVCjfvUvoBfQvD9O-Tu6pfs4WVbPbQZv1Mhd4,33537
130
130
  yowasp_yosys/share/include/kernel/ff.h,sha256=vVJqxmyfJ1z9qnnUA3CAoX5NavU33_J4U1Sd7TgPp5M,7631
131
- yowasp_yosys/share/include/kernel/ffinit.h,sha256=2JWt6YDjYYBtmQYzR68Apnq6S6y2gCvMkod6Qc3oWCw,3489
132
- yowasp_yosys/share/include/kernel/ffmerge.h,sha256=I3mXyytzRyP92T9XhSQTlv7EN2G31nJhspBxlLYiMEY,6305
131
+ yowasp_yosys/share/include/kernel/ffinit.h,sha256=wf_zlDDUGrmz__IH81008Hf2EiHzVJ8g8xmn23_BDLU,3501
132
+ yowasp_yosys/share/include/kernel/ffmerge.h,sha256=xl1_h88ZmLIxpli7vpiiU35R_Y4cZq728-A72abuzMg,6309
133
133
  yowasp_yosys/share/include/kernel/fmt.h,sha256=0UT-aDVX7_KnzlaNyK3iMsSzoICa4Q0HhqsFIrwHBMw,2790
134
134
  yowasp_yosys/share/include/kernel/gzip.h,sha256=wpAZ9hA13HEpWgZnth46JHvVLSA_qdS-JZB5gh83-QA,1847
135
- yowasp_yosys/share/include/kernel/hashlib.h,sha256=LgN2dYAg8r0YZnOd1r8DFI0qy7nyWO--SMghZaD7P9k,35719
135
+ yowasp_yosys/share/include/kernel/hashlib.h,sha256=016LJucLM97lCNOShYzwFiEFwLYmPQ16X44pyXrbcwQ,37200
136
136
  yowasp_yosys/share/include/kernel/io.h,sha256=8yQ9hISjrJKqsUbgQq4XaK8_VTRYE-jcSR-kP-Oq2FA,15010
137
137
  yowasp_yosys/share/include/kernel/json.h,sha256=i2wmIMZ2SCE5zc6IIIVLx4XZ2-HQiZEFJ0ao_cMInK0,2849
138
- yowasp_yosys/share/include/kernel/log.h,sha256=NZNJPBf-F_sISwfmJ_GQPm1Z9UzUCYQD6jHiWnsVorY,15380
138
+ yowasp_yosys/share/include/kernel/log.h,sha256=o2FuugF5IM1K_rnioDtRj8Vsu72VXOvLICcPpdaTG9k,15497
139
139
  yowasp_yosys/share/include/kernel/macc.h,sha256=LHm507daCT57lGCNNwia1LJVk3pkBB5ZteCZihxD5Qw,8926
140
140
  yowasp_yosys/share/include/kernel/mem.h,sha256=xKz0HxXap_PTdzpK-NUcbxybF3YisRc2JoCv17TXOc4,15505
141
141
  yowasp_yosys/share/include/kernel/modtools.h,sha256=mRnzc5TIsdIbHlFSTk2Yc0y85ttknhK-dAlti3neSI8,14388
142
142
  yowasp_yosys/share/include/kernel/qcsat.h,sha256=ibhpJRu0youjDXPllXrDJi851VpwW1kbJ_y94_X6JhU,2804
143
143
  yowasp_yosys/share/include/kernel/register.h,sha256=jc3S7uED5yT-60fY_DhfrgRoy3Q_h8kVFaF_lc5JZyY,6789
144
- yowasp_yosys/share/include/kernel/rtlil.h,sha256=SlvFoc97XNI1mYyp-fUmC3Jy9aRhUUAHe8PRyYkD9xY,99512
145
- yowasp_yosys/share/include/kernel/satgen.h,sha256=O7h0qkcsaX5g4XsUiLumlj8RAg63fxkFCLgZds5xgL8,10525
144
+ yowasp_yosys/share/include/kernel/rtlil.h,sha256=mnok7FWmr4jh7auCipSXV8HfcPhNyfOKb-Hy-N0XtSk,99528
145
+ yowasp_yosys/share/include/kernel/satgen.h,sha256=IPl4fWKQMyRFalyxwGJEJQt9MXIOKi3BKmqfkDbm7m4,10543
146
146
  yowasp_yosys/share/include/kernel/scopeinfo.h,sha256=EAU3vSTIwH1RrbSC7HVoTWh4SLfHMSIoidQPvT1Mo7g,11797
147
147
  yowasp_yosys/share/include/kernel/sexpr.h,sha256=CUDKFehVoGmakYBYLpEKUtlM0Dd3oI6TNW_cKz-qe0g,4720
148
- yowasp_yosys/share/include/kernel/sigtools.h,sha256=Tb1hUOLJD-AV4ojLVcjx0Dc00QSy6nGJyTwNMa4eqw0,8074
148
+ yowasp_yosys/share/include/kernel/sigtools.h,sha256=5s1qkeGjV2pbwrWRNaNgay8qHfKzk7TgK1jQM-C2Dco,10652
149
149
  yowasp_yosys/share/include/kernel/timinginfo.h,sha256=JNRktUWp7ow_wn4P5BxlOkv7hNS7qKbws7Gjs6VSUx8,7367
150
150
  yowasp_yosys/share/include/kernel/utils.h,sha256=5bJFi7SNf18SL7icrEQEDDYnqT9TrjBMlPZGHbinFK8,7315
151
151
  yowasp_yosys/share/include/kernel/yosys.h,sha256=bx9lTnEhsorxUoLhz2hu0__pSvVAyrthvGjoqaOL6oQ,3438
152
- yowasp_yosys/share/include/kernel/yosys_common.h,sha256=dRr3ZJhPosoDgFkVN2FkraMOSZ4r1c3qQaG2JsLWz0s,8185
152
+ yowasp_yosys/share/include/kernel/yosys_common.h,sha256=5jwfilYMMjd-cYsauyqEyn7bD7oPTSj_sjkcDJFHdqA,8202
153
153
  yowasp_yosys/share/include/kernel/yw.h,sha256=Gr5zqBNUSKXOKhdw7tl9-KcCiZg3xFcK9Msj7LMawdI,5470
154
154
  yowasp_yosys/share/include/libs/ezsat/ezminisat.h,sha256=bSrDL6VRinpXdULoR8P9lQaT1Dy4kAEZfTcKjRKOdjg,2098
155
155
  yowasp_yosys/share/include/libs/ezsat/ezsat.h,sha256=eggeGwS9pFyxSYGT0RtOqX189pbXFAKDfPZzIYTmqIk,14523
@@ -195,7 +195,7 @@ yowasp_yosys/share/lattice/brams_map_16kd.v,sha256=oY8funFMgcjkaaIPwPrg3Nk8-1bPJ
195
195
  yowasp_yosys/share/lattice/brams_map_8kc.v,sha256=ZJ7PjS33Q7dbyuzcJJyzKPVGhs7zJpZJDPnuTDBI4YE,8100
196
196
  yowasp_yosys/share/lattice/ccu2c_sim.vh,sha256=F4sTELLnB2gRThx5URhSkFV5nfGtZQoJ0GE7OFaoHMw,1624
197
197
  yowasp_yosys/share/lattice/ccu2d_sim.vh,sha256=ZhnmJXUWJIlamTNg5yHoziyFf-1iyIDKyauj480vxvo,1083
198
- yowasp_yosys/share/lattice/cells_bb_ecp5.v,sha256=Ln5Ivw2WAZmRNMQKjcNJkubG5jMhgK0b3xkVoZLb7vY,61140
198
+ yowasp_yosys/share/lattice/cells_bb_ecp5.v,sha256=Qt_WiNiWGUo6hl1Ra--X1_BTWFRr5-McxPyRPVjokxY,61268
199
199
  yowasp_yosys/share/lattice/cells_bb_xo2.v,sha256=4mF3np9neeBzZKlcsqpBii7RItXXaOXmL0EQrH99Qz0,20410
200
200
  yowasp_yosys/share/lattice/cells_bb_xo3.v,sha256=4mF3np9neeBzZKlcsqpBii7RItXXaOXmL0EQrH99Qz0,20410
201
201
  yowasp_yosys/share/lattice/cells_bb_xo3d.v,sha256=anx0ve8i123KB-PdNLaq8zrIclgve55Gvis6pjHjlf4,20429
@@ -336,8 +336,8 @@ yowasp_yosys/share/xilinx/xc5v_dsp_map.v,sha256=I4lg0RQ54fBBba_7NNvUgwS4tQ1yLIsU
336
336
  yowasp_yosys/share/xilinx/xc6s_dsp_map.v,sha256=gTxHocB-Dn5G4BplWgri_tLhT6DIO2S0X-yu4iBKYyk,562
337
337
  yowasp_yosys/share/xilinx/xc7_dsp_map.v,sha256=zrzreQi7mElrAMtrayxtiO_Bw00S6zsjSjSVcjmJPH0,884
338
338
  yowasp_yosys/share/xilinx/xcu_dsp_map.v,sha256=gzCgl1emrHGcigVmU0nP0pW7dlhQ01SaWwXzHHcqt-o,882
339
- yowasp_yosys-0.56.0.0.post964.dist-info/METADATA,sha256=WszNwKNEceAy9MIYakwpaWAXaGqefifrcEkle7IX8tQ,2522
340
- yowasp_yosys-0.56.0.0.post964.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
341
- yowasp_yosys-0.56.0.0.post964.dist-info/entry_points.txt,sha256=p_9sIVi2ZqsqgYYo14PywYkwHYTa76fMEq3LxweXJpc,220
342
- yowasp_yosys-0.56.0.0.post964.dist-info/top_level.txt,sha256=_yiNT8kLYkcD1TEuUCzQ_MkON1c3xuIRV59zXds4zd4,13
343
- yowasp_yosys-0.56.0.0.post964.dist-info/RECORD,,
339
+ yowasp_yosys-0.57.0.0.post986.dist-info/METADATA,sha256=eLmfLFnP5ntIkGz3RmACD3yGxWDDsppLa-R13p1F_es,2522
340
+ yowasp_yosys-0.57.0.0.post986.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
341
+ yowasp_yosys-0.57.0.0.post986.dist-info/entry_points.txt,sha256=p_9sIVi2ZqsqgYYo14PywYkwHYTa76fMEq3LxweXJpc,220
342
+ yowasp_yosys-0.57.0.0.post986.dist-info/top_level.txt,sha256=_yiNT8kLYkcD1TEuUCzQ_MkON1c3xuIRV59zXds4zd4,13
343
+ yowasp_yosys-0.57.0.0.post986.dist-info/RECORD,,