Add builtin celltype $scopeinfo

Only declares the cell interface, doesn't make anything use or
understand $scopeinfo yet.
This commit is contained in:
Jannis Harder 2023-12-19 14:37:27 +01:00
parent 269c50f90e
commit f728927307
4 changed files with 22 additions and 0 deletions

View File

@ -108,6 +108,7 @@ struct CellTypes
setup_type(ID($overwrite_tag), {ID::A, ID::SET, ID::CLR}, pool<RTLIL::IdString>());
setup_type(ID($original_tag), {ID::A}, {ID::Y});
setup_type(ID($future_ff), {ID::A}, {ID::Y});
setup_type(ID($scopeinfo), {}, {});
}
void setup_internals_eval()

View File

@ -1769,6 +1769,15 @@ namespace {
return;
}
if (cell->type == ID($scopeinfo)) {
param(ID::TYPE);
check_expected();
std::string scope_type = cell->getParam(ID::TYPE).decode_string();
if (scope_type != "module" && scope_type != "struct")
error(__LINE__);
return;
}
if (cell->type == ID($_BUF_)) { port(ID::A,1); port(ID::Y,1); check_expected(); return; }
if (cell->type == ID($_NOT_)) { port(ID::A,1); port(ID::Y,1); check_expected(); return; }
if (cell->type == ID($_AND_)) { port(ID::A,1); port(ID::B,1); port(ID::Y,1); check_expected(); return; }

View File

@ -1379,6 +1379,11 @@ bool SatGen::importCell(RTLIL::Cell *cell, int timestep)
return true;
}
if (cell->type == ID($scopeinfo))
{
return true;
}
// Unsupported internal cell types: $pow $fsm $mem*
// .. and all sequential cells with asynchronous inputs
return false;

View File

@ -2763,3 +2763,10 @@ assign Y = A;
endmodule
// --------------------------------------------------------
(* noblackbox *)
module \$scopeinfo ();
parameter TYPE = "";
endmodule