mirror of https://github.com/YosysHQ/icestorm.git
On Windows, attempting to generate a netpbm image of the CRAM with `icepack -b` causes the tool to crash after writing only the netpbm header due to a stack overflow. The bug did not appear on Linux. This was traced to a large stack-allocated variable length array (`tile_type`) inside `FpgaConfig::write_cram_pbm`. For an 8k ice40 with 4 banks, `cram_width = 872` and `cram_height = 272` the `tile_type` array ends up at `4 * 872 * 272 * sizeof(uint32_t) =` 3794944 bytes, or about 3.6 MiB. The fix replaces the large stack VLA with an array of 4 (bank) 2D C++ vectors, moving the large amount of data to the heap. Even though the fix is not in a Windows-specific code path (and hence applies to all platforms), I think it's wise to eliminate such a large stack allocation entirely. The fix has been tested working on both Windows and an Ubuntu WSL install. |
||
|---|---|---|
| docs | ||
| examples | ||
| icebox | ||
| icebram | ||
| icecompr | ||
| icefuzz | ||
| icemulti | ||
| icepack | ||
| icepll | ||
| iceprog | ||
| icetime | ||
| .gitignore | ||
| COPYING | ||
| CodeOfConduct | ||
| Makefile | ||
| README | ||
| config.mk | ||
README
Project IceStorm aims at documenting the bitstream format of Lattice iCE40 FPGAs and providing simple tools for analyzing and creating bitstream files. See http://www.clifford.at/icestorm/ for more information. Most of Project IceStorm is licensed under the ISC license: # 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.