mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-30 13:19:05 +00:00
kernel: Add RTLIL::PortDir for a combined input and output flag
This commit is contained in:
parent
6466b15367
commit
22423b97c1
3 changed files with 34 additions and 0 deletions
|
@ -320,6 +320,16 @@ struct CellTypes
|
|||
return it != cell_types.end() && it->second.inputs.count(port) != 0;
|
||||
}
|
||||
|
||||
RTLIL::PortDir cell_port_dir(RTLIL::IdString type, RTLIL::IdString port) const
|
||||
{
|
||||
auto it = cell_types.find(type);
|
||||
if (it == cell_types.end())
|
||||
return RTLIL::PD_UNKNOWN;
|
||||
bool is_input = it->second.inputs.count(port);
|
||||
bool is_output = it->second.outputs.count(port);
|
||||
return RTLIL::PortDir(is_input + is_output * 2);
|
||||
}
|
||||
|
||||
bool cell_evaluable(const RTLIL::IdString &type) const
|
||||
{
|
||||
auto it = cell_types.find(type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue