3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00
Commit graph

1624 commits

Author SHA1 Message Date
Krystine Sherwin
1a3f6c9d50
test_cell: Support more cell types
Still unsupported:
- x-prop cells ($eqx, $nex, $bweqx)
- wide muxes (`$_MUX16_` and friends)
- $pmux

Partially supported:
- $bwmux is not supported in `ConstEval::eval()`, works with `-noeval`
- $buf has no mapping in techmap.v so is unusable with `techmap -assert` (i.e. the default)
- $pow has `_TECHMAP_FAIL_` in techmap.v, `-simlib` works for some iterations but fails for others, `-aigmap` works fine

Fix `CellTypes::eval() for `$_NMUX_`.
Fix `RTLIL::Cell::fixup_parameters()` for $concat and $bwmux.
2025-03-31 16:24:40 +13:00
Krystine Sherwin
e7cfb0381c
Celltypes: Revert c++20 feature
Turns out using designated initializers is c++20, so not available while we are still c++17 friendly.
2025-03-01 11:25:25 +13:00
Krystine Sherwin
9117926157
celltypes: Reword synthesizable comment
Don't mention verilog.
2025-03-01 11:23:13 +13:00
Krystine Sherwin
82ae46dfeb
celltypes: Add help -celltypes
Like `help -cells` but instead of printing the cell's ports, prints its flags.
2025-03-01 10:52:29 +13:00
Krystine Sherwin
647ea922f1
celltypes: Extra type props
Now with `is_internal`, `is_metainfo`, and `has_effects`.
Each type property has a comment specifying usage/meaning.
Type properties (sans `is_internal`) get a default value of false.
`CellTypes::setup_*_type()` methods get their own `CellType` struct assignments with named fields being assigned true to improve readability.
2025-02-25 13:40:51 +13:00
Krystine Sherwin
4883c503a8
celltypes: get_cell() helper
Add `CellTypes::get_cell()` which takes a 'type' `IdString` and returns the corresponding `CellType` if it is in the `cell_types` dict, otherwise returns `nullptr`.
Useful for getting a cell type by name and then checking its attributes.
2025-02-21 16:10:51 +13:00
Krystine Sherwin
c1665ab416
celltypes: Add and use setup_type helpers
Add `CellTypes::setup_{comb, ff, formal}_type()`.  Most of the existing internal cells fit into one of these three groups.
2025-02-21 16:08:53 +13:00
Krystine Sherwin
e6c3a7e87f
celltypes: add builtin_ff and formal 2025-02-21 16:05:53 +13:00
KrystalDelusion
31b00b4c72
celledges: Use b_width_capped for left shifts
`b_width_capped` already exists for preventing arithmetic overflow, limiting the value of `b_width` to 30.  This just changes the left shifts to also use it.
The caveat of incorrect results for extremely large values of `a_width` still applies, as does the improbability of that actually happening.
This fixes #4844 (or at least, the floating point exception; the circuit still isn't valid but I think that's fine).
2025-01-31 11:03:33 +13:00
Emil J
da5c20dcfb
Merge pull request #4849 from YosysHQ/emil/hashlib-merge-top-ops
hashlib: merge hash_ops with hash_top_ops for plugin compat
2025-01-21 12:09:27 +01:00
Miodrag Milanovic
d50849ea83 Copyright year update 2025-01-21 08:48:29 +01:00
Emil J. Tywoniak
aa01ef3312 hashlib: simplify loopback. NFC 2025-01-20 16:15:48 +01:00
N. Engelhardt
a5ba1d2eba fix bugs in handling last id in hdlname to scopename conversion 2025-01-16 12:57:08 +01:00
N. Engelhardt
17d45796a6 ModuleHdlnameIndex: handle objects with private name and hdlname attribute 2025-01-15 15:50:10 +01:00
Emil J. Tywoniak
901935fbce hashlib: merge hash_ops with hash_top_ops for plugin compat 2025-01-14 21:41:33 +01:00
Emil J. Tywoniak
4dbef95792 mark all hash_top methods nodiscard 2025-01-14 12:48:59 +01:00
Emil J. Tywoniak
a58481e9b7 mark all hash_into methods nodiscard 2025-01-14 12:39:15 +01:00
Emil J. Tywoniak
a2805b15c9 hashlib: fix hash_obj_ops discarding hash value 2025-01-14 12:36:24 +01:00
Martin Povišer
ca0ace66bc
Merge pull request #4817 from povik/macc_v2-1
macc: Stop using the B port
2025-01-08 14:42:51 +01:00
Martin Povišer
652a1b9806 macc: Stop using the B port
The B port is for single-bit summands. These can just as well be
represented as an additional summand on the A port (which supports
summands of arbitrary width). An upcoming `$macc_v2` cell won't be
special-casing single-bit summands in any way.

In preparation, make the following changes:

 * remove the `bit_ports` field from the `Macc` helper (instead add any
   single-bit summands to `ports` next to other summands)

 * leave `B` empty on cells emitted from `Macc::to_cell`
2025-01-08 13:03:35 +01:00
mikesinouye
de9cb5a60c
Remove spurious prime 2025-01-02 11:05:30 -08:00
mikesinouye
1ae0d8432f
Approximately double the max hash table size 2025-01-02 08:59:11 -08:00
Emil J
8fd40942e9
Merge pull request #4825 from YosysHQ/emil/fix-gcc-error-directive
yosys_common: fix gcc warning in #error directive
2024-12-19 16:29:03 +01:00
Emil J. Tywoniak
cea5326229 yosys_common: fix gcc warning in #error directive 2024-12-19 15:55:51 +01:00
Emil J. Tywoniak
a6bd8ff3e5 yw: fix unintensional recursion in hash_into 2024-12-19 11:47:34 +01:00
Emil J. Tywoniak
026e9dae9d hashlib: fixes from jix 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
ed70038aa1 hashlib: fixes from jix 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
b9b9515bb0 hashlib: hash_eat -> hash_into 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
0a525f38c2 hashlib: declare YS_HASHING_VERSION = 1 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
1df8a3e64b hashlib: legacy mkhash_add -> djb2_add 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
4e29ec1854 hashlib: acc -> eat 2024-12-18 15:09:25 +01:00
Emil J. Tywoniak
79acc141d5 hashlib: add deprecated mkhash function to prevent plugin breakage 2024-12-18 14:58:53 +01:00
Emil J. Tywoniak
ad0dc17711 docs: document the ideas behind the hashing interface 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
0dafe06cd4 hashlib: run_hash uses hash_top_ops, not hash_ops 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
02a578365a hashlib: remove is_new from HasherDJB32, implement hash_top for IdString 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
704a58ab21 hashlib: restore hash_obj_ops for pointers to indexed types 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
52b0fc03b7 hash: solo hashing interface, override for SigBit 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
b7991ed1f5 hashlib: prevent naive hashing of IdString when hashing SigBit 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
4d14399749 hashlib: allow forcing Hasher state, use it for IdString trivial hashing 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
c1af19fabc hashlib: don't xorshift in between upper and lower word 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
209ab6fb72 hashlib: fudge always 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
582259f770 hashlib: hash_t can be set to 64-bit 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
b8738e2bd7 hashlib: use hash_t across the board 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
c73c88033d hashlib: only include in one place 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
db04788c18 hashlib: fix pyosys 2024-12-18 14:58:31 +01:00
Emil J. Tywoniak
953508f6d2 driver: add --hash-seed 2024-12-18 14:58:29 +01:00
Emil J. Tywoniak
d071489ab1 hashlib: redo interface for flexibility 2024-12-18 14:49:25 +01:00
Martin Povišer
1f718e3ab6 kernel: Remove global tcl.h include
In commit ac988cf we made sure to undefine the CONST/VOID macros left
defined by `tcl.h`, but this in turn makes it an issue to include
additional Tcl headers later on (see issue #4808).

One way out is to avoid a global `tcl.h` include. In the process we drop
support for Tcl-enabled MXE builds, which were likely broken anyway due
to the additional Tcl APIs used from `tclapi.cc`.
2024-12-10 13:49:08 +01:00
Martin Povišer
b0708a38bf
Merge pull request #4678 from povik/tcl-rtlil-api
Start Tcl design inspection methods
2024-12-09 15:44:58 +01:00
N. Engelhardt
2a744b4b82 add hash method to scopeindex cursor 2024-12-06 11:18:39 +01:00