nexus: Add support for clocked MULT9X9s
Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
parent
9203181625
commit
30c65931b2
@ -174,4 +174,13 @@ void replace_bus(Context *ctx, CellInfo *old_cell, IdString old_name, int old_of
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void copy_port(Context *ctx, CellInfo *old_cell, IdString old_name, CellInfo *new_cell, IdString new_name)
|
||||||
|
{
|
||||||
|
if (!old_cell->ports.count(old_name))
|
||||||
|
return;
|
||||||
|
new_cell->ports[new_name].name = new_name;
|
||||||
|
new_cell->ports[new_name].type = old_cell->ports.at(old_name).type;
|
||||||
|
connect_port(ctx, old_cell->ports.at(old_name).net, new_cell, new_name);
|
||||||
|
}
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
@ -110,6 +110,9 @@ void print_utilisation(const Context *ctx);
|
|||||||
void replace_bus(Context *ctx, CellInfo *old_cell, IdString old_name, int old_offset, bool old_brackets,
|
void replace_bus(Context *ctx, CellInfo *old_cell, IdString old_name, int old_offset, bool old_brackets,
|
||||||
CellInfo *new_cell, IdString new_name, int new_offset, bool new_brackets, int width);
|
CellInfo *new_cell, IdString new_name, int new_offset, bool new_brackets, int width);
|
||||||
|
|
||||||
|
// Copy a port from one cell to another
|
||||||
|
void copy_port(Context *ctx, CellInfo *old_cell, IdString old_name, CellInfo *new_cell, IdString new_name);
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -292,6 +292,7 @@ X(PREADDCAS_EN)
|
|||||||
X(SR_18BITSHIFT_EN)
|
X(SR_18BITSHIFT_EN)
|
||||||
X(OPC)
|
X(OPC)
|
||||||
X(RESET)
|
X(RESET)
|
||||||
|
X(RESETMODE)
|
||||||
|
|
||||||
X(ASIGNED_OPERAND_EN)
|
X(ASIGNED_OPERAND_EN)
|
||||||
X(BYPASS_MULT9)
|
X(BYPASS_MULT9)
|
||||||
@ -303,3 +304,11 @@ X(SHIFTA)
|
|||||||
X(REGBYPS)
|
X(REGBYPS)
|
||||||
|
|
||||||
X(PP)
|
X(PP)
|
||||||
|
|
||||||
|
X(SIGNEDA)
|
||||||
|
X(SIGNEDB)
|
||||||
|
X(RSTOUT)
|
||||||
|
X(CEOUT)
|
||||||
|
X(REGINPUTA)
|
||||||
|
X(REGINPUTB)
|
||||||
|
X(REGOUTPUT)
|
||||||
|
@ -1443,6 +1443,23 @@ struct NexusPacker
|
|||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void copy_global_dsp_params(CellInfo *orig, CellInfo *root)
|
||||||
|
{
|
||||||
|
if (root->params.count(id_GSR) && orig->params.count(id_GSR))
|
||||||
|
root->params[id_GSR] = orig->params.at(id_GSR);
|
||||||
|
if (root->params.count(id_RESET) && orig->params.count(id_RESETMODE))
|
||||||
|
root->params[id_RESET] = orig->params.at(id_RESETMODE);
|
||||||
|
for (auto child : root->constr_children)
|
||||||
|
copy_global_dsp_params(orig, child);
|
||||||
|
}
|
||||||
|
|
||||||
|
void copy_param(CellInfo *orig, IdString orig_name, CellInfo *dst, IdString dst_name)
|
||||||
|
{
|
||||||
|
if (!orig->params.count(orig_name))
|
||||||
|
return;
|
||||||
|
dst->params[dst_name] = orig->params[orig_name];
|
||||||
|
}
|
||||||
|
|
||||||
void pack_dsps()
|
void pack_dsps()
|
||||||
{
|
{
|
||||||
log_info("Packing DSPs...\n");
|
log_info("Packing DSPs...\n");
|
||||||
@ -1458,6 +1475,25 @@ struct NexusPacker
|
|||||||
replace_bus(ctx, ci, id_B, 0, true, preadd9_0, id_B, 0, false, 9);
|
replace_bus(ctx, ci, id_B, 0, true, preadd9_0, id_B, 0, false, 9);
|
||||||
replace_bus(ctx, ci, id_A, 0, true, mult9_0, id_A, 0, false, 9);
|
replace_bus(ctx, ci, id_A, 0, true, mult9_0, id_A, 0, false, 9);
|
||||||
replace_bus(ctx, ci, id_Z, 0, true, reg18_0, id_PP, 0, false, 18);
|
replace_bus(ctx, ci, id_Z, 0, true, reg18_0, id_PP, 0, false, 18);
|
||||||
|
replace_port(ci, id_SIGNEDA, mult9_0, id_ASIGNED);
|
||||||
|
replace_port(ci, id_SIGNEDB, preadd9_0, id_BSIGNED);
|
||||||
|
|
||||||
|
copy_port(ctx, ci, id_CLK, preadd9_0, id_CLK);
|
||||||
|
copy_port(ctx, ci, id_CLK, mult9_0, id_CLK);
|
||||||
|
copy_port(ctx, ci, id_CLK, reg18_0, id_CLK);
|
||||||
|
|
||||||
|
replace_port(ci, id_CEA, mult9_0, id_CEA);
|
||||||
|
replace_port(ci, id_RSTA, mult9_0, id_RSTA);
|
||||||
|
replace_port(ci, id_CEB, preadd9_0, id_CEB);
|
||||||
|
replace_port(ci, id_RSTB, preadd9_0, id_RSTB);
|
||||||
|
replace_port(ci, id_CEOUT, reg18_0, id_CEP);
|
||||||
|
replace_port(ci, id_RSTOUT, reg18_0, id_RSTP);
|
||||||
|
|
||||||
|
copy_param(ci, id_REGINPUTA, mult9_0, id_REGBYPSA1);
|
||||||
|
copy_param(ci, id_REGINPUTB, preadd9_0, id_REGBYPSBR0);
|
||||||
|
copy_param(ci, id_REGOUTPUT, reg18_0, id_REGBYPS);
|
||||||
|
|
||||||
|
copy_global_dsp_params(ci, preadd9_0);
|
||||||
auto_cascade_group(preadd9_0);
|
auto_cascade_group(preadd9_0);
|
||||||
to_remove.push_back(ci);
|
to_remove.push_back(ci);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user