-
Notifications
You must be signed in to change notification settings - Fork 1k
proc_mux: use assignment action locations for mux src #5456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
whitequark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe there is a use case where a user would like to print out RTLIL with processes in it and actually do anything with it.
Amaranth emits RTLIL with processes in it and would emit fine-grained src attributes if it was available. This functionality should be preserved in textual RTLIL.
|
Oh, I thought Amaranth was emitting flops to avoid |
Amaranth still uses processes for decision trees (and there is no reasonable way of avoiding that; we are not going to implement We run |
Synthesis users often aim try to reduce the FPGA resource usage or chip area by tracking down what in their designs is causing cells to be emitted by looking at the src attributes Yosys emits. Prior to this PR, the multiplexers created by
proc_muxto select the correct values from cases of Verilog switches would be labeled with the source range of the entire switch together with the source range of the entire case (see Note 1). After this PR, the src attribute for such a multiplexer covers exactly the assignments that it implements.To do this, I'm introducing "RTLIL" state that can't be roundtripped through textual RTLIL, specifically, the
Const srcfield of the newstruct SyncAction. Generally theprocpasses are considered inseparable fromread_verilog,procconvertsProcesses into cells. I don't believe there is a use case where a user would like to print out RTLIL with processes in it and actually do anything with it. OpenROAD flow scripts does write out canonical pre-synthesis RTLIL but running proc ahead of this seems to be a valid change (see Note 2). If it's attempted, the RTLIL backend has a warning that action sources will be lost. When they are lost, the case src range is used, which I consider still an upgade over the current state of things. I'm also open to alternative approaches.Before undrafting:
proc_muxworksNote 1: Also the latter of which was referring only to the end of the case. For example, the
$pmuxatmodule tiny2from the includedtests/proc/proc_mux_src.v.Note 2: See https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/b2918bafbddf77a231fdd5c530cf9d72c1737199/flow/scripts/synth_canonicalize.tcl which refers to https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/b2918bafbddf77a231fdd5c530cf9d72c1737199/flow/scripts/synth_preamble.tcl