aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
Commit message (Collapse)AuthorAgeFilesLines
* kernel/mem: Recognize some deprecated memory port configs.Marcelina Kościelnicka2021-06-011-0/+10
| | | | | | | | | | Transparency is meaningless for asynchronous ports, so we assume transparent == false to simplify the code in this case. Likewise, enable is meaningless, and we assume it is const-1. However, turns out that nMigen emits the former, and Verilog frontend emits the latter, so squash these issues when ingesting a $memrd cell. Fixes #2811.
* Make a few passes auto-call Mem::narrow instead of rejecting wide ports.Marcelina Kościelnicka2021-05-281-0/+3
| | | | | | This essentially adds wide port support for free in passes that don't have a usefully better way of handling wide ports than just breaking them up to narrow ports, avoiding "please run memory_narrow" annoyance.
* kernel/mem: Add helpers for write port widening.Marcelina Kościelnicka2021-05-272-0/+57
|
* kernel/mem: Add sub_addr helpers.Marcelina Kościelnicka2021-05-262-20/+30
|
* kernel/mem: Add prepare_wr_merge helper.Marcelina Kościelnicka2021-05-262-0/+27
|
* mem/extract_rdff: Fix "no FF made" edge case.Marcelina Kościelnicka2021-05-251-1/+4
| | | | | | | When converting a sync transparent read port with const address to async read port, nothing at all needs to be done other than clk_enable change, and thus we have no FF cell to return. Handle this case correctly in the helper and in its users.
* mem/extract_rdff: Add alternate transparency handling.Marcelina Kościelnicka2021-05-251-18/+80
| | | | | | | | | | When extracting read register from a transparent port that has an enable, reset, or initial value, the usual trick of putting a register on the address instead of data doesn't work. In this case, create soft transparency logic instead. When transparency masks land, this will also be used to handle ports that are transparent to only a subset of write ports.
* kernel/mem: Add model support for read port init value and resets.Marcelina Kościelnicka2021-05-252-4/+73
| | | | | | | Like wide port support, this is still completely unusable, and support in various passes will be gradually added later. It also has no support at all in the cell library, so attempting to create a read port with a reset or initial value will cause an assert failure for now.
* mem/extract_rdff: Fix wire naming and wide port support.Marcelina Kościelnicka2021-05-251-6/+22
|
* kernel/mem: Add emulate_priority helper.Marcelina Kościelnicka2021-05-252-0/+44
|
* kernel/mem: Add a Mem::narrow helper to split up wide ports.Marcelina Kościelnicka2021-05-252-0/+53
|
* kernel/mem: Emit support for wide ports in packed mode.Marcelina Kościelnicka2021-05-251-30/+34
| | | | | | | Since the packed cell doesn't actually support wide ports yet, we just auto-narrow them on emit. The future packed cell will add RD_WIDE_CONTINUATION and WR_WIDE_CONTINUATION parameters so the transform will be trivially reversible for proper serialization.
* kernel/mem: Add model for wide ports.Marcelina Kościelnicka2021-05-252-6/+28
| | | | | | Such ports cannot actually be created or used yet, this just adds the necessary plumbing in the helper. Subsequent commits will gradually add wide port support to various yosys passes.
* kernel/mem: Add priority_mask to model.Marcelina Kościelnicka2021-05-252-1/+47
| | | | | | | | This is going to be used to store arbitrary priority masks in the future. Right now, it is not supported by our cell library, so the priority_mask is computed from port order on helper construction, and discarded when emitted. However, this allows us to already convert helper-using passes to the new model.
* hashlib: Add a hash for bool.Marcelina Kościelnicka2021-05-241-0/+6
|
* extract_rdff: Add initvals parameter.Marcelina Kościelnicka2021-05-232-2/+3
| | | | | This is not used yet, but will be needed when read port reset/initial value support lands.
* Add new helper class for merging FFs into cells, use for memory_dff.Marcelina Kościelnicka2021-05-234-2/+474
| | | | Fixes #1854.
* kernel/rtlil: Extract some helpers for checking memory cell types.Marcelina Kościelnicka2021-05-222-0/+13
| | | | | | There will soon be more (versioned) memory cells, so handle passes that only care if a cell is memory-related by a simple helper call instead of a hardcoded list.
* kernel/mem: Add a check() function.Marcelina Kościelnicka2021-05-222-0/+26
|
* kernel/mem: defer port removal to emit()Marcelina Kościelnicka2021-05-222-18/+38
|
* rtlil: add const accessors for modules, wires, and cellsZachary Snow2021-03-252-0/+15
|
* split CodingReadme into multiple filesN. Engelhardt2021-03-221-1/+1
|
* Merge pull request #2681 from msinger/fix-issue2606Miodrag Milanović2021-03-191-3/+23
|\ | | | | Fix check for bad std::regex
| * Fix check for bad std::regex (fixes #2606)Michael Singer2021-03-171-3/+23
| |
* | modtools: fix use-after-free of cell pointers in ModWalkerXiretza2021-03-181-0/+2
|/ | | | | | | | cell_inputs and cell_outputs retain cell pointers as their keys across invocations of setup(), which may however be invalidated in the meantime (as happens in e.g. passes/opt/share.cc:1432). A later rehash of the dicts (caused by inserting in ModWalker::add_wire()) will cause them to be dereferenced.
* blackbox: Include whiteboxed modulesgatecat2021-03-172-3/+3
| | | | Signed-off-by: gatecat <gatecat@ds0.me>
* Replace assert in get_reference with more useful error messageLofty2021-03-171-1/+2
|
* rtlil: Disallow 0-width chunks in SigSpec.Marcelina Kościelnicka2021-03-151-18/+49
| | | | | | | | | Among other problems, this also fixes equality comparisons between SigSpec by enforcing a canonical form. Also fix another minor issue with possible non-canonical SigSpec. Fixes #2623.
* Add support for memory writes in processes.Marcelina Kościelnicka2021-03-082-0/+22
|
* Remove a few functions that, in fact, did not exist in the first place.Marcelina Kościelnicka2021-03-061-2/+0
|
* Replace assert in addModule with more useful error messageDan Ravensloft2021-03-061-1/+2
|
* Fix double-free on unmatched logger error patternZachary Snow2021-02-231-3/+3
| | | | | | | When an expected logger error pattern is unmatched, the logger raises another (hidden) error. Because of the previous ordering of actions, `logv_error_with_prefix()` would inadvertently invoke `yosys_atexit()` twice, causing a double-free.
* int -> boolRobert Baruch2021-02-231-2/+2
|
* Adds is_wire to SigBit and SigChunkRobert Baruch2021-02-231-0/+3
| | | Useful for PYOSYS because Python can't easily check wire against NULL.
* verilog: significant block scoping improvementsZachary Snow2021-01-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change set contains a number of bug fixes and improvements related to scoping and resolution in generate and procedural blocks. While many of the frontend changes are interdependent, it may be possible bring the techmap changes in under a separate PR. Declarations within unnamed generate blocks previously encountered issues because the data declarations were left un-prefixed, breaking proper scoping. The LRM outlines behavior for generating names for unnamed generate blocks. The original goal was to add this implicit labelling, but doing so exposed a number of issues downstream. Additional testing highlighted other closely related scope resolution issues, which have been fixed. This change also adds support for block item declarations within unnamed blocks in SystemVerilog mode. 1. Unlabled generate blocks are now implicitly named according to the LRM in `label_genblks`, which is invoked at the beginning of module elaboration 2. The Verilog parser no longer wraps explicitly named generate blocks in a synthetic unnamed generate block to avoid creating extra hierarchy levels where they should not exist 3. The techmap phase now allows special control identifiers to be used outside of the topmost scope, which is necessary because such wires and cells often appear in unlabeled generate blocks, which now prefix the declarations within 4. Some techlibs required modifications because they relied on the previous invalid scope resolution behavior 5. `expand_genblock` has been simplified, now only expanding the outermost scope, completely deferring the inspection and elaboration of nested scopes; names are now resolved by looking in the innermost scope and stepping outward 6. Loop variables now always become localparams during unrolling, allowing them to be resolved and shadowed like any other identifier 7. Identifiers in synthetic function call scopes are now prefixed and resolved in largely the same manner as other blocks before: `$func$\func_01$tests/simple/scopes.blk.v:60$5$\blk\x` after: `\func_01$func$tests/simple/scopes.v:60$5.blk.x` 8. Support identifiers referencing a local generate scope nested more than 1 level deep, i.e. `B.C.x` while within generate scope `A`, or using a prefix of a current or parent scope, i.e. `B.C.D.x` while in `A.B`, `A.B.C`, or `A.B.C.D` 9. Variables can now be declared within unnamed blocks in SystemVerilog mode Addresses the following issues: 656, 2423, 2493
* kernel/yosys.h: undef CONST on WIN32umarcor2020-12-281-2/+3
|
* kernel: undef Tcl macros interfering with cxxrtl.whitequark2020-12-221-0/+2
|
* Merge pull request #2487 from whitequark/cxxrtl-outliningwhitequark2020-12-191-1/+1
|\ | | | | CXXRTL: implement zero-cost full coverage debug information through the magic✨ of outlining🪄🎀🧹
| * kernel: make IdString::isPublic() const.whitequark2020-12-121-1/+1
| |
* | timinginfo: Error instead of segfault on const signals.Marcelina Kościelnicka2020-12-151-2/+2
|/ | | | Reported by @Ravenslofty
* bugpoint: add -wires option.whitequark2020-12-071-1/+1
|
* tcl -h message only if YOSYS_ENABLE_TCL defined.nitz2020-11-231-0/+2
|
* Expose abc and data paths as globalsMiodrag Milanovic2020-11-062-14/+61
|
* Add new helper structures to represent memories.Marcelina Kościelnicka2020-10-212-0/+514
|
* add IdString::isPublic()N. Engelhardt2020-09-031-0/+2
|
* Replace "ILANG" with "RTLIL" everywhere.whitequark2020-08-263-10/+10
| | | | | | | | | | The only difference between "RTLIL" and "ILANG" is that the latter is the text representation of the former, as opposed to the in-memory graph representation. This distinction serves no purpose but confuses people: it is not obvious that the ILANG backend writes RTLIL graphs. Passes `write_ilang` and `read_ilang` are provided as aliases to `write_rtlil` and `read_rtlil` for compatibility.
* Ensure \A_SIGNED is never used with $shiftxXiretza2020-08-181-1/+5
| | | | | It has no effect on the output ($shiftx doesn't perform any sign extension whatsoever), so an attempt to use it should be caught early.
* Respect \A_SIGNED for $shiftXiretza2020-08-182-42/+22
| | | | | | This reflects the behaviour of $shr/$shl, which sign-extend their A operands to the size of their output, then do a logical shift (shift in 0-bits).
* async2sync: Support all FF types.Marcelina Kościelnicka2020-07-301-0/+46
|
* ffinit: Fortify the code a bit.Marcelina Kościelnicka2020-07-281-24/+19
| | | | | This fixes handling of messy cases involving repeatedly setting and removing the same init bit.