3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-20 07:36:39 +00:00
Commit graph

365 commits

Author SHA1 Message Date
Emil J. Tywoniak 1be8f8023a add morphCell instead of type assignments, test_cell passes for all cells 2024-06-20 23:41:09 +02:00
Emil J. Tywoniak d2107a9ee4 reconsidering unset 2024-06-20 16:43:45 +02:00
Emil J. Tywoniak 76102f0bc5 $not now passes test_cell! 2024-06-19 18:55:40 +02:00
Emil J. Tywoniak 81f783bf62 cells can now be created, techmap broken 2024-06-18 19:16:48 +02:00
Emil J. Tywoniak b190055bbb fix swapped conns, params in interators 2024-06-18 16:16:34 +02:00
Emil J. Tywoniak 43d8c7f352 experimenting with test_cell 2024-06-17 19:14:39 +02:00
Emil J. Tywoniak fbdfff168b placement new, fix empty probably 2024-06-17 10:53:08 +02:00
Emil J. Tywoniak 65d50db4ef 100% 2024-06-14 17:26:48 +02:00
Emil J. Tywoniak eeb15ea2a2 73% 2024-06-13 22:50:21 +02:00
Emil J. Tywoniak 4c9f68216a tiny fix 2024-06-13 21:37:22 +02:00
Emil J. Tywoniak 866b7a7121 conns and params from dict, oldcell no longer attrobject 2024-06-13 21:34:42 +02:00
Emil J. Tywoniak 193a43e82c erase, clear, fork replace, idk 2024-06-13 20:31:11 +02:00
Emil J. Tywoniak 61cf4b6fb6 look at all those chickens 2024-06-13 14:27:11 +02:00
Emil J. Tywoniak 8bdcc6987b consty stuff 2024-06-13 12:55:52 +02:00
Emil J. Tywoniak 36289ab208 consty stuff 2024-06-13 12:35:31 +02:00
Emil J. Tywoniak 33987d975e dead end, backtracking 2024-06-12 19:30:55 +02:00
Emil J. Tywoniak 919e2103c9 references - breaking 2024-06-12 19:12:01 +02:00
Emil J. Tywoniak 1c2fb078eb iterator hell 2024-06-12 13:27:22 +02:00
Emil J. Tywoniak 33910bcf82 iterator hell 2024-06-12 13:12:55 +02:00
Emil J. Tywoniak d7251df9a9 wip 2024-06-11 00:06:52 +02:00
Emil J. Tywoniak c0a51c8a52 wip 2024-06-10 19:05:33 +02:00
Emil J. Tywoniak 2213b5d66d add functions to new cell 2024-06-10 18:51:29 +02:00
Emil J. Tywoniak 8403eee59b iterators 2024-06-10 18:48:09 +02:00
Emil J. Tywoniak e243968406 delete conn iter attempt 2024-06-10 11:48:28 +02:00
Emil J. Tywoniak 277c10e127 oldcell 2024-06-10 11:06:37 +02:00
Jannis Harder d8687e87b1 kernel: Avoid including files outside include guards
This adjusts the way the headers kernel/{yosys,rtlil,register,log}.h
include each other to avoid the need of including headers outside of
include guards as well as avoiding the inclusion of rtlil.h in the
middle of yosys.h with rtlil.h depending on the prefix of yosys.h, and
the suffix of yosys.h depending on rtlil.h.

To do this I moved some of the declaration in yosys.h into a new header
yosys_common.h. I'm not sure if that is strictly necessary.

Including any of these files still results in the declarations of all
these headers being included, so this shouldn't be a breaking change for
any passes or external plugins.

My main motivation for this is that ccls's (clang based language server)
include guard handling gets confused by the previous way the includes
were done. It often ends up treating the include guard as a generic
disabled preprocessor conditional, breaking navigation and highlighting
for the core RTLIL data structures.

