-
Notifications
You must be signed in to change notification settings - Fork 994
Add selectors for cell type properties #4910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add `CellTypes::setup_{comb, ff, formal}_type()`. Most of the existing internal cells fit into one of these three groups.
Add `CellTypes::get_cell()` which takes a 'type' `IdString` and returns the corresponding `CellType` if it is in the `cell_types` dict, otherwise returns `nullptr`. Useful for getting a cell type by name and then checking its attributes.
Looks up the cell type for each cell in the design, returning the value of `CellType::is_<property>`. Only works for exact match, and only for internal cells. Also add a simple test checking a small design with an $add cell and an $sdff cell.
Now with `is_internal`, `is_metainfo`, and `has_effects`. Each type property has a comment specifying usage/meaning. Type properties (sans `is_internal`) get a default value of false. `CellTypes::setup_*_type()` methods get their own `CellType` struct assignments with named fields being assigned true to improve readability.
celltypes: Extra type props Now with `is_internal`, `is_metainfo`, and `has_effects`. Each type property has a comment specifying usage/meaning. Type properties (sans `is_internal`) get a default value of false. `CellTypes::setup_*_type()` methods get their own `CellType` struct assignments with named fields being assigned true to improve readability. Also remove `is_evaluable` from cell types that aren't actually `eval`-able, instead using `is_combinatorial` which afaict is what the flag was being used as a proxy for.
Like `help -cells` but instead of printing the cell's ports, prints its flags.
Don't mention verilog.
Turns out using designated initializers is c++20, so not available while we are still c++17 friendly.
So that I don't lose them, this touches on #3913, #4638, and #4034. Currently working on updating |
Where possible at least, and disable-able with `-nocteval`. `$lcu` doesn't work because it uses ports `P, G, CI, CO` instead of the standard `A, B, C, Y`. `$alu` and `$fa` have more than one output so they don't work either (and in the case of `$alu` it has extra inputs too). `$macc` is at least supported, but `CellTypes::eval()` doesn't have an implementation so it fails (which would also be true for `$lcu`, `$alu`, and `$fa`; if they weren't being rejected based on ports). Also add `test_cell -list [all|evaluable|missing]` which prints the list of cell types supported by test_cell, cell types marked evaluable, and cell types marked evaluable but not supported by test_cell respectively. Potential for listing cell types supported by test_cell but *not* marked evalulable, though that list is currently empty. Add `tests/various/evaluable.sh` to exercise this.
+ partial support for The
Which I think puts the list for cells marked
Unless you use
Oh, and EDIT: Updated the supported cells. |
Still unsupported: - x-prop cells ($eqx, $nex, $bweqx) - wide muxes (`$_MUX16_` and friends) - $pmux Partially supported: - $bwmux is not supported in `ConstEval::eval()`, works with `-noeval` - $buf has no mapping in techmap.v so is unusable with `techmap -assert` (i.e. the default) - $pow has `_TECHMAP_FAIL_` in techmap.v, `-simlib` works for some iterations but fails for others, `-aigmap` works fine Fix `CellTypes::eval() for `$_NMUX_`. Fix `RTLIL::Cell::fixup_parameters()` for $concat and $bwmux.
It fails in sat, and in `ConstEval::eval()`. But it's pseudo supported in test_cell at least. Also fix `RTLIL::Cell::fixup_parameters()` for $bweqx.
What are the reasons/motivation for this change?
#4122 and related. Also c++ code can use the
RTLIL::builtin_ff_cell_types()
, but there is no corresponding method for selecting builtin ff cell types from yosys scripts.Explain how this is achieved.
is_evaluable
.select
command.a. Enables e.g. calling
delete y:synthesizable y:formal %u %n
to delete all cells that are not synthesizable or formalOpen questions:
RTLIL::builtin_ff_cell_types()
be removed andRTLIL::builtin_ff_cell_types().count(cell->type)
be replaced withyosys_celltypes.get_cell(cell->type)->is_builtin_ff
? Reduces redundancy, but requires adding#include "kernel/celltypes.h"
in many of the files.is_builtin_ff
be renamed tois_sequential
or something, with builtin ffs being defined asis_internal and is_sequential
?RTLIL::Cell::has_memid()
andRTLIL::Cell::is_mem_cell()
be replaced with cell type properties?If applicable, please suggest to reviewers how they can test the change.
Call
yosys -h "-celltypes"
to check the assigned cell type properties make sense.