mirror of https://github.com/YosysHQ/yosys.git
synth_ice40/ecp5/xilinx: allow abc9.W to be overridden via scratchpad
This commit is contained in:
parent
584780d776
commit
e6b55e8b38
|
@ -30,6 +30,11 @@ struct SynthEcp5Pass : public ScriptPass
|
||||||
{
|
{
|
||||||
SynthEcp5Pass() : ScriptPass("synth_ecp5", "synthesis for ECP5 FPGAs") { }
|
SynthEcp5Pass() : ScriptPass("synth_ecp5", "synthesis for ECP5 FPGAs") { }
|
||||||
|
|
||||||
|
void on_register() YS_OVERRIDE
|
||||||
|
{
|
||||||
|
RTLIL::constpad["synth_ecp5.abc9.W"] = "300";
|
||||||
|
}
|
||||||
|
|
||||||
void help() YS_OVERRIDE
|
void help() YS_OVERRIDE
|
||||||
{
|
{
|
||||||
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
|
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
|
||||||
|
@ -324,6 +329,14 @@ struct SynthEcp5Pass : public ScriptPass
|
||||||
|
|
||||||
if (abc9) {
|
if (abc9) {
|
||||||
run("read_verilog -icells -lib -specify +/abc9_model.v +/ecp5/abc9_model.v");
|
run("read_verilog -icells -lib -specify +/abc9_model.v +/ecp5/abc9_model.v");
|
||||||
|
std::string abc9_opts;
|
||||||
|
if (nowidelut)
|
||||||
|
abc9_opts += " -maxlut 4";
|
||||||
|
std::string k = "synth_ecp5.abc9.W";
|
||||||
|
if (active_design && active_design->scratchpad.count(k))
|
||||||
|
abc9_opts += stringf(" -W %s", active_design->scratchpad_get_string(k).c_str());
|
||||||
|
else
|
||||||
|
abc9_opts += stringf(" -W %s", RTLIL::constpad.at(k).c_str());
|
||||||
if (nowidelut)
|
if (nowidelut)
|
||||||
run("abc9 -maxlut 4 -W 200");
|
run("abc9 -maxlut 4 -W 200");
|
||||||
else
|
else
|
||||||
|
|
|
@ -29,6 +29,13 @@ struct SynthIce40Pass : public ScriptPass
|
||||||
{
|
{
|
||||||
SynthIce40Pass() : ScriptPass("synth_ice40", "synthesis for iCE40 FPGAs") { }
|
SynthIce40Pass() : ScriptPass("synth_ice40", "synthesis for iCE40 FPGAs") { }
|
||||||
|
|
||||||
|
void on_register() YS_OVERRIDE
|
||||||
|
{
|
||||||
|
RTLIL::constpad["synth_ice40.abc9.hx.W"] = "250";
|
||||||
|
RTLIL::constpad["synth_ice40.abc9.lp.W"] = "400";
|
||||||
|
RTLIL::constpad["synth_ice40.abc9.u.W"] = "750";
|
||||||
|
}
|
||||||
|
|
||||||
void help() YS_OVERRIDE
|
void help() YS_OVERRIDE
|
||||||
{
|
{
|
||||||
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
|
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
|
||||||
|
@ -373,14 +380,15 @@ struct SynthIce40Pass : public ScriptPass
|
||||||
if (!noabc) {
|
if (!noabc) {
|
||||||
if (abc9) {
|
if (abc9) {
|
||||||
run("read_verilog " + define + " -icells -lib -specify +/abc9_model.v +/ice40/abc9_model.v");
|
run("read_verilog " + define + " -icells -lib -specify +/abc9_model.v +/ice40/abc9_model.v");
|
||||||
int wire_delay;
|
std::string abc9_opts;
|
||||||
if (device_opt == "lp")
|
std::string k = "synth_ice40.abc9.W";
|
||||||
wire_delay = 400;
|
if (active_design && active_design->scratchpad.count(k))
|
||||||
else if (device_opt == "u")
|
abc9_opts += stringf(" -W %s", active_design->scratchpad_get_string(k).c_str());
|
||||||
wire_delay = 750;
|
else {
|
||||||
else
|
k = stringf("synth_ice40.abc9.%s.W", device_opt.c_str());
|
||||||
wire_delay = 250;
|
abc9_opts += stringf(" -W %s", RTLIL::constpad.at(k).c_str());
|
||||||
run(stringf("abc9 -W %d", wire_delay));
|
}
|
||||||
|
run("abc9 " + abc9_opts);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
run("abc -dress -lut 4", "(skip if -noabc)");
|
run("abc -dress -lut 4", "(skip if -noabc)");
|
||||||
|
|
|
@ -619,11 +619,13 @@ struct SynthXilinxPass : public ScriptPass
|
||||||
run("techmap " + techmap_args);
|
run("techmap " + techmap_args);
|
||||||
run("read_verilog -icells -lib -specify +/abc9_model.v +/xilinx/abc9_model.v");
|
run("read_verilog -icells -lib -specify +/abc9_model.v +/xilinx/abc9_model.v");
|
||||||
std::string abc9_opts;
|
std::string abc9_opts;
|
||||||
auto k = stringf("synth_xilinx.abc9.%s.W", family.c_str());
|
std::string k = "synth_xilinx.abc9.W";
|
||||||
if (active_design->scratchpad.count(k))
|
if (active_design && active_design->scratchpad.count(k))
|
||||||
abc9_opts += stringf(" -W %s", active_design->scratchpad_get_string(k).c_str());
|
abc9_opts += stringf(" -W %s", active_design->scratchpad_get_string(k).c_str());
|
||||||
else
|
else {
|
||||||
|
k = stringf("synth_xilinx.abc9.%s.W", family.c_str());
|
||||||
abc9_opts += stringf(" -W %s", RTLIL::constpad.at(k, RTLIL::constpad.at("synth_xilinx.abc9.xc7.W")).c_str());
|
abc9_opts += stringf(" -W %s", RTLIL::constpad.at(k, RTLIL::constpad.at("synth_xilinx.abc9.xc7.W")).c_str());
|
||||||
|
}
|
||||||
if (nowidelut)
|
if (nowidelut)
|
||||||
abc9_opts += stringf(" -maxlut %d", lut_size);
|
abc9_opts += stringf(" -maxlut %d", lut_size);
|
||||||
if (dff_mode)
|
if (dff_mode)
|
||||||
|
|
Loading…
Reference in New Issue