aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/greenpak4
diff options
context:
space:
mode:
authorAndrew Zonenberg <azonenberg@drawersteak.com>2016-12-10 18:46:36 +0800
committerAndrew Zonenberg <azonenberg@drawersteak.com>2016-12-10 18:46:36 +0800
commitc53a33143efc0ba2ee38fdb9f2ab8a4f16bde4b8 (patch)
tree6955ab8158a55f087760f141f7307676cee31687 /techlibs/greenpak4
parent797c03997e2e87416d7486197b079b6c273e2fa6 (diff)
downloadyosys-c53a33143efc0ba2ee38fdb9f2ab8a4f16bde4b8.tar.gz
yosys-c53a33143efc0ba2ee38fdb9f2ab8a4f16bde4b8.tar.bz2
yosys-c53a33143efc0ba2ee38fdb9f2ab8a4f16bde4b8.zip
greenpak4: Can now techmap inferred D latches (without set/reset or output inverter)
Diffstat (limited to 'techlibs/greenpak4')
-rw-r--r--techlibs/greenpak4/Makefile.inc1
-rw-r--r--techlibs/greenpak4/cells_latch.v15
-rw-r--r--techlibs/greenpak4/synth_greenpak4.cc1
3 files changed, 17 insertions, 0 deletions
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)