aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | flatten: preserve original object names via hdlname attribute.whitequark2020-06-085-6/+45
| | |
| * | flatten: only prepend $flatten once per wire.whitequark2020-06-081-2/+6
| | |
| * | RTLIL: use {get,set}_string_attribute in {get,set}_strpool_attribute.whitequark2020-06-081-2/+2
|/ / | | | | | | | | The only difference in behavior is that this removes the attribute when the pool becomes empty.
* | Merge pull request #2120 from whitequark/flatten-hygienewhitequark2020-06-081-155/+116
|\ \ | | | | | | flatten: make hygienic
| * | flatten: make hygienic.whitequark2020-06-081-155/+116
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, `flatten` matched the template objects with the newly created objects solely by their name. Because of this, it could be confused by code such as: module bar(); $dff a(); endmodule module foo(); bar b(); $dff \b.a (); endmodule After this commit, `flatten` avoids every possible case of name collision. Fixes #2106.
* | Merge pull request #2121 from whitequark/cxxrtl-debug-aliaseswhitequark2020-06-085-25/+120
|\ \ | | | | | | cxxrtl: improve design visibility
| * | cxxrtl: don't check immutable values for changes in VCD writer.whitequark2020-06-081-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the VCD writer such that for all signals that have `debug_item.type == VALUE && debug_item.next == nullptr`, it would only sample the value once. Commit f2d7a187 added more debug information by including constant wires, and decreased the performance of VCD writer proportionally because the constant wires were still repeatedly sampled; this commit eliminates the performance hit.
| * | cxxrtl: emit debug information for constant wires.whitequark2020-06-083-17/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | Constant wires can represent a significant chunk of the design in generic designs or after optimization. Emitting them in VCD files significantly improves usability because gtkwave removes all traces that are not present in the VCD file after reload, and iterative development suffers if switching a varying signal to a constant disrupts the workflow.
| * | cxxrtl: track aliases in VCD writer.whitequark2020-06-081-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the VCD writer such that for all signals that share `debug_item.curr`, it would only emit a single VCD identifier, and sample the value once. Commit 9b39c6f7 added redundancy to debug information by including alias wires, and increased the size of VCD files proportionally; this commit eliminates the redundancy from VCD files so that their size is the same as before.
| * | cxxrtl: emit debug information for alias wires.whitequark2020-06-081-3/+55
| | | | | | | | | | | | | | | | | | | | | Alias wires can represent a significant chunk of the design in highly hierarchical designs; in Minerva SRAM, there are 273 member wires and 527 alias wires. Showing them in every hierarchy level significantly improves usability.
| * | cxxrtl: add missing installs of include files.whitequark2020-06-081-0/+5
| | |
| * | cxxrtl: fix typo in comment. NFC.whitequark2020-06-081-4/+4
| | |
| * | cxxrtl: minor debug-related improvements.whitequark2020-06-081-2/+3
| | |
* | | Merge pull request #2085 from rswarbrick/selectclairexen2020-06-082-15/+20
|\ \ \ | | | | | | | | Silence warning in select.cc and pass some more args by ref
| * | | Pass some more args by reference in select.ccRupert Swarbrick2020-05-272-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, the code passed around std::string objects by value. It's probably not a hot-spot, but it can't hurt to avoid the copying. Removing the copy and clean-up code means the resulting code is ~6.1kb smaller when compiled with GCC 9.3 and standard settings.
| * | | Minor optimisations in select.cc's match_ids functionRupert Swarbrick2020-05-271-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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)
| * | | Silence warning in select.ccRupert Swarbrick2020-05-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #2089 from rswarbrick/modportsclairexen2020-06-081-13/+6
|\ \ \ \ | | | | | | | | | | Simplify a modport check in hierarchy.cc
| * | | | Simplify a modport check in hierarchy.ccRupert Swarbrick2020-05-261-13/+6
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code originally comes from commit 458a940. When an interface is used via a modport, code in genrtlil.cc sets '\\interface_type' and '\\interface_modport' properties on the wire. In hierarchy.cc, we pick up the modport name and add it to a dict called modports_used_in_submodule (that maps connection source to modport name). Before this patch, the modport name is retrieved as a strpool and then iterated over in an arbitrary order, discarding all entries but the last. In practice, the pool will always have 0 or 1 entries because the string used to construct it is a valid identifier, so doesn't contain any pipe symbols. This patch changes the code to retrieve the modport name as just a string. This will have the same effect in practice, but may be a bit less confusing! The code also gets moved down closer to where the result is used, which might be a bit more efficient since we won't always get as far as the check. The patch also removes some commented-out code, which I think was intended to add some typechecking at some point, but was never implemented. Since this dates back to October 2018, I think it makes more sense to just take it out.
* | | | Merge pull request #2105 from whitequark/split-flatten-off-techmapclairexen2020-06-085-325/+541
|\ \ \ \ | | | | | | | | | | Split `flatten` from `techmap` and simplify it
| * | | | flatten: clean up log messages.whitequark2020-06-041-1/+1
| | | | |
| * | | | flatten: topologically sort modules.whitequark2020-06-041-55/+47
| | | | |
| * | | | flatten: simplify.whitequark2020-06-041-43/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `flatten` cannot derive modules in most cases because that would just yield processes, and it does not support `-autoproc`; in practice `flatten` has to be preceded by a call to `hierarchy`, which makes deriving unnecessary.
| * | | | flatten: simplify. NFC.whitequark2020-06-041-7/+3
| | | | | | | | | | | | | | | | | | | | Remove redundant sigmaps.
| * | | | flatten: simplify.whitequark2020-06-041-35/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Flattening does not benefit from topologically sorting cells within a module when processing them.
| * | | | flatten: simplify. NFC.whitequark2020-06-041-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Flatten is non-recursive and doesn't need to keep track of handled cells.
| * | | | flatten: simplify. NFC.whitequark2020-06-041-6/+4
| | | | | | | | | | | | | | | | | | | | Flattening always does "non-recursive" mapping.
| * | | | flatten: simplify. NFC.whitequark2020-06-041-73/+39
| | | | | | | | | | | | | | | | | | | | The `celltypeMap` always maps `x` to `{x}`.
| * | | | flatten: simplify. NFC.whitequark2020-06-041-8/+8
| | | | | | | | | | | | | | | | | | | | The `design` and `map` designs are always the same when flattening.
| * | | | RTLIL: factor out RTLIL::Module::addMemory. NFC.whitequark2020-06-044-14/+16
| | | | |
| * | | | flatten: rename techmap-related stuff. NFC.whitequark2020-06-041-16/+16
| | | | |
| * | | | techmap, flatten: remove dead options.whitequark2020-06-042-928/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After splitting the passes, some options can never be activated, and most conditions involving them become dead. Remove them, and also all of the newly dead code.
| * | | | flatten: split from techmap.whitequark2020-06-033-93/+1149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the two passes started out very similar, they diverged over time and now have little in common. Moreover, `techmap` is extremely complex while `flatten` does not have to be, and this complexity interferes with improving `flatten`.
* | | | | Merge pull request #2117 from PeterCrozier/struct_arrayclairexen2020-06-083-17/+158
|\ \ \ \ \ | | | | | | | | | | | | Support packed arrays in struct/union.
| * | | | | Support packed arrays in struct/union.Peter Crozier2020-06-073-17/+158
| | | | | |
* | | | | | Merge pull request #2119 from YosysHQ/mwk/fix-fsm-idstringclairexen2020-06-081-1/+1
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | fsm_extract: avoid calling log_signal to determine wire name
| * | | | | fsm_extract: avoid calling log_signal to determine wire nameMarcelina Kościelnicka2020-06-081-1/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | log_signal can result in a string with spaces (when bit selection is involved), which breaks the rule of IdString not containing whitespace. Instead, remove the sigspec from the name entirely — given that the resulting wire will have no users, it will be removed later anyway, so its name doesn't really matter. Fixes #2118
* | | | | Merge pull request #2116 from whitequark/cxxrtl-vcdwhitequark2020-06-077-3/+419
|\ \ \ \ \ | |/ / / / |/| | | | cxxrtl: add a VCD writer using debug information
| * | | | cxxrtl: rename cxxrtl.cc→cxxrtl_backend.cc.whitequark2020-06-072-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | To avoid confusion with the C++ source files that are a part of the simulation itself and not a part of Yosys build.
| * | | | cxxrtl: add a C API for writing VCD dumps.whitequark2020-06-075-2/+204
| | | | | | | | | | | | | | | | | | | | This C API is fully featured.
| * | | | cxxrtl: only write VCD values that were actually updated.whitequark2020-06-071-10/+30
| | | | | | | | | | | | | | | | | | | | | | | | | On a representative design (Minerva SoC) this reduces VCD file size by ~20× and runtime by ~3×.
| * | | | cxxrtl: add a VCD writer using debug information.whitequark2020-06-071-0/+194
|/ / / /
* | | | Merge pull request #2115 from whitequark/cxxrtl-introspectionwhitequark2020-06-064-5/+396
|\ \ \ \ | | | | | | | | | | cxxrtl: add debug information to the C++ API, and add introspection via a new C API
| * | | | cxxrtl: add a C API for driving and introspecting designs.whitequark2020-06-064-29/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compared to the C++ API, the C API currently has two limitations: 1. Memories cannot be updated in a race-free way. 2. Black boxes cannot be implemented in C.
| * | | | cxxrtl: generate debug information for non-localized public wires.whitequark2020-06-062-2/+131
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Debug information describes values, wires, and memories with a simple C-compatible layout. It can be emitted on demand into a map, which has no runtime cost when it is unused, and allows late bound designs. The `hdlname` attribute is used as the lookup key such that original names, as emitted by the frontend, can be used for debugging and introspection.
* | | | Merge pull request #2110 from BracketMaster/masterwhitequark2020-06-061-1/+1
|\ \ \ \ | | | | | | | | | | MacOS has even stricter stack limits in catalina.
| * | | | more reasonable numbers for memoryYehowshua Immanuel2020-06-041-1/+1
| | | | |
| * | | | MacOS has even stricter stack limits in catalina.Yehowshua Immanuel2020-06-041-1/+1
| | | | | | | | | | | | | | | Invoking sby in macOS Catalina fails because of bizarre stack limits in Catalina.
* | | | | Merge pull request #2113 from whitequark/cxxrtl-fix-sshrwhitequark2020-06-051-1/+1
|\ \ \ \ \ | | | | | | | | | | | | cxxrtl: fix implementation of $sshr cell
| * | | | | cxxrtl: fix implementation of $sshr cell.whitequark2020-06-051-1/+1
| | |/ / / | |/| | | | | | | | | | | | | Fixes #2111.