Commit Graph

427 Commits

Author SHA1 Message Date
Rupert Swarbrick 061d1f0c07 Minor optimisations in select.cc's match_ids function
- Pass a string argument by reference

  - Avoid multiple calls to IdString::str and IdString::c_str

  - Avoid combining checks for size > 0 and first char (C strings are
    null terminated, so foo[0] != '\0' implies that foo has positive
    length)
2020-05-27 09:36:33 +01:00
Rupert Swarbrick 0d9beb5b2e Silence warning in select.cc
With GCC 9.3, at least, compiling select.cc spits out a warning about
an implausible bound being passed to strncmp. This comes from inlining
IdString::compare(): it turns out that passing std::string::npos as a
bound to strncmp triggers it.

This patch replaces the compare call with a memcmp with the same
effect. The repeated calls to IdString::c_str are slightly
inefficient, but I'll address that in a follow-up commit.
2020-05-27 09:34:15 +01:00
Alberto Gonzalez 8297afe925
log: Use `dict` instead of `std::vector<std::pair>` for `log_expect_{error, warning, log}` to better express the intent that each element is unique. 2020-05-15 00:55:32 +00:00
Eddie Hung 425867d175 logger: clean up doc 2020-05-14 10:38:31 -07:00
Eddie Hung 65395168a0 logger: fix for multiple calls with same pattern 2020-05-14 10:32:07 -07:00
whitequark b43c282e4e Add WASI platform support.
This includes the following significant changes:
  * Patching ezsat and minisat to disable resource limiting code
    on WASM/WASI, since the POSIX functions they use are unavailable.
  * Adding a new definition, YOSYS_DISABLE_SPAWN, present if platform
    does not support spawning subprocesses (i.e. Emscripten or WASI).
    This definition hides the definition of `run_command()`.
  * Adding a new Makefile flag, DISABLE_SPAWN, present in the same
    condition. This flag disables all passes that require spawning
    subprocesses for their function.
2020-04-30 18:56:25 +00:00
Eddie Hung 56dd036b97 bugpoint: improve messaging 2020-04-24 13:41:19 -07:00
Eddie Hung e602184856 bugpoint: (* keep *) to (* bugpoint_keep *); also apply to modules/cells 2020-04-24 13:26:04 -07:00
Eddie Hung 4bfe6ebea9 bugpoint: skip ports with (* keep *) on; add header 2020-04-24 11:17:09 -07:00
Eddie Hung bf021a0e1f bugpoint: improve help text 2020-04-23 12:16:55 -07:00
Eddie Hung fa9df06c9d
Merge pull request #1949 from YosysHQ/eddie/select_blackbox
select: do not select inside black-/white- boxes unless '=' prefix used
2020-04-22 15:35:05 -07:00
Claire Wolf beb9e4b299
Update passes/cmds/select.cc
Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
2020-04-22 21:31:32 +02:00
Eddie Hung eaa5a3e786 select: do not select black/white boxes by default, '=' prefix to do so 2020-04-22 10:15:56 -07:00
Eddie Hung 28623f19ee
Merge pull request #1950 from YosysHQ/eddie/design_import
design: -import to not count black/white-boxes as candidates for top
2020-04-22 09:32:13 -07:00
Marcelina Kościelnicka cd82afb740 bugpoint: Don't remove modules or cells while iterating over them.
Reported by @ZirconiumX.
2020-04-22 00:09:01 +02:00
Claire Wolf d834cc7afb Add '=' selection pattern prefix for non-blackbox only patterns
Signed-off-by: Claire Wolf <claire@symbioticeda.com>
2020-04-21 14:23:24 +02:00
whitequark f2064c8131
Merge pull request #1888 from boqwxp/cleanup_scatter
Clean up `passes/cmds/scatter.cc`.
2020-04-17 02:21:23 +00:00
whitequark 5c428996a9
Merge pull request #1882 from boqwxp/cleanup_rename
Clean up pseudo-private member usage in `passes/cmds/rename.cc`.
2020-04-17 02:20:54 +00:00
Eddie Hung dac5adde12 design: -import to not count black/white-boxes as candidates for top 2020-04-16 12:46:07 -07:00
Eddie Hung 47c8ee7fe4 select: do not select inside blackboxes 2020-04-16 12:23:34 -07:00
Alberto Gonzalez 2e3647f567
Use `dict` instead of `std::map`.
Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
2020-04-16 18:56:50 +00:00
Alberto Gonzalez b94f38295a
Revert to `stringf()` rather than stringstreams. 2020-04-16 18:56:50 +00:00
Alberto Gonzalez 6081c1bbd3
Clean up pseudo-private member usage in `passes/cmds/rename.cc`. 2020-04-16 18:56:50 +00:00
Alberto Gonzalez ff8be2364e
Replace `std::map` with `dict`.
Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
2020-04-16 18:49:55 +00:00
Alberto Gonzalez 0424555702
Replace pseudo-private member access to `connections_` in `passes/cmds/scatter.cc`.
Co-Authored-By: N. Engelhardt <nak@symbioticeda.com>
2020-04-16 18:49:55 +00:00
Alberto Gonzalez 0787af947f
Clean up `passes/cmds/scatter.cc`. 2020-04-16 18:49:55 +00:00
Eddie Hung 254d38ca67 select: add select -unset option 2020-04-16 10:51:58 -07:00
Eddie Hung 8d3f6d0d79
Merge pull request #1928 from YosysHQ/eddie/design_delete
kernel: add design -delete option
2020-04-16 10:51:09 -07:00
Eddie Hung aa552cefa3
Merge pull request #1927 from YosysHQ/eddie/design_remove_assert
kernel: Design::remove(RTLIL::Module *) to check refcount_modules_
2020-04-16 08:06:12 -07:00
Eddie Hung a9ec0defb9 kernel: add design -delete option 2020-04-16 08:05:18 -07:00
Marcelina Kościelnicka d7da491002 setundef: Improve error messages.
Fixes #1092.
2020-04-15 16:13:28 +02:00
Eddie Hung 75bb2c8c24 design: do not delete when iterating over Design::modules() directly 2020-04-14 10:43:05 -07:00
Marcelina Kościelnicka 516857f3ba [NFCI] Deduplicate builtin FF cell types list
A few passes included the same list of FF cell types.  Make it a global
const instead.

