From 6e12da3956a1960ce62ba389b10f02ef21a43291 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Fri, 31 Mar 2023 13:36:36 +0200 Subject: machxo2: Initial support for carry chains (CCU2D) --- techlibs/machxo2/synth_machxo2.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'techlibs/machxo2/synth_machxo2.cc') diff --git a/techlibs/machxo2/synth_machxo2.cc b/techlibs/machxo2/synth_machxo2.cc index 4ca6351bd..3008527e0 100644 --- a/techlibs/machxo2/synth_machxo2.cc +++ b/techlibs/machxo2/synth_machxo2.cc @@ -69,6 +69,9 @@ struct SynthMachXO2Pass : public ScriptPass log(" -noiopad\n"); log(" do not insert IO buffers\n"); log("\n"); + log(" -ccu2\n"); + log(" use CCU2 cells in output netlist\n"); + log("\n"); log(" -vpr\n"); log(" generate an output netlist (and BLIF file) suitable for VPR\n"); log(" (this feature is experimental and incomplete)\n"); @@ -80,7 +83,7 @@ struct SynthMachXO2Pass : public ScriptPass } string top_opt, blif_file, edif_file, json_file; - bool nobram, nolutram, flatten, vpr, noiopad; + bool ccu2, nobram, nolutram, flatten, vpr, noiopad; void clear_flags() override { @@ -88,6 +91,7 @@ struct SynthMachXO2Pass : public ScriptPass blif_file = ""; edif_file = ""; json_file = ""; + ccu2 = false; nobram = false; nolutram = false; flatten = true; @@ -147,6 +151,10 @@ struct SynthMachXO2Pass : public ScriptPass noiopad = true; continue; } + if (args[argidx] == "-ccu2") { + ccu2 = true; + continue; + } if (args[argidx] == "-vpr") { vpr = true; continue; @@ -204,14 +212,17 @@ struct SynthMachXO2Pass : public ScriptPass if (check_label("fine")) { + run("opt -fast -mux_undef -undriven -fine"); run("memory_map"); - run("opt -full"); - run("techmap -map +/techmap.v"); - run("opt -fast"); + run("opt -undriven -fine"); } - if (check_label("map_ios", "(unless -noiopad)")) + if (check_label("map_gates", "(unless -noiopad)")) { + if (!ccu2) + run("techmap"); + else + run("techmap -map +/techmap.v -map +/machxo2/arith_map.v"); if (!noiopad || help_mode) { run("iopadmap -bits -outpad OB I:O -inpad IB O:I -toutpad OBZ ~T:I:O -tinoutpad BB ~T:O:I:B A:top", "(only if '-iopad')"); -- cgit v1.2.3