Commit Graph
2128 Commits
Author SHA1 Message Date
Emil J. Tywoniak 108c134c32 proc_mux: separate a case's condition from its body
genrtlil records the case item as compare_src and the block as the case's
own src, so the actions inside a case point at the statements that wrote
them rather than at the selector. A $eq then stands for both sides of the
comparison it performs - the switch expression and the case value - the
$reduce_or over them for the case value, and the _CMP wire for the switch.
A mux passes its fused locations on to the wire it drives.

The gatemate fsm LUT counts go back to what they were before the source
work: the finer mapping restores the earlier covering.

Picks up the proc part of emil/twines-proc-srcloc-rebased:
  b2d57e5d4 rtlil: add case_src to CaseRule
  c74bc43cf proc_mux, genrtlil: make use of case_src
  9bc771e05 proc_mux: copy switch src to _CMP wire
  6182c7dd8 proc_mux: copy mux src to Y port
  3d2e26815 kernel: add SwitchRule signal_src
  cf3867bb1 proc_mux: include switch expression location in $eq src
2026-08-25 13:09:19 +02:00
Emil J. Tywoniak 16db584210 rtlil frontend: keep the handles a file names
A replayable .il names twines and source location sets by pool index, and
a design that has freed slots writes a set with gaps in it. Reading such a
file into a fresh design packed the survivors, so write, read, write did
not reproduce the file.

Let the pools intern at a caller-chosen index and use that while loading
into a design with no twines or srcs of its own, falling back to the old
remapping when the file's numbering does not fit this build.
2026-08-25 12:42:21 +02:00
Emil J. Tywoniak bb9f7f8abe proc: point cases and flops at the statements they came from
A CaseRule takes the location of its case item, so the $eq that decodes it
lands on the compare rather than on the block, and a mux keeps the fused
action locations it was given instead of inheriting the case's.

A flop fuses the process location with the locations of the wires it drives.
2026-08-25 12:42:12 +02:00
Emil J. Tywoniak d2b8491823 verific: use SyncActions
(cherry picked from commit 69691ef85db58a1ead3060361dc37d29b70b8095)
2026-08-25 12:41:46 +02:00
Emil J. Tywoniak 97ed58b914 rtlil: add source tracking to CaseRule actions
(cherry picked from commit 2301dad4ca7abe951faa9e0b8772c52d15f102a7)
2026-08-25 12:41:46 +02:00
Emil J. Tywoniak 9a93e377a3 rtlil: replace SigSig actions with new type SyncAction
(cherry picked from commit bfc098772c0244273ee52a8989168a6a6c0c89f2)
2026-08-25 12:41:46 +02:00
Emil J. Tywoniak ba74d22f6b rtlil: intern source locations in a per-design SrcPool
Source locations move off the attribute dict into a dedicated SrcRef on
AttrObject, interned in a per-design SrcPool that hash-conses sets of
location twines. Locations share their file prefix with each other through
the twine pool, and objects that fuse (opt_merge, share, ff/mem rewrites)
carry the union of their inputs' locations instead of a '|'-joined string.