Additionally I think avoiding cyclic includes in the middle of header
files that depend on includes being outside of include guards will also
be less confusing for developers reading the code, not only for tools
like ccls.
2024-04-02 16:53:56 +02:00
Martin Povišer f5013d035e rtlil: Fix Const hashing omission 2024-02-19 15:45:54 +01:00
Martin Povišer d6600fb1d5 rtlil: Fix handling of connections on wire deletion 2024-01-29 11:25:54 +01:00
Martin Povišer 80b8cd19c4 rtlil: Fix value type for iterator over SigSpec
When we are iterating over a `SigSpec`, the visited values will be of
type `SigBit` (as is the return type of `operator*()`). Account for that
in the publicly declared types.
2023-12-09 19:01:39 +01:00
Martin Povišer 189064b8da rtlil, hashlib: Remove deprecated std::iterator usage
`std::iterator` has been deprecated in C++17. Yosys is being compiled
against the C++11 standard but plugins can opt to compile against a
newer one. To silence some deprecation warnings when those plugins are
being compiled, replace the `std::iterator` inheritance with the
equivalent type declarations.
2023-12-09 19:01:39 +01:00
Martin Povišer 84568453f8 rtlil: Add lsb() msb() SigSpec helpers 2023-11-22 12:46:15 +01:00
N. Engelhardt 3e22791810
Merge pull request #3975 from rmlarsen/optmerge 2023-10-09 17:05:19 +02:00
Rasmus Munk Larsen 058973faee Undo formatting change. 2023-10-02 16:15:47 -07:00
Rasmus Munk Larsen bce984fa60 Speed up OptMergePass by 1.7x.
The main speedup comes from swithing from using a SHA1 hash to std::hash<std::string>. There is no need to use an expensive cryptographic hash for fingerprinting in this context.
2023-10-02 15:57:18 -07:00
Martin Povišer d641dfaec2 rtlil: Add helper to emit full-adder cells 2023-09-25 14:50:41 +02:00
Jannis Harder 62b4df4989 dft_tag: Implement $overwrite_tag and $original_tag
This does not correctly handle an `$overwrite_tag` on a module output,
but since we currently require the user to flatten the design for
cross-module dft, this cannot be observed from within the design, only
by manually inspecting the signals in the design.
2023-09-13 11:32:36 +02:00
Miodrag Milanovic 27ac912709 Support import of $future_ff 2023-09-13 11:32:36 +02:00
Miodrag Milanovic 54050a8c16 Basic support for tag primitives 2023-09-13 11:32:36 +02:00
dragonmux ef7e358576
kernel/rtlil: Trailing whitespace cleanup 2023-07-26 20:50:55 +01:00
dragonmux b59c717245
kernel/rtlil: Fixed the destruction guard for IdString
The guard is optimised out on some compilers under certain conditions (eg: LTO on GCC) as constant under C++ lifetime rules.
This is because the guard type's member is invalid to access (UB) after the type has been destroyed, resulting in
`destruct_guard.ok` being unable to be `false` according to the optimiser, based on the lifetime rules.

This patch still invokes UB (all accesses to the destroyed IdString instance are), but at least the optimiser
can't reason that destruct_guard_ok cannot be false and therefore it's safe to optimise out from its guard role.
2023-07-26 20:46:56 +01:00
Jannis Harder b08a880704 backends/rtlil: Do not shorten a value with z bits to 'x 2023-01-29 14:02:25 +01:00
Jannis Harder 7203ba7bc1 Add bitwise $bweqx and $bwmux cells
The new bitwise case equality (`$bweqx`) and bitwise mux (`$bwmux`)
cells enable compact encoding and decoding of 3-valued logic signals
using multiple 2-valued signals.
2022-11-30 18:24:35 +01:00
Jannis Harder c77b7343d0 Consistent $mux undef handling
* Change simlib's $mux cell to use the ternary operator as $_MUX_
  already does
* Stop opt_expr -keepdc from changing S=x to S=0
* Change const eval of $mux and $pmux to match the updated simlib
  (fixes sim)
* The sat behavior of $mux already matches the updated simlib

The verilog frontend uses $mux for the ternary operators and this
changes all interpreations of the $mux cell (that I found) to match the
verilog simulation behavior for the ternary operator. For 'if' and
'case' expressions the frontend may also use $mux but uses $eqx if the
verilog simulation behavior is requested with the '-ifx' option.

For $pmux there is a remaining mismatch between the sat behavior and the
simlib behavior. Resolving this requires more discussion, as the $pmux
cell does not directly correspond to a specific verilog construct.
2022-10-24 12:03:01 +02:00
Jannis Harder c0063288d6 Add the $anyinit cell and the formalff pass
These can be used to protect undefined flip-flop initialization values
from optimizations that are not sound for formal verification and can
help mapping all solver-provided values in witness traces for flows that
use different backends simultaneously.
2022-08-16 13:37:30 +02:00
Miodrag Milanovic 6c65ca4e50 Encode filename unprintable chars 2022-08-08 16:13:33 +02:00
Marcelina Kościelnicka a681904237 Assorted microoptimization speedups in core data structures. 2022-07-27 17:05:30 +02:00
Miodrag Milanovic 0098b32c6c using more portable formatting 2022-07-06 10:53:35 +02:00
Henner Zeller 9c41b43191 Use compiler-generated default constructor for RTLIL::Const::Const
No need for a manual implementation.
While at it: have the constructor that takes a string take a
const string reference instead to avoid a copy.
2022-06-09 16:07:45 +01:00
Marcelina Kościelnicka 93508d58da Add $bmux and $demux cells. 2022-01-28 23:34:41 +01:00
Marcelina Kościelnicka 26f0f6bb0b Fix unused param warning with ENABLE_NDEBUG. 2021-12-12 01:22:28 +01:00