mirror of https://github.com/YosysHQ/yosys.git
Merge pull request #1573 from YosysHQ/eddie/xilinx_tristate
synth_xilinx: error out if tristate without '-iopad'
This commit is contained in:
commit
086c133ea5
|
@ -86,6 +86,7 @@ struct TribufWorker {
|
||||||
cell->unsetPort(ID(S));
|
cell->unsetPort(ID(S));
|
||||||
cell->type = tri_type;
|
cell->type = tri_type;
|
||||||
tribuf_cells[sigmap(cell->getPort(ID::Y))].push_back(cell);
|
tribuf_cells[sigmap(cell->getPort(ID::Y))].push_back(cell);
|
||||||
|
module->design->scratchpad_set_bool("tribuf.added_something", true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +96,7 @@ struct TribufWorker {
|
||||||
cell->unsetPort(ID(S));
|
cell->unsetPort(ID(S));
|
||||||
cell->type = tri_type;
|
cell->type = tri_type;
|
||||||
tribuf_cells[sigmap(cell->getPort(ID::Y))].push_back(cell);
|
tribuf_cells[sigmap(cell->getPort(ID::Y))].push_back(cell);
|
||||||
|
module->design->scratchpad_set_bool("tribuf.added_something", true);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,8 +132,10 @@ struct TribufWorker {
|
||||||
|
|
||||||
if (no_tribuf)
|
if (no_tribuf)
|
||||||
module->connect(it.first, muxout);
|
module->connect(it.first, muxout);
|
||||||
else
|
else {
|
||||||
module->addTribuf(NEW_ID, muxout, module->ReduceOr(NEW_ID, pmux_s), it.first);
|
module->addTribuf(NEW_ID, muxout, module->ReduceOr(NEW_ID, pmux_s), it.first);
|
||||||
|
module->design->scratchpad_set_bool("tribuf.added_something", true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,7 +316,10 @@ struct SynthXilinxPass : public ScriptPass
|
||||||
run("proc");
|
run("proc");
|
||||||
if (flatten || help_mode)
|
if (flatten || help_mode)
|
||||||
run("flatten", "(with '-flatten')");
|
run("flatten", "(with '-flatten')");
|
||||||
|
active_design->scratchpad_unset("tribuf.added_something");
|
||||||
run("tribuf -logic");
|
run("tribuf -logic");
|
||||||
|
if (!do_iopad && active_design->scratchpad_get_bool("tribuf.added_something"))
|
||||||
|
log_error("Tristate buffers are unsupported without the '-iopad' option.\n");
|
||||||
run("deminout");
|
run("deminout");
|
||||||
run("opt_expr");
|
run("opt_expr");
|
||||||
run("opt_clean");
|
run("opt_clean");
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
! ../../../yosys ../common/tribuf.v -qp "synth_xilinx"
|
||||||
|
../../../yosys ../common/tribuf.v -qp "synth_xilinx -iopad; \
|
||||||
|
select -assert-count 2 t:IBUF; \
|
||||||
|
select -assert-count 1 t:INV; \
|
||||||
|
select -assert-count 1 t:OBUFT"
|
Loading…
Reference in New Issue