-
Notifications
You must be signed in to change notification settings - Fork 1k
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
|
So that I don't lose them, this touches on #3913, #4638, and #4034. Currently working on updating |
+ partial support for The
Which I think puts the list for cells marked Unless you use Oh, and EDIT: Updated the supported cells. |
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. 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.
eb5abf9 to
bc310e7
Compare
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.selectcommand.a. Enables e.g. calling
delete y:synthesizable y:formal %u %nto 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_ffbe renamed tois_sequentialor 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.