ecp5: Add latch inference
authorDavid Shah <dave@ds0.me>
Thu, 18 Oct 2018 18:39:48 +0000 (19:39 +0100)
committerDavid Shah <dave@ds0.me>
Fri, 19 Oct 2018 14:16:40 +0000 (15:16 +0100)
Signed-off-by: David Shah <dave@ds0.me>
techlibs/ecp5/Makefile.inc
techlibs/ecp5/latches_map.v [new file with mode: 0644]
techlibs/ecp5/synth_ecp5.cc

index f4585939260585eeef7bc04424bb483a857baab3..9b6f061bd3b3acf10aad404cf2a2ffb0b5b7744b 100644 (file)
@@ -8,6 +8,7 @@ $(eval $(call add_share_file,share/ecp5,techlibs/ecp5/dram.txt))
 $(eval $(call add_share_file,share/ecp5,techlibs/ecp5/brams_map.v))
 $(eval $(call add_share_file,share/ecp5,techlibs/ecp5/bram.txt))
 $(eval $(call add_share_file,share/ecp5,techlibs/ecp5/arith_map.v))
+$(eval $(call add_share_file,share/ecp5,techlibs/ecp5/latches_map.v))
 
 EXTRA_OBJS += techlibs/ecp5/brams_init.mk techlibs/ecp5/brams_connect.mk
 .SECONDARY: techlibs/ecp5/brams_init.mk techlibs/ecp5/brams_connect.mk
diff --git a/techlibs/ecp5/latches_map.v b/techlibs/ecp5/latches_map.v
new file mode 100644 (file)
index 0000000..c28f88c
--- /dev/null
@@ -0,0 +1,11 @@
+module \$_DLATCH_N_ (E, D, Q);
+  wire [1023:0] _TECHMAP_DO_ = "simplemap; opt";
+  input E, D;
+  output Q = !E ? D : Q;
+endmodule
+
+module \$_DLATCH_P_ (E, D, Q);
+  wire [1023:0] _TECHMAP_DO_ = "simplemap; opt";
+  input E, D;
+  output Q = E ? D : Q;
+endmodule
index ab56a94442c8f8d5479cd91f5e40e4b1172b937f..cb6a4c3d8c2a5f67bd3114f82622c2227ad90ab3 100644 (file)
@@ -266,10 +266,7 @@ struct SynthEcp5Pass : public ScriptPass
                        if (abc2 || help_mode) {
                                run("abc", "      (only if -abc2)");
                        }
-                       //TODO
-#if 0
                        run("techmap -map +/ecp5/latches_map.v");
-#endif
                        if (nomux)
                                run("abc -lut 4");
                        else