intel_alm: better map wide but shallow multiplies
authorDan Ravensloft <dan.ravensloft@gmail.com>
Wed, 26 Aug 2020 20:47:06 +0000 (21:47 +0100)
committerMarcelina Koƛcielnicka <mwk@0x04.net>
Fri, 28 Aug 2020 21:44:16 +0000 (23:44 +0200)
techlibs/intel_alm/synth_intel_alm.cc

index faa405df7c3418702dff2532c4133ce9df7f68d5..6719eb65cd0e2d1a82e2fc3094f73c99cac642dc 100644 (file)
@@ -214,10 +214,14 @@ struct SynthIntelALMPass : public ScriptPass {
                                run("techmap -map +/mul2dsp.v [...]", "(unless -nodsp)");
                        } else if (!nodsp) {
                                // Cyclone V supports 9x9 multiplication, Cyclone 10 GX does not.
-                               run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=27 -D DSP_B_MAXWIDTH=27  -D DSP_A_MINWIDTH=19 -D DSP_B_MINWIDTH=19 -D DSP_NAME=__MUL27X27");
+                               run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=27 -D DSP_B_MAXWIDTH=27  -D DSP_A_MINWIDTH=19 -D DSP_B_MINWIDTH=4 -D DSP_NAME=__MUL27X27");
+                               run("chtype -set $mul t:$__soft_mul");
+                               run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=27 -D DSP_B_MAXWIDTH=27  -D DSP_A_MINWIDTH=4 -D DSP_B_MINWIDTH=19 -D DSP_NAME=__MUL27X27");
                                run("chtype -set $mul t:$__soft_mul");
                                if (family_opt == "cyclonev") {
-                                       run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=18 -D DSP_B_MAXWIDTH=18  -D DSP_A_MINWIDTH=10 -D DSP_B_MINWIDTH=10 -D DSP_NAME=__MUL18X18");
+                                       run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=18 -D DSP_B_MAXWIDTH=18  -D DSP_A_MINWIDTH=10 -D DSP_B_MINWIDTH=4 -D DSP_NAME=__MUL18X18");
+                                       run("chtype -set $mul t:$__soft_mul");
+                                       run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=18 -D DSP_B_MAXWIDTH=18  -D DSP_A_MINWIDTH=4 -D DSP_B_MINWIDTH=10 -D DSP_NAME=__MUL18X18");
                                        run("chtype -set $mul t:$__soft_mul");
                                        run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=9 -D DSP_B_MAXWIDTH=9  -D DSP_A_MINWIDTH=4 -D DSP_B_MINWIDTH=4 -D DSP_NAME=__MUL9X9");
                                        run("chtype -set $mul t:$__soft_mul");