yowasp-yosys 0.45.0.0.post775__py3-none-any.whl → 0.47.0.0.post805__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.
Files changed (36) hide show
  1. yowasp_yosys/share/gowin/cells_sim.v +98 -0
  2. yowasp_yosys/share/gowin/cells_xtra.v +0 -3
  3. yowasp_yosys/share/include/backends/cxxrtl/runtime/cxxrtl/cxxrtl.h +1 -1
  4. yowasp_yosys/share/include/backends/cxxrtl/runtime/cxxrtl/cxxrtl_vcd.h +9 -3
  5. yowasp_yosys/share/include/frontends/ast/ast.h +3 -0
  6. yowasp_yosys/share/include/kernel/bitpattern.h +1 -1
  7. yowasp_yosys/share/include/kernel/celltypes.h +15 -13
  8. yowasp_yosys/share/include/kernel/consteval.h +7 -7
  9. yowasp_yosys/share/include/kernel/constids.inc +1 -1
  10. yowasp_yosys/share/include/kernel/drivertools.h +1332 -0
  11. yowasp_yosys/share/include/kernel/ff.h +4 -2
  12. yowasp_yosys/share/include/kernel/ffinit.h +3 -3
  13. yowasp_yosys/share/include/kernel/hashlib.h +32 -0
  14. yowasp_yosys/share/include/kernel/log.h +2 -0
  15. yowasp_yosys/share/include/kernel/macc.h +2 -2
  16. yowasp_yosys/share/include/kernel/mem.h +109 -0
  17. yowasp_yosys/share/include/kernel/rtlil.h +135 -26
  18. yowasp_yosys/share/include/kernel/sexpr.h +122 -0
  19. yowasp_yosys/share/include/kernel/utils.h +9 -0
  20. yowasp_yosys/share/include/kernel/yosys_common.h +5 -0
  21. yowasp_yosys/share/include/passes/fsm/fsmdata.h +13 -13
  22. yowasp_yosys/share/python3/sby_core.py +1 -0
  23. yowasp_yosys/share/python3/sby_design.py +18 -24
  24. yowasp_yosys/share/python3/sby_engine_aiger.py +39 -3
  25. yowasp_yosys/share/python3/sby_engine_smtbmc.py +16 -8
  26. yowasp_yosys/share/quicklogic/qlf_k6n10f/bram_types_sim.v +1 -1
  27. yowasp_yosys/share/simcells.v +149 -0
  28. yowasp_yosys/share/simlib.v +184 -59
  29. yowasp_yosys/share/techmap.v +2 -1
  30. yowasp_yosys/smtbmc.py +19 -8
  31. yowasp_yosys/yosys.wasm +0 -0
  32. {yowasp_yosys-0.45.0.0.post775.dist-info → yowasp_yosys-0.47.0.0.post805.dist-info}/METADATA +1 -1
  33. {yowasp_yosys-0.45.0.0.post775.dist-info → yowasp_yosys-0.47.0.0.post805.dist-info}/RECORD +36 -34
  34. {yowasp_yosys-0.45.0.0.post775.dist-info → yowasp_yosys-0.47.0.0.post805.dist-info}/WHEEL +0 -0
  35. {yowasp_yosys-0.45.0.0.post775.dist-info → yowasp_yosys-0.47.0.0.post805.dist-info}/entry_points.txt +0 -0
  36. {yowasp_yosys-0.45.0.0.post775.dist-info → yowasp_yosys-0.47.0.0.post805.dist-info}/top_level.txt +0 -0
@@ -1966,5 +1966,103 @@ output CLKOUT;
1966
1966
  parameter DCS_MODE = "RISING";
1967
1967
  endmodule
1968
1968
 
