From: Andrew Zonenberg Date: Sat, 10 Dec 2016 10:46:36 +0000 (+0800) Subject: greenpak4: Can now techmap inferred D latches (without set/reset or output inverter) X-Git-Tag: yosys-0.8~553^2^2~20 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c53a33143efc0ba2ee38fdb9f2ab8a4f16bde4b8;p=yosys.git greenpak4: Can now techmap inferred D latches (without set/reset or output inverter) --- 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)