write_rtlil emits an `srcs` section of location sets alongside `twines`;
read_rtlil resolves `\src "@N"` back to a handle and still accepts a plain
location string. -readable renders the locations as text.
2026-08-25 11:40:52 +02:00
Emil J. Tywoniak 1168e35394 twine: split Twine into in-memory TwineNode that doesn't support autoidx variants and temporary TwineSpec that does 2026-08-24 15:53:14 +02:00
Emil J. Tywoniak 6d1a911de2 frontends: use twine suffix nodes for hierarchical names, cache name lookups 2026-08-13 18:15:58 +02:00
Emil J. Tywoniak d8e0180ffb frontends: trivial twine damage 2026-08-13 18:15:58 +02:00
Emil J. Tywoniak 4a7a670fb6 kernel: reimplement IdString as handle on a Twine in a per-design TwinePool 2026-08-13 18:15:40 +02:00
nella 250a467518 Attr file:line. 2026-07-31 10:31:44 +02:00
nella 2b5755178f Clean up diagnostics. 2026-07-31 10:31:44 +02:00
Emil J. Tywoniak dfa887637a const2ast: handle constant parsing from the command-line again 2026-07-31 10:31:44 +02:00
Emil J. Tywoniak 5f5f8b99b1 liberty: cleanup 2026-07-30 16:44:12 +02:00
Emil J. Tywoniak ef69127001 liberty: refactor out constant bools 2026-07-28 16:39:08 +02:00
Emil J. Tywoniak db2b3a22e9 liberty: remove optimization to simplify control flow, fixing polarities in set&reset behavior modeling 2026-07-27 22:09:57 +02:00
Miodrag Milanovic eb3a15cd8c Update sv-elab to 3dddccd 2026-07-15 08:24:46 +02:00
Miodrag Milanovic 30ba4328e7 Use system libs when available 2026-07-13 15:26:00 +02:00
Michael Baier 8f0028652a long long to int truncation checks 2026-07-10 14:36:39 +02:00
Michael Baier eb4e29810e Fixed Overflow error in checking width 2026-07-09 14:34:56 +02:00
Michael Baier 42092cbc77 Adding width checks to frontend 2026-07-09 14:34:56 +02:00
Lofty 75286287c6 Merge pull request #5973 from YosysHQ/lofty/abc-refactor-7
Move rename logic to abc_ops_reintegrate
2026-07-09 08:46:46 +00:00
Martin Povišer ff8a867764 Bump sv-elab to 2026-07-07 2026-07-07 15:20:19 +02:00
Miodrag Milanovic 05c0adae77 Slang frontend integration 2026-07-06 15:49:56 +02:00
Miodrag Milanovic a689342207 Remove trailing whitespaces 2026-06-23 07:24:59 +02:00
Miodrag Milanovic 48a3dcc02a End of file fix 2026-06-23 07:23:41 +02:00
Lofty 091d2a7814 Move rename logic to abc_ops_reintegrate 2026-06-19 10:46:47 +01:00
nella 5d7486115a Merge pull request #5887 from YosysHQ/nella/fix-signedness-4402
Fix: `read_verilog` doesn't respect `signed` keyword
2026-06-18 16:53:37 +00:00
Krystine Sherwin b79c7c008d simplify.cc: Fix crash when identifier matches module
Also update one of the AST debug prints that is guarded by an `#if 0` but was out of date.
2026-06-12 11:54:53 +12:00
Lofty 73c217133b Merge pull request #5934 from YosysHQ/lofty/abc9-refactor-5
read_aiger: import standard-cell mappings from ABC
2026-06-08 09:38:34 +00:00
Lofty 2a4525efbb read_aiger: import standard-cell mappings from ABC 2026-06-05 11:02:58 +01:00
Miodrag Milanovic 102f008194 Remove EMSCRIPTEN leftovers 2026-06-05 10:03:27 +02:00
Miodrag Milanovic 5f2456ac03 WASI now support filesystem 2026-06-05 09:18:00 +02:00
Miodrag Milanović 693d5a7eb0 Merge pull request #5903 from YosysHQ/krys/verific_memsize
verific: Fix non-contiguous memory flattening producing out of bounds accesses in some cases
2026-06-04 05:43:04 +00:00
Miodrag MilanovicandCatherine ce280354cf Update CI scripts for CMake
Co-authored-by: Catherine <[email protected]>
2026-06-03 08:58:11 +00:00
Catherine a727e7f6e7 Migrate build system to CMake
See #5895 for details.

This commit does not include CI or documentation changes.
2026-06-03 08:58:10 +00:00
Emil J. Tywoniak 80bdbaa010 genrtlil: don't avoid emitting flops for nosync 2026-05-29 11:37:08 +02:00
Krystine Sherwin 5f53410db7 verific: Fix negative array dimensions
Recurse over memory dimensions once, doing both our min/max address checking and parsing out the initval.  This also avoids problems with negative numbers (if `a < b` and one or both are negative, `a` might be the intended `max_addr_chunk`).
Fix sub addressing, where we use some but not all of the current dimension's bits.
2026-05-29 18:40:25 +12:00
Krystine Sherwin 21966ef496 verific: Fix non-contiguous memory init
Recurse over nested type ranges to calculate true addresses.
2026-05-29 18:40:25 +12:00
Krystine Sherwin 099c664dc9 verific: Fix upto ranges 2026-05-29 18:40:23 +12:00
Krystine Sherwin 7cf0c55466 verific: Fix non-contiguous memory flattening
May not be the best approach, insofar as it uses empty memory elements for padding out the alignment, but it does avoid costly address arithmetic.
Still needs to adjust ascii init val addresses, but should work fine for read/write accesses.
2026-05-29 18:40:23 +12:00
Miodrag Milanovic 75dcbe03c6 Convert RTLIL::unescape_id of IdString to unescape() 2026-05-16 19:49:45 +02:00
Miodrag Milanovic 8bbc3c359c Remove id2cstr uses in our code base 2026-05-16 19:49:45 +02:00
Miodrag Milanovic 4a7878b17f Fixing couple more conversion errors 2026-05-14 15:58:58 +02:00
Miodrag Milanovic 9580ebabc5 log_id here was needed for unescaping 2026-05-14 12:35:01 +02:00
nella 38c2806636 Make sure to apply correct signedness to loop vars. 2026-05-13 16:52:07 +02:00
Codexplorer e41b969da2 Refactored uses of log_id() 2026-05-08 20:59:24 -07:00
Christopher D. Leary 390f09b89a Support positional assignment patterns for unpacked arrays 2026-04-23 14:29:38 -07:00
Petter Reinholdtsen a89e8fd869 Fixed spelling error in message of frontends/ast/genrtlil.cc.
Patch by Ruben Undheim via the Debian project.  The patch originated
as 0009-Some-spelling-errors-fixed.patch and was dated 2018-07-12
there.

See also issue #5805.
2026-04-22 04:30:18 +02:00