siliconcompiler / zerosoc

Demo SoC for SiliconCompiler.
52 stars 8 forks source link

Reduce FPGA resource utilization #1

Open nmoroze opened 3 years ago

nmoroze commented 3 years ago

As of a94be4c, the ZeroSoC design barely fits on the iCE40UP5k FPGA I'm using for testing (on an Icebreaker dev board). We want to add additional modules, and the high utilization is also making it difficult to get good timing results (the critical path is ~8 MHz, which seems very slow to me). Therefore, optimizing resource utilization for the current design to get more headroom seems important.

The current resource utilization, as reported by NextPNR, is as follows (with unused resources omitted):

   ICESTORM_LC:  5037/ 5280    95%
  ICESTORM_RAM:    20/   30    66%
         SB_IO:    12/   96    12%
         SB_GB:     6/    8    75%
ICESTORM_HFOSC:     1/    1   100%

I summarized a coarse-grained resource utilization by module (as reported by Yosys, using a ( keep_hierarchy ) attribute added to all modules instantiated in the top-level, as well as large submodules in the Ibex core), in this file: stats.txt

Some things that stand out looking at these results:

nmoroze commented 3 years ago

Actually, looks like Yosys does infer block RAM for the FPGA-optimized register file, but only when it's flattened into the design. My measurement approach didn't really give a correct picture since it involved disabling this flattening.