mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-22 22:03:40 +00:00
Add $allconst and $allseq cell types
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
2521ed305e
commit
eb67a7532b
11 changed files with 67 additions and 9 deletions
|
@ -1101,7 +1101,7 @@ namespace {
|
|||
return;
|
||||
}
|
||||
|
||||
if (cell->type.in("$anyconst", "$anyseq")) {
|
||||
if (cell->type.in("$anyconst", "$anyseq", "$allconst", "$allseq")) {
|
||||
port("\\Y", param("\\WIDTH"));
|
||||
check_expected();
|
||||
return;
|
||||
|
@ -2145,6 +2145,26 @@ RTLIL::SigSpec RTLIL::Module::Anyseq(RTLIL::IdString name, int width, const std:
|
|||
return sig;
|
||||
}
|
||||
|
||||
RTLIL::SigSpec RTLIL::Module::Allconst(RTLIL::IdString name, int width, const std::string &src)
|
||||
{
|
||||
RTLIL::SigSpec sig = addWire(NEW_ID, width);
|
||||
Cell *cell = addCell(name, "$allconst");
|
||||
cell->setParam("\\WIDTH", width);
|
||||
cell->setPort("\\Y", sig);
|
||||
cell->set_src_attribute(src);
|
||||
return sig;
|
||||
}
|
||||
|
||||
RTLIL::SigSpec RTLIL::Module::Allseq(RTLIL::IdString name, int width, const std::string &src)
|
||||
{
|
||||
RTLIL::SigSpec sig = addWire(NEW_ID, width);
|
||||
Cell *cell = addCell(name, "$allseq");
|
||||
cell->setParam("\\WIDTH", width);
|
||||
cell->setPort("\\Y", sig);
|
||||
cell->set_src_attribute(src);
|
||||
return sig;
|
||||
}
|
||||
|
||||
RTLIL::SigSpec RTLIL::Module::Initstate(RTLIL::IdString name, const std::string &src)
|
||||
{
|
||||
RTLIL::SigSpec sig = addWire(NEW_ID);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue