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
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.
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.
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.
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.
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.
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.