3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

Added $slice and $concat cell types

This commit is contained in:
Clifford Wolf 2014-02-07 17:44:57 +01:00
parent a1ac710ab8
commit fc3b3c4ec3
8 changed files with 140 additions and 4 deletions

View file

@ -571,6 +571,28 @@ bool dump_cell_expr(FILE *f, std::string indent, RTLIL::Cell *cell)
return true;
}
if (cell->type == "$slice")
{
fprintf(f, "%s" "assign ", indent.c_str());
dump_sigspec(f, cell->connections["\\Y"]);
fprintf(f, " = ");
dump_sigspec(f, cell->connections["\\A"]);
fprintf(f, " >> %d;\n", cell->parameters.at("\\OFFSET").as_int());
return true;
}
if (cell->type == "$concat")
{
fprintf(f, "%s" "assign ", indent.c_str());
dump_sigspec(f, cell->connections["\\Y"]);
fprintf(f, " = { ");
dump_sigspec(f, cell->connections["\\B"]);
fprintf(f, " , ");
dump_sigspec(f, cell->connections["\\A"]);
fprintf(f, " };\n");
return true;
}
if (cell->type == "$dff" || cell->type == "$adff")
{
RTLIL::SigSpec sig_clk, sig_arst, val_arst;