From f1579304a6e59f832e24fe9cfea6509cbdd6398b Mon Sep 17 00:00:00 2001 From: Lofty Date: Sat, 18 Oct 2025 12:10:50 +0100 Subject: [PATCH] analogdevices: DSP tweaks --- techlibs/analogdevices/cells_sim.v | 13 ++++++++++--- techlibs/analogdevices/synth_analogdevices.cc | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/techlibs/analogdevices/cells_sim.v b/techlibs/analogdevices/cells_sim.v index 573259472..402c421fa 100644 --- a/techlibs/analogdevices/cells_sim.v +++ b/techlibs/analogdevices/cells_sim.v @@ -1014,6 +1014,7 @@ endmodule // DSP +(* abc9_box *) module RBBDSP ( output [21:0] AO_LOC, output [21:0] BO_LOC, @@ -1025,9 +1026,9 @@ module RBBDSP ( output [47:0] PO_LOC, output RST_O, - input [1:0] CI_LOC, - input [1:0] OPCODE, - input [1:0] OPCODE_I, + input [1:0] CI_LOC, + input [1:0] OPCODE, + input [1:0] OPCODE_I, input [21:0] A, input [21:0] AI_LOC, input [21:0] B, @@ -1087,6 +1088,12 @@ parameter REG_SFT = 1'b0; parameter RST_SEL = 1'b0; parameter FF_SYNC_RST = 1'b0; +specify + if (!REG_A) (A *> P) = 1000; + if (!REG_B) (B *> P) = 1000; + if (!REG_D[0]) (D *> P) = 1000; +endspecify + // Much of this functionality is TODO. assign P = $signed(A) * $signed(B); diff --git a/techlibs/analogdevices/synth_analogdevices.cc b/techlibs/analogdevices/synth_analogdevices.cc index c6514d4aa..18619de7a 100644 --- a/techlibs/analogdevices/synth_analogdevices.cc +++ b/techlibs/analogdevices/synth_analogdevices.cc @@ -313,7 +313,7 @@ struct SynthAnalogDevicesPass : public ScriptPass if (check_label("map_dsp", "(skip if '-nodsp')")) { if (!nodsp || help_mode) { run("memory_dff"); // xilinx_dsp will merge registers, reserve memory port registers first - // NB: Xilinx multipliers are signed only + // NB: Analog Devices multipliers are signed only if (help_mode) run("techmap -map +/mul2dsp.v -map +/analogdevices/{family}_dsp_map.v {options}"); run("techmap -map +/mul2dsp.v -map +/analogdevices/dsp_map.v -D DSP_A_MAXWIDTH=22 -D DSP_B_MAXWIDTH=22 "