The zinit pass also seems to include a list like that, but given that
it seems to be completely broken at the time (see #1568 discussion),
I'm going to pretend I didn't see that.
2020-04-09 18:05:06 +02:00
whitequark 42e7e44207
Merge pull request #1857 from whitequark/splitnets-skip-processes
splitnets: skip modules with processes
2020-04-09 04:03:30 +00:00
Alberto Gonzalez 64a5936bd7
Clean up `passes/cmds/connect.cc`. 2020-04-08 22:11:06 +00:00
whitequark b350398c04
Merge pull request #1874 from boqwxp/cleanup_show
Clean up `passes/cmds/show.cc`.
2020-04-06 18:32:20 +00:00
Alberto Gonzalez f4346a0400
Use more descriptive variable name.
Co-Authored-By: whitequark <whitequark@whitequark.org>
2020-04-06 14:48:27 +00:00
whitequark ebf23cd62e
Merge pull request #1870 from boqwxp/cleanup_setattr
Clean up `passes/cmds/setattr.cc`.
2020-04-06 11:04:49 +00:00
whitequark df95dc7d4a
Merge pull request #1872 from boqwxp/cleanup_copy
Clean up private member usage in `passes/cmds/copy.cc`.
2020-04-06 11:03:46 +00:00
whitequark 41f0c38478
Merge pull request #1871 from boqwxp/cleanup_splice
Clean up `passes/cmds/splice.cc`.
2020-04-06 11:03:34 +00:00
whitequark db66371915
Merge pull request #1869 from boqwxp/cleanup_connwrappers
Clean up `passes/cmds/connwrappers.cc`.
2020-04-06 11:01:44 +00:00
whitequark 30934e425d
Merge pull request #1868 from boqwxp/cleanup_delete
Clean up `passes/cmds/delete.cc`.
2020-04-06 10:58:38 +00:00
whitequark d3615ee445
Merge pull request #1867 from boqwxp/cleanup_stat
Clean up `passes/cmds/stat.cc`.
2020-04-06 10:58:02 +00:00
whitequark 0d69d532e0
Merge pull request #1859 from boqwxp/design_duplicate
Add `-push-copy` option to the `design` command.
2020-04-06 10:39:26 +00:00
Alberto Gonzalez 57f48f94c2
Clean up `passes/cmds/show.cc`. 2020-04-06 08:51:25 +00:00
Alberto Gonzalez fdeeb48e62
Clean up private member usage in `passes/cmds/bugpoint.cc`. 2020-04-06 08:35:09 +00:00
Alberto Gonzalez 2dd09ab611
Clean up private member usage in `passes/cmds/copy.cc`. 2020-04-06 08:26:10 +00:00
Alberto Gonzalez 5e9c88501e
Clean up `passes/cmds/splice.cc`. 2020-04-06 07:42:46 +00:00
Alberto Gonzalez 2e27ddd511
Clean up `passes/cmds/setattr.cc`. 2020-04-06 06:52:18 +00:00
Alberto Gonzalez 968230261f
Clean up `passes/cmds/connwrappers.cc`. 2020-04-06 06:11:25 +00:00