From c53a33143efc0ba2ee38fdb9f2ab8a4f16bde4b8 Mon Sep 17 00:00:00 2001 From: Andrew Zonenberg Date: Sat, 10 Dec 2016 18:46:36 +0800 Subject: [PATCH] greenpak4: Can now techmap inferred D latches (without set/reset or output inverter) --- techlibs/greenpak4/Makefile.inc | 1 + techlibs/greenpak4/cells_latch.v | 15 +++++++++++++++ techlibs/greenpak4/synth_greenpak4.cc | 1 + 3 files changed, 17 insertions(+) create mode 100644 techlibs/greenpak4/cells_latch.v diff --git a/techlibs/greenpak4/Makefile.inc b/techlibs/greenpak4/Makefile.inc index 1c9871e2f..7482af6c6 100644 --- a/techlibs/greenpak4/Makefile.inc +++ b/techlibs/greenpak4/Makefile.inc @@ -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 index 000000000..2ccdd2031 --- /dev/null +++ b/techlibs/greenpak4/cells_latch.v @@ -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 diff --git a/techlibs/greenpak4/synth_greenpak4.cc b/techlibs/greenpak4/synth_greenpak4.cc index dac256822..be12ab495 100644 --- a/techlibs/greenpak4/synth_greenpak4.cc +++ b/techlibs/greenpak4/synth_greenpak4.cc @@ -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) -- 2.30.2