Commit Graph
2677 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 dcb9c0d7af rtlil: track where a case is selected and where a switch reads
A CaseRule's own src is where its body is; compare_src is where the case
is selected. A SwitchRule's own src is the whole statement; signal_src is
where its expression is. Both survive a clone and a cross-pool copy.

Also root the srcs a process holds outside its AttrObjects - one per
assignment, plus the two above - so garbage collection cannot free the
twines they point at.
2026-08-25 13:09:07 +02:00
Emil J. Tywoniak 325018641a proc_dff: add wire src attributes to dff cells
(cherry picked from commit cabee65438796a05d938a8abe5aa8e6be9774b32)
2026-08-25 12:41:46 +02:00
Emil J. Tywoniak 6a7ca7a7e7 proc_mux: add src test
(cherry picked from commit 4fe8986fc5e56c345a74dfeee7839a57661c74d5)
2026-08-25 12:41:46 +02:00
Emil J. Tywoniak 45cc333e76 gowin: lower LUT count sensitivity
(cherry picked from commit c1d8aa8ae9fbefbc018c4c29dcaeef79a35f1211)
2026-08-25 12:41:46 +02:00
Emil J. Tywoniak 490f9e5e31 tests: cover source location pooling
roundtrip-src.sh checks that an `srcs` section survives write/read and a
design push/pop unchanged, and that -readable resolves the handles.
no-pipe-leaf.sh checks that fusing locations never bakes a '|'-joined
string into a twine leaf.
2026-08-25 11:40:59 +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 7dfc30db11 pyosys: twines 2026-08-13 18:15:58 +02:00
Emil J. Tywoniak f7d1a491d7 tests: cover twines, name publicity, hashing and sorting 2026-08-13 18:15:58 +02:00
Emil J. Tywoniak 5088e8f6ed tests: trivial twine damage 2026-08-13 18:15:58 +02:00
nella 7bbb69872c Add regression tests. 2026-08-06 09:14:44 +02:00
Emil J 72ce1b63d7 Merge pull request #6090 from YosysHQ/emil/hierarchy-fix-keep-cache-again
hierarchy: fix keep cache usage by caching false too 2
2026-08-05 21:54:55 +00:00
Emil J. Tywoniak 253388a87f hierarchy: fix cache usage by caching false too 2 2026-08-05 23:32:37 +02:00
Catherine f26ef15b2a Revert "hierarchy: regression test for keep cache"
This reverts commit a27378cff8.
2026-08-05 16:52:59 +00:00
nella f2cf07584d Improve test coverage. 2026-08-05 12:57:56 +02:00
nella eff7e1f360 Budget SAT effort via shared SatEffortBudget. 2026-08-05 12:57:56 +02:00
nella 8d712e6b79 Add SAT effort test. 2026-08-05 12:57:56 +02:00
Miodrag Milanovic ebf286ab40 Code cleanup 2026-08-04 17:18:22 +02:00
Emil J 468ba27d91 Merge pull request #6078 from YosysHQ/emil/hierarchy-fix-keep-cache
hierarchy: fix keep cache usage by caching false too
2026-08-03 15:54:50 +00:00
Emil J. Tywoniak a27378cff8 hierarchy: regression test for keep cache 2026-08-03 17:36:49 +02:00
nella abe32c86a0 Merge 'origin/main' into emil/muxpack-fix-chain. 2026-08-03 11:50:21 +02:00
nella 4baff94575 Add nesting test. 2026-07-31 10:31:44 +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
Krystine Sherwin bafaa2e95c tests/alumacc: Use assert-max 2026-07-31 16:59:58 +12:00
Krystine Sherwin 9edae972af tests/alumacc: Add broad merge test
Mixes input cells, signedness, input width, output width.
Within the things that are `random.choice`, they *should* always be equivalent, but add a seed arg anyway just in case one day they're not.
2026-07-31 16:59:58 +12:00
Krystine Sherwin fb560a560f tests/alumacc: Minor optimizations 2026-07-31 16:59:57 +12:00
Krystine Sherwin 1b9caf4f2c tests/alumacc: Move opt/temp/alumacc
Because apparently there's a whole `tests/alumacc` folder.
2026-07-31 16:59:57 +12:00
Krystine Sherwin b49f321923 tests/opt: Add extra alumacc test
Checks equivalence when folding an `$lt` (or equivalently a `$gt`) into a `$sub`.
Currently failing, fix incoming.
2026-07-31 16:59:56 +12:00
Miodrag Milanović 5c15b0b5a1 Merge pull request #6071 from YosysHQ/mmicko/test_disable
nexus: disable dsp test, takes very long
2026-07-30 16:34:15 +00:00
Miodrag Milanovic 130e39b06d nexus: disable dsp test, takes very long 2026-07-30 17:46:25 +02:00
Emil J c03bbc3309 Merge pull request #6069 from YosysHQ/emil/liberty-flop-fix-polarity
read_liberty: fix set&reset polarity
2026-07-30 15:34:24 +00:00
Emil J. Tywoniak 5f5f8b99b1 liberty: cleanup 2026-07-30 16:44:12 +02:00
nella c1377426c9 Merge branch 'main' into nella/fuse-2 2026-07-29 01:41:37 +02:00
Emil J. Tywoniak 82914a0204 dfflibmap: error on wide registers in design 2026-07-27 22:24:28 +02:00
Emil J. Tywoniak c50290fdab dfflibmap: fix formal verilog test so that it actually maps all flops 2026-07-27 22:08:39 +02:00
Emil J. Tywoniak 1a1d9494da dfflibmap: check formal verilog test actually maps all flops 2026-07-27 22:06:22 +02:00
Emil J 5d2fbf8187 Merge pull request #5961 from YosysHQ/emil/opt_muxtree-fix-reconvergence
opt_muxtree: fix reconvergence
2026-07-27 09:08:13 +00:00
nella 511017acc1 Merge branch 'main' into nella/fuse-2 2026-07-24 12:20:35 +02:00
nella 5e59deecc3 Fix test desc. 2026-07-24 12:07:10 +02:00
nella 7defa51862 Merge pull request #6007 from YosysHQ/nella/fix-shift-fold
Fix wide shift count folded as truncated/signed negative count
2026-07-24 08:17:11 +00:00
Krystine Sherwin 29a6295d7c tests/opt: Fix comments 2026-07-23 14:59:12 +12:00
Miodrag Milanović bc14cd7d18 Merge pull request #6062 from YosysHQ/mmicko/tests_only
Add dependencies to gtests
2026-07-22 13:39:05 +00:00
Miodrag Milanovic 5574994453 Add dependencies to gtests 2026-07-22 15:03:12 +02:00
drewbabel 3006280d70 xilinx_srl: keep the clock enable on FDRE shift registers
run_fixed inferred a fixed length shift register from a chain of FDRE
flops but assigned it ENPOL 2, which the cells_map template reads as no
enable and ties the enable high. FDRE has an active high clock enable, so
the shift register shifted every cycle and ignored stalls. Give FDRE and
FDRE_1 chains ENPOL 1 so the active high enable is kept.

Add tests/arch/xilinx/xilinx_srl_enable.ys covering the FDRE path.
2026-07-20 23:59:40 -07:00
Miodrag Milanović e2c27aaafa Merge pull request #6042 from YosysHQ/krys/symfpu
Add `symfpu` pass
2026-07-20 10:20:23 +00:00
Emil J 5f29546d80 Merge pull request #6050 from YosysHQ/emil/autoname-rewrite
autoname: rewrite
2026-07-19 22:10:02 +00:00
Emil J. Tywoniak 8565451ef9 autoname: selection determines what gets renamed, not the name it gets renamed to 2026-07-17 22:48:46 +02:00
Emil J. Tywoniak fb0bb160ad autoname: rewrite 2026-07-17 12:02:43 +02:00