aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | kernel: Try an order-independent approach to hashing `dict`.Alberto Gonzalez2020-05-191-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Co-Authored-By: David Shah <dave@ds0.me> Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
| * | | | kernel: Ensure `dict` always hashes to the same value given the same contents.Alberto Gonzalez2020-05-141-3/+6
| | | | |
| * | | | kernel: Re-implement `dict` hash code as a `dict` member function instead of ↵Alberto Gonzalez2020-05-141-20/+14
| | | | | | | | | | | | | | | | | | | | a specialized template for `hash_ops`.
| * | | | techmap: prefix special wires with backslash for use as IdStringEddie Hung2020-05-142-1/+2
| | | | |
| * | | | Add specialized `hash()` for type `dict` and use a `dict` instead of a ↵Alberto Gonzalez2020-05-142-6/+21
| | | | | | | | | | | | | | | | | | | | `std::map` for `techmap_cache` and `techmap_do_cache`.
* | | | | Merge pull request #1885 from Xiretza/mod-rem-cellsclairexen2020-05-296-11/+98
|\ \ \ \ \ | | | | | | | | | | | | Fix modulo/remainder semantics
| * | | | | Add comments for mod/div semantics to rtlil.hXiretza2020-05-281-0/+4
| | | | | |
| * | | | | Add flooring division operatorXiretza2020-05-286-7/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $div and $mod cells use truncating division semantics (rounding towards 0), as defined by e.g. Verilog. Another rounding mode, flooring (rounding towards negative infinity), can be used in e.g. VHDL. The new $divfloor cell provides this flooring division. This commit also fixes the handling of $div in opt_expr, which was previously optimized as if it was $divfloor.
| * | | | | Add flooring modulo operatorXiretza2020-05-286-12/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $div and $mod cells use truncating division semantics (rounding towards 0), as defined by e.g. Verilog. Another rounding mode, flooring (rounding towards negative infinity), can be used in e.g. VHDL. The new $modfloor cell provides this flooring modulo (also known as "remainder" in several languages, but this name is ambiguous). This commit also fixes the handling of $mod in opt_expr, which was previously optimized as if it was $modfloor.
* | | | | | Merge pull request #2092 from whitequark/rtlil-no-space-controlclairexen2020-05-291-3/+5
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Restrict RTLIL::IdString to not contain whitespace or control chars
| * | | | | Restrict RTLIL::IdString to not contain whitespace or control chars.whitequark2020-05-291-3/+5
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | This is an existing invariant (most backends can't cope with these) but one that was not checked or documented.
* | | | | Merge pull request #2088 from rswarbrick/count-atwhitequark2020-05-281-2/+8
|\ \ \ \ \ | | | | | | | | | | | | Minor optimisation in Module::wire() and Module::cell()
| * | | | | Minor optimisation in Module::wire() and Module::cell()Rupert Swarbrick2020-05-261-2/+8
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing code does a search to figure out whether id is in the dict (with the call to count()), and then looks it up again to get the result (with the call to at()). This version calls find() instead, avoiding the double lookup. Code size increases slightly (6kb). I think this is because the contents of find() are getting inlined, and then inlined into lots of the callsites for cell() and wire(). Looking at the compiled code before this patch, you just get a (non-inlined) call to count() followed by a call to at(). After the patch, the contents of find() have been inlined (so you see do_hash, then do_lookup). The result for each function is about 30 bytes / 40% bigger, which presumably also enlarges call-sites that inline it.
* | | | | Merge pull request #2086 from rswarbrick/sigbitwhitequark2020-05-281-2/+1
|\ \ \ \ \ | | | | | | | | | | | | Use default copy constructor for RTLIL::SigBit
| * | | | | Use default copy constructor for RTLIL::SigBitRupert Swarbrick2020-05-261-2/+1
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a handwritten copy constructor, which I'm not sure was actually legal C++ (it unconditionally read from the 'data' member of a union, which wouldn't have been written if wire was true). It was also a bit less efficient than the constructor you get from the compiler by default (which is allowed to just copy the memory). This gives a marginal (~0.25%) decrease in code size when compiled with GCC 9.3.
* / / / / Use c_str(), not str() for IdString/std::string == and != operatorsRupert Swarbrick2020-05-261-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These operators work by fetching the string from the global string table and then comparing with the std::string that was passed in as rhs. Using str() means that we create a std::string (strlen; malloc; memcpy), compare for equality (another memcmp if they have the same length) and then finally free the string. Using c_str() means that we pass the const char* straight to std::string's equality operator. This ends up as a call to std::string::compare (the const char* flavour), which is essentially strcmp.
* | | | Merge pull request #2059 from boqwxp/logger-vector-to-dictMiodrag Milanović2020-05-212-18/+15
|\ \ \ \ | | | | | | | | | | 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.
| * | | | log: Use `dict` instead of `std::vector<std::pair>` for `log_expect_{error, ↵Alberto Gonzalez2020-05-152-18/+15
| | |/ / | |/| | | | | | | | | | warning, log}` to better express the intent that each element is unique.
* | | | Merge pull request #2046 from PeterCrozier/trapN. Engelhardt2020-05-201-3/+3
|\ \ \ \ | | | | | | | | | | Extend YS_DEBUGTRAP to MacOS.
| * | | | Consolidate Linux and Mac version of YS_DEBUGTRAP_IF_DEBUGGING.Peter Crozier2020-05-131-5/+2
| | | | |
| * | | | Extend YS_DEBUGTRAP to MacOS.Peter Crozier2020-05-131-1/+4
| |/ / /
* | | | Add force_downto and force_upto wire attributes.Marcelina Kościelnicka2020-05-191-0/+2
| | | | | | | | | | | | | | | | Fixes #2058.
* | | | abc9: use (* abc9_keep *) instead of (* abc9_scc *); apply to $_DFF_?_Eddie Hung2020-05-141-1/+1
| | | | | | | | | | | | | | | | instead of moving them to $__ prefix
* | | | timinginfo: ignore $specify2 cells if EN is falseEddie Hung2020-05-141-0/+3
| | | |
* | | | abc9_ops: fix bypass boxes using (* abc9_bypass *)Eddie Hung2020-05-141-2/+1
| | | |
* | | | kernel: TimingInfo to clamp -ve setup/edge-sensitive delays to zeroEddie Hung2020-05-141-10/+6
| | | |
* | | | Revert "Merge branch 'eddie/kernel_makeblackbox' into eddie/abc9_auto_dff"Eddie Hung2020-05-141-1/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit e08497c7c9d8a6f7a3eccddf2149c45d9ecff207, reversing changes made to e366fd55122236a21c6daee6765724add840a1f9.
* | | | kernel: Module::makeblackbox() to clear connections + delete wires lastEddie Hung2020-05-141-0/+1
|/ / /
* | | Fix clang compiler warningClaire Wolf2020-05-081-2/+2
| | | | | | | | | | | | Signed-off-by: Claire Wolf <claire@symbioticeda.com>
* | | Merge pull request #2022 from Xiretza/fallthroughswhitequark2020-05-081-0/+10
|\ \ \ | | | | | | | | Avoid switch fall-through warnings
| * | | Add YS_FALLTHROUGH macro to mark case fall-throughXiretza2020-05-071-0/+10
| |/ / | | | | | | | | | | | | C++17 introduced [[fallthrough]], GCC and clang had their own vendored attributes before that. MSVC doesn't seem to have such a warning at all.
* | | Merge pull request #2005 from YosysHQ/claire/fix1990Claire Wolf2020-05-071-0/+1
|\ \ \ | |/ / |/| | Add "nowrshmsk" attribute, fix shift-and-mask bit slice write for signed offset
| * | Add "nowrshmsk" attribute, fix shift-and-mask bit slice write for signed ↵Claire Wolf2020-05-021-0/+1
| | | | | | | | | | | | | | | | | | offset, fixes #1990 Signed-off-by: Claire Wolf <claire@symbioticeda.com>
* | | frontend: cleanup to use more ID::*, more dict<> instead of map<>Eddie Hung2020-05-041-0/+3
| | |
* | | Merge pull request #2000 from whitequark/log_error-trapwhitequark2020-05-032-3/+44
|\ \ \ | |/ / |/| | kernel: Trap in `log_error()` when a debugger is attached
| * | kernel: Trap in `log_error()` when a debugger is attached.whitequark2020-05-032-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The workflow of debugging fatal pass errors in Yosys is flawed in three ways: 1. Running Yosys under a debugger is sufficient for the debugger to catch some fatal errors (segfaults, aborts, STL exceptions) but not others (`log_error()`, `log_cmd_error()`). This is neither obvious nor easy to remember. 2. To catch Yosys-specific fatal errors, it is necessary to set a breakpoint at `logv_error_with_prefix()`, or at least, `logv_error()`. This is neither obvious nor easy to remember, and GDB's autocomplete takes many seconds to suggest function names due to the large amount of symbols in Yosys. 3. If a breakpoint is not set and Yosys encounters with such a fatal error, the process terminates. When debugging a crash that takes a long time to reproduce (or a nondeterministic crash) this can waste a significant amount of time. To solve this problem, add a macro `YS_DEBUGTRAP` that acts as a hard breakpoint (if available), and a macro `YS_DEBUGTRAP_IF_DEBUGGING` that acts as a hard breakpoint only if debugger is present. Then, use `YS_DEBUGTRAP_IF_DEBUGGING` in `logv_error_with_prefix()` to obviate the need for a breakpoint on nearly every platform. Co-Authored-By: Alberto Gonzalez <boqwxp@airmail.cc>
* | | Add WASI platform support.whitequark2020-04-304-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #1992 from YosysHQ/eddie/bugpoint_helpEddie Hung2020-04-271-0/+1
|\ \ \ | |_|/ |/| | bugpoint: improve help text
| * | bugpoint: (* keep *) to (* bugpoint_keep *); also apply to modules/cellsEddie Hung2020-04-241-0/+1
| | |
* | | verific: do not assert if wire not found; warn insteadEddie Hung2020-04-231-0/+1
|/ /
* / kernel: Cell::getParam() to throw exception again if not foundEddie Hung2020-04-221-3/+2
|/ | | | As it did before #1945
* Merge pull request #1969 from boqwxp/pool_emplaceEddie Hung2020-04-221-2/+32
|\ | | | | kernel: Add `pool` support for rvalue references and C++11 move semantics.
| * pool: add emplace() functionEddie Hung2020-04-221-0/+6
| |
| * kernel: Rename arguments to rvalue-reference-accepting functions.Alberto Gonzalez2020-04-211-8/+8
| |
| * Add rvalue-reference-accepting `entry_t` constructor for `pool`.Alberto Gonzalez2020-04-201-0/+1
| |
| * In `pool`, construct `entry_t`s in-place and add an ↵Alberto Gonzalez2020-04-201-2/+25
| | | | | | | | rvalue-accepting-and-forwarding `insert()` method.
* | Use default parameter value in getParamMarcelina Kościelnicka2020-04-211-1/+10
| | | | | | | | Fixes #1822.
* | ilang, ast: Store parameter order and default value information.Marcelina Kościelnicka2020-04-212-2/+4
| | | | | | | | Fixes #1819, #1820.
* | idict: Make iterator go forward.Marcelina Kościelnicka2020-04-211-5/+19
|/ | | | Previously, iterating over an idict returned its contents in reverse.
* rtlil: add AttrObject::has_attribute.whitequark2020-04-162-0/+7
|