Skip to content
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

dump: add --sorted flag #5003

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

dump: add --sorted flag #5003

wants to merge 1 commit into from

Conversation

widlarizer
Copy link
Collaborator

This is helpful for diffs when roundtripping. The sort is somewhat imperfect as sorting the connections uses SigSpec operator< which doesn't result in a nice ordering. However, this comes into play only if the connections aren't equivalent, like here:
image
Therefore for getting a nice diff to check total complete equivalence excluding ordering even though opt_clean reordered your design (#3426) this is is still useful

@widlarizer
Copy link
Collaborator Author

Simplified repro for the above example:

module alu(
	input [7:0] A,
	input [7:0] B,
	output [7:0] result,
);
	assign result = A + B;
	wire [1:0] p1, p2;
	assign p1 = 2'bx1;
	assign p2[0] = 1'b1;
endmodule
read_verilog add.v
proc
dump --sorted -o before.il
bufnorm -nomode -buf
simplemap t:$buf t:$concat %u t:$slice %u
dump --sorted -o after.il

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant