aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rtlil.h
Commit message (Collapse)AuthorAgeFilesLines
* kernel: make IdString::isPublic() const.whitequark2020-12-121-1/+1
|
* add IdString::isPublic()N. Engelhardt2020-09-031-0/+2
|
* Add add* functions for the new FF typesMarcelina Kościelnicka2020-06-231-0/+20
|
* Merge pull request #2177 from boqwxp/dict-iterator-jumpwhitequark2020-06-211-0/+23
|\ | | | | hashlib, rtlil: Add `operator+()` and `operator+=()` to `dict` iterators
| * hashlib, rtlil: Add `operator+=()` to `dict<>::iterator` and ↵Alberto Gonzalez2020-06-191-0/+23
| | | | | | | | `dict<>::const_iterator` and add `operator+()` and `operator+=()` to `ObjIterator`.
* | rtlil: Add `Design::select()` for selecting whole modules.Alberto Gonzalez2020-06-191-0/+7
|/
* RTLIL: add Module::addProcess, use it in Module::cloneInto. NFC.whitequark2020-06-091-0/+2
|
* flatten: preserve original object names via hdlname attribute.whitequark2020-06-081-0/+3
|
* Merge pull request #2105 from whitequark/split-flatten-off-techmapclairexen2020-06-081-0/+2
|\ | | | | Split `flatten` from `techmap` and simplify it
| * RTLIL: factor out RTLIL::Module::addMemory. NFC.whitequark2020-06-041-0/+2
| |
* | Merge pull request #2006 from jersey99/signed-in-rtlil-wirewhitequark2020-06-041-1/+1
|\ \ | | | | | | Preserve 'signed'-ness of a verilog wire through RTLIL
| * | Preserve 'signed'-ness of a verilog wire through RTLILVamsi K Vytla2020-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | As per suggestion made in https://github.com/YosysHQ/yosys/pull/1987, now: RTLIL::wire holds an is_signed field. This is exported in JSON backend This is exported via dump_rtlil command This is read in via ilang_parser
* | | Merge pull request #2070 from hackfin/masterN. Engelhardt2020-06-041-6/+3
|\ \ \ | |_|/ |/| | Pyosys API: idict type handling
| * | idict handling in wrapperMartin2020-05-191-6/+3
| |/ | | | | | | | | - Also, re-applied no-line-break workaround to rtlil.h to make parser catch all methods.
* | Merge pull request #1885 from Xiretza/mod-rem-cellsclairexen2020-05-291-0/+10
|\ \ | | | | | | Fix modulo/remainder semantics
| * | Add comments for mod/div semantics to rtlil.hXiretza2020-05-281-0/+4
| | |
| * | Add flooring division operatorXiretza2020-05-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* ilang, ast: Store parameter order and default value information.Marcelina Kościelnicka2020-04-211-1/+2
| | | | Fixes #1819, #1820.
* rtlil: add AttrObject::has_attribute.whitequark2020-04-161-0/+2
|
* rtlil: add AttrObject::{get,set}_string_attribute.whitequark2020-04-161-2/+9
| | | | And make {get,set}_src_attribute use those functions.
* Merge pull request #1858 from YosysHQ/eddie/fix1856Eddie Hung2020-04-091-1/+1
|\ | | | | kernel: include "kernel/constids.inc"
| * kernel: include "kernel/constids.inc" instead of "constids.inc"Eddie Hung2020-04-091-1/+1
| |
* | [NFCI] Deduplicate builtin FF cell types listMarcelina Kościelnicka2020-04-091-0/+2
|/ | | | | | | | | 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.
* kernel: IdString::in(const IdString &) as per @TjoppenEddie Hung2020-04-021-1/+1
|
* kernel: fix formatting (thanks @boqwxp)Eddie Hung2020-04-021-6/+4
|
* kernel: use C++11 fold hack to prevent recursionEddie Hung2020-04-021-3/+8
|
* Revert "kernel: IdString:in() to use perfect forwarding"Eddie Hung2020-04-021-2/+2
| | | | This reverts commit 7b2a85aedf24affc2e1202c78e70e6a317f5bf29.
* kernel: separate IdString::put_reference() out to help inliningEddie Hung2020-04-021-1/+4
|
* kernel: IdString:in() to use perfect forwardingEddie Hung2020-04-021-2/+2
|
* kernel: Use constids.inc for global/constant IdStringsEddie Hung2020-04-021-5/+3
|
* Merge pull request #1845 from YosysHQ/eddie/kernel_speedupEddie Hung2020-04-021-181/+191
|\ | | | | kernel: speedup by using more pass-by-const-ref
| * kernel: pass-by-value into Design::scratchpad_set_string() tooEddie Hung2020-03-271-1/+1
| |
| * kernel: Cell::set{Port,Param}() to pass by value, but use std::moveEddie Hung2020-03-261-2/+2
| | | | | | | | Otherwise cell->setPort(ID::A, cell->getPort(ID::B)) could be invalid
| * kernel: SigSpec copies to not trigger pack()Eddie Hung2020-03-181-1/+1
| |
| * kernel: more pass by const ref, more speedupsEddie Hung2020-03-181-180/+180
| |
| * kernel: SigSpec use more const& + overloads to prevent implicit SigSpecEddie Hung2020-03-131-7/+13
| |
| * kernel: optimise Module::remove(const pool<RTLIL::Wire*>()Eddie Hung2020-03-121-0/+4
| |
* | Add support for SystemVerilog-style `define to Verilog frontendRupert Swarbrick2020-03-271-1/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | This patch should support things like `define foo(a, b = 3, c) a+b+c `foo(1, ,2) which will evaluate to 1+3+2. It also spots mistakes like `foo(1) (the 3rd argument doesn't have a default value, so a call site is required to set it). Most of the patch is a simple parser for the format in preproc.cc, but I've also taken the opportunity to wrap up the "name -> definition" map in a type, rather than use multiple std::map's. Since this type needs to be visible to code that touches defines, I've pulled it (and the frontend_verilog_preproc declaration) out into a new file at frontends/verilog/preproc.h and included that where necessary. Finally, the patch adds a few tests in tests/various to check that we are parsing everything correctly.
* Add and use SigSpec::reverse()Eddie Hung2020-01-281-0/+2
|
* Add RTLIL::constpad, init by yosys_setup(); use for abc9Eddie Hung2020-01-081-0/+2
|
* Add Const::{begin,end,empty}()Eddie Hung2019-10-041-0/+3
|
* Add YOSYS_NO_IDS_REFCNT configuration macroClifford Wolf2019-08-111-1/+22
| | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>