Open cr1901 opened 3 years ago
I am hitting something similiar with a nmigen design that produces ~200k lines of rtlil. Maybe this helps? mipi_demo.zip
I have a some simple optimizations which look promising. I'll have them pushed soon.
Thanks Zach! I'm sure there is lots of room for improvement... For context, autoname was something Claire threw together quickly to help me debug something where I needed to trace where signals came from rather late in the flow (I don't really remember the details anymore). It was immediately obvious that it didn't scale well, but it did seem useful enough to have around. That's why it was only put in synth_ice40 and none of the other flows; we figured ice40 designs would be small enough not to run into performance problems (it seems we were wrong on that guess!)
That's why it was only put in synth_ice40 and none of the other flows
hm... it seems to be enabled for ecp5 too nowdays? Is that intentional?
@zachjs thanks a lot :):)
william@xubuntu-dtrain:~/Projects/FPGA/litex/litex-boards/autoname$ yosys autoname.ys
/----------------------------------------------------------------------------\
| |
| yosys -- Yosys Open SYnthesis Suite |
| |
| Copyright (C) 2012 - 2020 Claire Wolf <claire@symbioticeda.com> |
| |
| Permission to use, copy, modify, and/or distribute this software for any |
| purpose with or without fee is hereby granted, provided that the above |
| copyright notice and this permission notice appear in all copies. |
| |
| THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| |
\----------------------------------------------------------------------------/
Yosys 0.9+4081 (git sha1 2e697f565, sccache gcc 9.3.0-17ubuntu1~20.04 -fPIC -Os)
-- Executing script file `autoname.ys' --
1. Executing RTLIL frontend.
Input filename: ./autoname.il
2. Executing AUTONAME pass.
Renamed 2406431 objects in module gsd_orangecrab (490 iterations).
<suppressed ~61189 debug messages>
End of script. Logfile hash: 018655bf6d, CPU: user 22.74s system 0.37s, MEM: 716.26 MB peak
Yosys 0.9+4081 (git sha1 2e697f565, sccache gcc 9.3.0-17ubuntu1~20.04 -fPIC -Os)
Time spent: 93% 1x autoname (21 sec), 6% 2x read_ilang (1 sec)
Even these few changes are much better, thanks @zachjs! And this is just the low-hanging fruit?
Steps to reproduce the issue
When specifically trying to synthesize a Microwatt CPU SoC using
yosys
, I've noticed that theautoname
pass takes an unusual amount of memory that I can't seem to duplicate with other designs. Microwatt is a large CPU, and while I can't easily synthesize another SoC quite as big as that one at present, I've noticed that a SoC about half the size uses 1/4 of the memory, andautoname
is not where the most time is spent.Here is an example run of
yosys
trying to synthesize the Microwatt CPU usingghdl-yosys-plugin
:The bulk of the time is spent in
autoname
, andyosys
takes nearly5GB
to run to completion.By comparison, a Linux RISCV SoC about half the size in LUT usage takes between 1/4-1/3 of the memory, and
autoname
is not in the top two passes where time was spent (so less than 20 seconds):To duplicate, I've included an "M"VCE of the RTLIL of the Microwatt SoC; run
yosys autoname.il
to duplicate: autoname.zipExpected behavior
I would not expect a design twice as big to take nearly 4 times as much memory for the
autoname
pass to run, nor be where the bulk of time is spent in a design.Actual behavior
autoname
takes a long time to run and a large amount of memory. I'm opening this issue because I want to know ifautoname
memory usage is a quirk ofghdl-yosys-plugin
that can be avoided/fixed, and/orautoname
is working as intended. I noticed that that the Linux RISCV SoC has approximately 1/3 of the "objects" toautoname
as the Microwatt SoC, so maybeautoname
's memory usage is linear w/ the number of objects?