1969
+ (* blackbox *)
1970
+ module EMCU (
1971
+ input FCLK,
1972
+ input PORESETN,
1973
+ input SYSRESETN,
1974
+ input RTCSRCCLK,
1975
+ output [15:0] IOEXPOUTPUTO,
1976
+ output [15:0] IOEXPOUTPUTENO,
1977
+ input [15:0] IOEXPINPUTI,
1978
+ output UART0TXDO,
1979
+ output UART1TXDO,
1980
+ output UART0BAUDTICK,
1981
+ output UART1BAUDTICK,
1982
+ input UART0RXDI,
1983
+ input UART1RXDI,
1984
+ output INTMONITOR,
1985
+ output MTXHRESETN,
1986
+ output [12:0] SRAM0ADDR,
1987
+ output [3:0] SRAM0WREN,
1988
+ output [31:0] SRAM0WDATA,
1989
+ output SRAM0CS,
1990
+ input [31:0] SRAM0RDATA,
1991
+ output TARGFLASH0HSEL,
1992
+ output [28:0] TARGFLASH0HADDR,
1993
+ output [1:0] TARGFLASH0HTRANS,
1994
+ output [2:0] TARGFLASH0HSIZE,
1995
+ output [2:0] TARGFLASH0HBURST,
1996
+ output TARGFLASH0HREADYMUX,
1997
+ input [31:0] TARGFLASH0HRDATA,
1998
+ input [2:0] TARGFLASH0HRUSER,
1999
+ input TARGFLASH0HRESP,
2000
+ input TARGFLASH0EXRESP,
2001
+ input TARGFLASH0HREADYOUT,
2002
+ output TARGEXP0HSEL,
2003
+ output [31:0] TARGEXP0HADDR,
2004
+ output [1:0] TARGEXP0HTRANS,
2005
+ output TARGEXP0HWRITE,
2006
+ output [2:0] TARGEXP0HSIZE,
2007
+ output [2:0] TARGEXP0HBURST,
2008
+ output [3:0] TARGEXP0HPROT,
2009
+ output [1:0] TARGEXP0MEMATTR,
2010
+ output TARGEXP0EXREQ,
2011
+ output [3:0] TARGEXP0HMASTER,
2012
+ output [31:0] TARGEXP0HWDATA,
2013
+ output TARGEXP0HMASTLOCK,
2014
+ output TARGEXP0HREADYMUX,
2015
+ output TARGEXP0HAUSER,
2016
+ output [3:0] TARGEXP0HWUSER,
2017
+ input [31:0] TARGEXP0HRDATA,
2018
+ input TARGEXP0HREADYOUT,
2019
+ input TARGEXP0HRESP,
2020
+ input TARGEXP0EXRESP,
2021
+ input [2:0] TARGEXP0HRUSER,
2022
+ output [31:0] INITEXP0HRDATA,
2023
+ output INITEXP0HREADY,
2024
+ output INITEXP0HRESP,
2025
+ output INITEXP0EXRESP,
2026
+ output [2:0] INITEXP0HRUSER,
2027
+ input INITEXP0HSEL,
2028
+ input [31:0] INITEXP0HADDR,
2029
+ input [1:0] INITEXP0HTRANS,
2030
+ input INITEXP0HWRITE,
2031
+ input [2:0] INITEXP0HSIZE,
2032
+ input [2:0] INITEXP0HBURST,
2033
+ input [3:0] INITEXP0HPROT,
2034
+ input [1:0] INITEXP0MEMATTR,
2035
+ input INITEXP0EXREQ,
2036
+ input [3:0] INITEXP0HMASTER,
2037
+ input [31:0] INITEXP0HWDATA,
2038
+ input INITEXP0HMASTLOCK,
2039
+ input INITEXP0HAUSER,
2040
+ input [3:0] INITEXP0HWUSER,
2041
+ output [3:0] APBTARGEXP2PSTRB,
2042
+ output [2:0] APBTARGEXP2PPROT,
2043
+ output APBTARGEXP2PSEL,
2044
+ output APBTARGEXP2PENABLE,
2045
+ output [11:0] APBTARGEXP2PADDR,
2046
+ output APBTARGEXP2PWRITE,
2047
+ output [31:0] APBTARGEXP2PWDATA,
2048
+ input [31:0] APBTARGEXP2PRDATA,
2049
+ input APBTARGEXP2PREADY,
2050
+ input APBTARGEXP2PSLVERR,
2051
+ input [3:0] MTXREMAP,
2052
+ output DAPTDO,
2053
+ output DAPJTAGNSW,
2054
+ output DAPNTDOEN,
2055
+ input DAPSWDITMS,
2056
+ input DAPTDI,
2057
+ input DAPNTRST,
2058
+ input DAPSWCLKTCK,
2059
+ output [3:0] TPIUTRACEDATA,
2060
+ output TPIUTRACECLK,
2061
+ input [4:0] GPINT,
2062
+ input FLASHERR,
2063
+ input FLASHINT
2064
+
2065
+ );
2066
+ endmodule
1969
2067
 
1970
2068
 
