3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 09:05:32 +00:00

Added $initstate cell type and vlog function

This commit is contained in:
Clifford Wolf 2016-07-21 14:23:22 +02:00
parent d7763634b6
commit 5c166e76e5
7 changed files with 54 additions and 4 deletions

View file

@ -117,6 +117,7 @@ struct CellTypes
setup_type("$assert", {A, EN}, pool<RTLIL::IdString>(), true);
setup_type("$assume", {A, EN}, pool<RTLIL::IdString>(), true);
setup_type("$predict", {A, EN}, pool<RTLIL::IdString>(), true);
setup_type("$initstate", pool<RTLIL::IdString>(), {Y}, true);
setup_type("$equiv", {A, B}, {Y}, true);
}

View file

@ -1024,6 +1024,12 @@ namespace {
return;
}
if (cell->type == "$initstate") {
port("\\Y", 1);
check_expected();
return;
}
if (cell->type == "$equiv") {
port("\\A", 1);
port("\\B", 1);

View file

@ -69,7 +69,7 @@ struct SatGen
SigPool initial_state;
std::map<std::string, RTLIL::SigSpec> asserts_a, asserts_en;
std::map<std::string, RTLIL::SigSpec> assumes_a, assumes_en;
std::map<std::string, RTLIL::SigSpec> expects_a, expects_en;
std::map<std::string, RTLIL::SigSpec> predict_a, predict_en;
std::map<std::string, std::map<RTLIL::SigBit, int>> imported_signals;
bool ignore_div_by_zero;
bool model_undef;
@ -1350,8 +1350,8 @@ struct SatGen
if (cell->type == "$predict")
{
std::string pf = prefix + (timestep == -1 ? "" : stringf("@%d:", timestep));
expects_a[pf].append((*sigmap)(cell->getPort("\\A")));
expects_en[pf].append((*sigmap)(cell->getPort("\\EN")));
predict_a[pf].append((*sigmap)(cell->getPort("\\A")));
predict_en[pf].append((*sigmap)(cell->getPort("\\EN")));
return true;
}