Clang warns that "adding 'int' to a string does not append to the string".
Although a false positive it's trivially avoided by using the array index
equivalent &PREFIX[1].
icetime.cc: In member function ‘double TimingAnalysis::report(std::__cxx11::string)’:
icetime.cc:1095:15: warning: ‘last_time’ may be used uninitialized in this function [-Wmaybe-uninitialized]
fprintf(frpt, "%10.3f ns ..%7.3f ns %s\n", first_time, last_time, last_net.c_str());
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
icetime.cc:1095:15: warning: ‘first_time’ may be used uninitialized in this function [-Wmaybe-uninitialized]
This should reduce the memory requirement during build of icetime, not
trying to compile one huge file all at once
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
icetime.cc: In function ‘std::__cxx11::string ecnetname_to_vlog(std::__cxx11::string)’:
icetime.cc:1323:32: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
} catch(std::invalid_argument e) { // Not numeric and stoi throws exception
Like yosys and arachne-pnr, allow for searching for the desired chipdb
file relative to the executing binaries directory. This allows for
portable builds of icetime without needing to specify the exact path to
the needed chipdb file with the -C arg.
In order to support this icetime must be able to get the
"proc_self_dirname" path just like yosys and arachne-pnr. As such copy
the equivalent code to get this path information. To avoid cluttering
the icetime.cc file with this code, place it in a separate iceutil.cc
file.
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
icetime was reading the asc configuration file using a 128-byte line
buffer -- which is usually fine, but can cause it to truncate the names
of nets given in .sym lines if those names are very, very long. The way
fgets was being used meant this went undetected.
Long net names like this can arise in deeply hierarchical designs,
particularly if there's a code generator involved.
This change:
1. Increases the buffer size to 64kiB.
2. Adds a truncation check that causes icetime to fail.
A more robust solution would manage the line buffer on the heap, since
the symbol gets copied into a std::string anyway, but this is a
workaround for now.
used in $(PREFIX)/share/ to install the chip database. This provides a
mechanism to choose a directory different than icebox (default).
I.e. fpga-icestorm/chipdb for Debian.