@@ -1699,9 +1699,6 @@ input CLKIN, CE;
1699
1699
  output CLKOUT, CLKOUTN;
1700
1700
  endmodule
1701
1701
 
1702
- module EMCU (...);
1703
- endmodule
1704
-
1705
1702
  module FLASH64K (...);
1706
1703
  input[4:0]XADR;
1707
1704
  input[5:0]YADR;
@@ -1127,7 +1127,7 @@ struct fmt_part {
1127
1127
  }
1128
1128
 
1129
1129
  case UNICHAR: {
1130
- uint32_t codepoint = val.template get<uint32_t>();
1130
+ uint32_t codepoint = val.template zcast<32>().template get<uint32_t>();
1131
1131
  if (codepoint >= 0x10000)
1132
1132
  buf += (char)(0xf0 | (codepoint >> 18));
1133
1133
  else if (codepoint >= 0x800)
@@ -50,9 +50,13 @@ class vcd_writer {
50
50
 
51
51
  void emit_scope(const std::vector<std::string> &scope) {
52
52
  assert(!streaming);
53
- while (current_scope.size() > scope.size() ||
54
- (current_scope.size() > 0 &&
55
- current_scope[current_scope.size() - 1] != scope[current_scope.size() - 1])) {
53
+ size_t same_scope_count = 0;
54
+ while ((same_scope_count < current_scope.size()) &&
55
+ (same_scope_count < scope.size()) &&
56
+ (current_scope[same_scope_count] == scope[same_scope_count])) {
57
+ same_scope_count++;
58
+ }
59
+ while (current_scope.size() > same_scope_count) {
56
60
  buffer += "$upscope $end\n";
57
61
  current_scope.pop_back();
58
62
  }
@@ -123,6 +127,8 @@ class vcd_writer {
123
127
  bool bit_curr = var.curr[bit / (8 * sizeof(chunk_t))] & (1 << (bit % (8 * sizeof(chunk_t))));
124
128
  buffer += (bit_curr ? '1' : '0');
125
129
  }
130
+ if (var.width == 0)
131
+ buffer += '0';
126
132
  buffer += ' ';
127
133
  emit_ident(var.ident);
128
134
  buffer += '\n';
@@ -410,6 +410,9 @@ namespace AST
410
410
  extern void (*set_line_num)(int);
411
411
  extern int (*get_line_num)();
412
412
 
413
+ // for stats
414
+ unsigned long long astnode_count();
415
+
413
416
  // set set_line_num and get_line_num to internal dummy functions (done by simplify() and AstModule::derive
414
417
  // to control the filename and linenum properties of new nodes not generated by a frontend parser)
415
418
  void use_internal_line_num();
@@ -80,7 +80,7 @@ struct BitPatternPool
80
80
  bits_t sig2bits(RTLIL::SigSpec sig)
81
81
  {
82
82
  bits_t bits;
83
- bits.bitdata = sig.as_const().bits;
83
+ bits.bitdata = sig.as_const().bits();
84
84
  for (auto &b : bits.bitdata)
85
85
  if (b > RTLIL::State::S1)
86
86
  b = RTLIL::State::Sa;
@@ -29,6 +29,8 @@ struct CellType
29
29
  RTLIL::IdString type;
30
30
  pool<RTLIL::IdString> inputs, outputs;
31
31
  bool is_evaluable;
32
+ bool is_combinatorial;
33
+ bool is_synthesizable;
32
34
  };
33
35
 
34
36
  struct CellTypes
@@ -56,9 +58,9 @@ struct CellTypes
56
58
  setup_stdcells_mem();
57
59
  }
58
60
 
59
- void setup_type(RTLIL::IdString type, const pool<RTLIL::IdString> &inputs, const pool<RTLIL::IdString> &outputs, bool is_evaluable = false)
61
+ void setup_type(RTLIL::IdString type, const pool<RTLIL::IdString> &inputs, const pool<RTLIL::IdString> &outputs, bool is_evaluable = false, bool is_combinatorial = false, bool is_synthesizable = false)
60
62
  {
61
- CellType ct = {type, inputs, outputs, is_evaluable};
63
+ CellType ct = {type, inputs, outputs, is_evaluable, is_combinatorial, is_synthesizable};
62
64
  cell_types[ct.type] = ct;
63
65
  }
64
66
 
@@ -114,7 +116,7 @@ struct CellTypes
114
116
  void setup_internals_eval()
115
117
  {
116
118
  std::vector<RTLIL::IdString> unary_ops = {
117
- ID($not), ID($pos), ID($neg),
119
+ ID($not), ID($pos), ID($buf), ID($neg),
118
120
  ID($reduce_and), ID($reduce_or), ID($reduce_xor), ID($reduce_xnor), ID($reduce_bool),
119
121
  ID($logic_not), ID($slice), ID($lut), ID($sop)
120
122
  };
@@ -325,7 +327,7 @@ struct CellTypes
325
327
 
326
328
  static RTLIL::Const eval_not(RTLIL::Const v)
327
329
  {
328
- for (auto &bit : v.bits)
330
+ for (auto &bit : v.bits())
329
331
  if (bit == State::S0) bit = State::S1;
330
332
  else if (bit == State::S1) bit = State::S0;
331
333
  return v;
@@ -339,7 +341,7 @@ struct CellTypes
339
341
  type = ID($shl);
340
342
 
341
343
  if (type != ID($sshr) && type != ID($sshl) && type != ID($shr) && type != ID($shl) && type != ID($shift) && type != ID($shiftx) &&
342
- type != ID($pos) && type != ID($neg) && type != ID($not)) {
344
+ type != ID($pos) && type != ID($buf) && type != ID($neg) && type != ID($not)) {
343
345
  if (!signed1 || !signed2)
344
346
  signed1 = false, signed2 = false;
345
347
  }
@@ -384,7 +386,7 @@ struct CellTypes
384
386
  HANDLE_CELL_TYPE(neg)
385
387
  #undef HANDLE_CELL_TYPE
386
388
 
387
- if (type == ID($_BUF_))
389
+ if (type.in(ID($_BUF_), ID($buf)))
388
390
  return arg1;
389
391
  if (type == ID($_NOT_))
390
392
  return eval_not(arg1);
@@ -419,13 +421,13 @@ struct CellTypes
419
421
  RTLIL::Const ret;
420
422
  int width = cell->parameters.at(ID::Y_WIDTH).as_int();
421
423
  int offset = cell->parameters.at(ID::OFFSET).as_int();
422
- ret.bits.insert(ret.bits.end(), arg1.bits.begin()+offset, arg1.bits.begin()+offset+width);
424
+ ret.bits().insert(ret.bits().end(), arg1.begin()+offset, arg1.begin()+offset+width);
423
425
  return ret;
424
426
  }
425
427
 
426
428
  if (cell->type == ID($concat)) {
427
429
  RTLIL::Const ret = arg1;
428
- ret.bits.insert(ret.bits.end(), arg2.bits.begin(), arg2.bits.end());
430
+ ret.bits().insert(ret.bits().end(), arg2.begin(), arg2.end());
429
431
  return ret;
430
432
  }
431
433
 
@@ -448,7 +450,7 @@ struct CellTypes
448
450
  {
449
451
  int width = cell->parameters.at(ID::WIDTH).as_int();
450
452
 
451
- std::vector<RTLIL::State> t = cell->parameters.at(ID::LUT).bits;
453
+ std::vector<RTLIL::State> t = cell->parameters.at(ID::LUT).to_bits();
452
454
  while (GetSize(t) < (1 << width))
453
455
  t.push_back(State::S0);
454
456
  t.resize(1 << width);
@@ -460,7 +462,7 @@ struct CellTypes
460
462
  {
461
463
  int width = cell->parameters.at(ID::WIDTH).as_int();
462
464
  int depth = cell->parameters.at(ID::DEPTH).as_int();
463
- std::vector<RTLIL::State> t = cell->parameters.at(ID::TABLE).bits;
465
+ std::vector<RTLIL::State> t = cell->parameters.at(ID::TABLE).to_bits();
464
466
 
465
467
  while (GetSize(t) < width*depth*2)
466
468
  t.push_back(State::S0);
@@ -473,7 +475,7 @@ struct CellTypes
473
475
  bool match_x = true;
474
476
 
475
477
  for (int j = 0; j < width; j++) {
476
- RTLIL::State a = arg1.bits.at(j);
478
+ RTLIL::State a = arg1.at(j);
477
479
  if (t.at(2*width*i + 2*j + 0) == State::S1) {
478
480
  if (a == State::S1) match_x = false;
479
481
  if (a != State::S0) match = false;
@@ -513,7 +515,7 @@ struct CellTypes
513
515
  if (cell->type == ID($_OAI3_))
514
516
  return eval_not(const_and(const_or(arg1, arg2, false, false, 1), arg3, false, false, 1));
515
517
 
516
- log_assert(arg3.bits.size() == 0);
518
+ log_assert(arg3.size() == 0);
517
519
  return eval(cell, arg1, arg2, errp);
518
520
  }
519
521
 
@@ -524,7 +526,7 @@ struct CellTypes
524
526
  if (cell->type == ID($_OAI4_))
525
527
  return eval_not(const_and(const_or(arg1, arg2, false, false, 1), const_or(arg3, arg4, false, false, 1), false, false, 1));
526
528
 
527
- log_assert(arg4.bits.size() == 0);
529
+ log_assert(arg4.size() == 0);
528
530
  return eval(cell, arg1, arg2, arg3, errp);
529
531
  }
530
532
  };
@@ -76,7 +76,7 @@ struct ConstEval
76
76
  #ifndef NDEBUG
77
77
  RTLIL::SigSpec current_val = values_map(sig);
78
78
  for (int i = 0; i < GetSize(current_val); i++)
79
- log_assert(current_val[i].wire != NULL || current_val[i] == value.bits[i]);
79
+ log_assert(current_val[i].wire != NULL || current_val[i] == value[i]);
80
80
  #endif
81
81
  values_map.add(sig, RTLIL::SigSpec(value));
82
82
  }
@@ -115,7 +115,7 @@ struct ConstEval
115
115
 
116
116
  for (int i = 0; i < GetSize(coval); i++) {
117
117
  carry = (sig_g[i] == State::S1) || (sig_p[i] == RTLIL::S1 && carry);
118
- coval.bits[i] = carry ? State::S1 : State::S0;
118
+ coval.bits()[i] = carry ? State::S1 : State::S0;
119
119
  }
120
120
 
121
121
  set(sig_co, coval);
@@ -153,7 +153,7 @@ struct ConstEval
153
153
 
154
154
  for (int i = 0; i < sig_s.size(); i++)
155
155
  {
156
- RTLIL::State s_bit = sig_s.extract(i, 1).as_const().bits.at(0);
156
+ RTLIL::State s_bit = sig_s.extract(i, 1).as_const().at(0);
157
157
  RTLIL::SigSpec b_slice = sig_b.extract(sig_y.size()*i, sig_y.size());
158
158
 
159
159
  if (s_bit == RTLIL::State::Sx || s_bit == RTLIL::State::S1)
@@ -180,10 +180,10 @@ struct ConstEval
180
180
 
181
181
  if (y_values.size() > 1)
182
182
  {
183
- std::vector<RTLIL::State> master_bits = y_values.at(0).bits;
183
+ std::vector<RTLIL::State> master_bits = y_values.at(0).to_bits();
184
184
 
185
185
  for (size_t i = 1; i < y_values.size(); i++) {
186
- std::vector<RTLIL::State> &slave_bits = y_values.at(i).bits;
186
+ std::vector<RTLIL::State> slave_bits = y_values.at(i).to_bits();
187
187
  log_assert(master_bits.size() == slave_bits.size());
188
188
  for (size_t j = 0; j < master_bits.size(); j++)
189
189
  if (master_bits[j] != slave_bits[j])
@@ -248,8 +248,8 @@ struct ConstEval
248
248
  RTLIL::Const val_x = const_or(t2, t3, false, false, width);
249
249
 
250
250
  for (int i = 0; i < GetSize(val_y); i++)
251
- if (val_y.bits[i] == RTLIL::Sx)
252
- val_x.bits[i] = RTLIL::Sx;
251
+ if (val_y[i] == RTLIL::Sx)
252
+ val_x.bits()[i] = RTLIL::Sx;
253
253
 
254
254
  set(sig_y, val_y);
255
255
  set(sig_x, val_x);
@@ -43,6 +43,7 @@ X(CE_OVER_SRST)
43
43
  X(CFG_ABITS)
44
44
  X(CFG_DBITS)
45
45
  X(CFG_INIT)
46
+ X(chain)
46
47
  X(CI)
47
48
  X(CLK)
48
49
  X(clkbuf_driver)
@@ -153,7 +154,6 @@ X(PORTID)
153
154
  X(PRIORITY)
154
155
  X(PRIORITY_MASK)
155
156
  X(Q)
156
- X(qwp_position)
157
157
  X(R)
158
158
  X(ram_block)
159
159
  X(ram_style)