diff --git a/kernel/celltypes.h b/kernel/celltypes.h index 77cb3e324..fde6624e1 100644 --- a/kernel/celltypes.h +++ b/kernel/celltypes.h @@ -108,6 +108,7 @@ struct CellTypes setup_type(ID($overwrite_tag), {ID::A, ID::SET, ID::CLR}, pool()); 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() diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 125730f29..8781b6a89 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -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; } diff --git a/kernel/satgen.cc b/kernel/satgen.cc index 3a2fa4735..baaf22d1f 100644 --- a/kernel/satgen.cc +++ b/kernel/satgen.cc @@ -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; diff --git a/techlibs/common/simlib.v b/techlibs/common/simlib.v index 930d2000b..489281f26 100644 --- a/techlibs/common/simlib.v +++ b/techlibs/common/simlib.v @@ -2763,3 +2763,10 @@ assign Y = A; endmodule // -------------------------------------------------------- + +(* noblackbox *) +module \$scopeinfo (); + +parameter TYPE = ""; + +endmodule