greenpak4: Can now techmap inferred D latches (without set/reset or output inverter)
authorAndrew Zonenberg <azonenberg@drawersteak.com>
Sat, 10 Dec 2016 10:46:36 +0000 (18:46 +0800)
committerAndrew Zonenberg <azonenberg@drawersteak.com>
Sat, 10 Dec 2016 10:46:36 +0000 (18:46 +0800)
techlibs/greenpak4/Makefile.inc
techlibs/greenpak4/cells_latch.v [new file with mode: 0644]
techlibs/greenpak4/synth_greenpak4.cc

index 1c9871e2f4772426eababa0e170db253f1f2e015..7482af6c6f5443d52ac9378d6eee1b22da187545 100644 (file)
@@ -3,6 +3,7 @@ OBJS += techlibs/greenpak4/synth_greenpak4.o
 OBJS += techlibs/greenpak4/greenpak4_counters.o
 OBJS += techlibs/greenpak4/greenpak4_dffinv.o
 
+$(eval $(call add_share_file,share/greenpak4,techlibs/greenpak4/cells_latch.v))
 $(eval $(call add_share_file,share/greenpak4,techlibs/greenpak4/cells_map.v))
 $(eval $(call add_share_file,share/greenpak4,techlibs/greenpak4/cells_sim.v))
 $(eval $(call add_share_file,share/greenpak4,techlibs/greenpak4/gp_dff.lib))
diff --git a/techlibs/greenpak4/cells_latch.v b/techlibs/greenpak4/cells_latch.v
new file mode 100644 (file)
index 0000000..2ccdd20
--- /dev/null
@@ -0,0 +1,15 @@
+module $_DLATCH_P_(input E, input D, output Q);
+       GP_DLATCH _TECHMAP_REPLACE_ (
+               .D(D),
+               .nCLK(!E),
+               .Q(Q)
+               );
+endmodule
+
+module $_DLATCH_N_(input E, input D, output Q);
+       GP_DLATCH _TECHMAP_REPLACE_ (
+               .D(D),
+               .nCLK(E),
+               .Q(Q)
+               );
+endmodule
index dac256822ef4477d1df9c77a3596031ac9110104..be12ab4955d68f7c414bac42363dd1128116a227 100644 (file)
@@ -161,6 +161,7 @@ struct SynthGreenPAK4Pass : public ScriptPass
                        run("memory_map");
                        run("opt -undriven -fine");
                        run("techmap");
+                       run("techmap -map +/greenpak4/cells_latch.v");
                        run("dfflibmap -prepare -liberty +/greenpak4/gp_dff.lib");
                        run("opt -fast");
                        if (retime || help_mode)