Added RESET_TO_MAX parameter to $__COUNT_ cell. Cannot yet be extracted.
authorAndrew Zonenberg <azonenberg@drawersteak.com>
Wed, 13 Sep 2017 22:47:06 +0000 (15:47 -0700)
committerAndrew Zonenberg <azonenberg@drawersteak.com>
Thu, 14 Sep 2017 17:26:32 +0000 (10:26 -0700)
passes/techmap/extract_counter.cc
techlibs/greenpak4/cells_blackbox.v
techlibs/greenpak4/cells_map.v

index 3746a3cb6a66454c4d43fee9aaaa129f858ae51e..1e20b1fd8dcbfcba2084ab880c021d2d81a37b1a 100644 (file)
@@ -493,6 +493,7 @@ void counter_worker(
 
        //Hook up hard-wired ports (for now up/down are not supported), default to no parallel output
        cell->setParam("\\HAS_POUT", RTLIL::Const(0));
+       cell->setParam("\\RESET_TO_MAX", RTLIL::Const(0));
        cell->setParam("\\DIRECTION", RTLIL::Const("DOWN"));
        cell->setPort("\\CE", RTLIL::Const(1));
        cell->setPort("\\UP", RTLIL::Const(0));
index 8dd38a0272c80c0eef754107777ce8c340c2881b..1895b90de858dd4dd7860266ac0e7c07eec76d7a 100644 (file)
@@ -9,6 +9,7 @@ module \$__COUNT_ (CE, CLK, OUT, POUT, RST, UP);
 
        parameter COUNT_TO = 1;
        parameter RESET_MODE = "RISING";
+       parameter RESET_TO_MAX = "1";
        parameter HAS_POUT = 0;
        parameter HAS_CE = 0;
        parameter WIDTH = 8;
index 9897d4e357984ef29805cca1a0b6b84fd0da4e76..b971a51faa929bacaf2d2fda581b5220662c22d1 100644 (file)
@@ -156,6 +156,7 @@ module \$__COUNT_ (CE, CLK, OUT, POUT, RST, UP);
 
        parameter COUNT_TO = 1;
        parameter RESET_MODE = "RISING";
+       parameter RESET_TO_MAX = 0;
        parameter HAS_POUT = 0;
        parameter HAS_CE = 0;
        parameter WIDTH = 8;
@@ -196,7 +197,7 @@ module \$__COUNT_ (CE, CLK, OUT, POUT, RST, UP);
                        GP_COUNT8_ADV #(
                                .COUNT_TO(COUNT_TO),
                                .RESET_MODE(RESET_MODE),
-                               .RESET_VALUE("COUNT_TO"),
+                               .RESET_VALUE(RESET_TO_MAX ? "COUNT_TO" : "ZERO"),
                                .CLKIN_DIVIDE(1)
                        ) _TECHMAP_REPLACE_ (
                                .CLK(CLK),
@@ -230,7 +231,7 @@ module \$__COUNT_ (CE, CLK, OUT, POUT, RST, UP);
                        );
                        GP_COUNT14_ADV #(
                                .COUNT_TO(COUNT_TO),
-                               .RESET_MODE(RESET_MODE),
+                               .RESET_MODE(RESET_TO_MAX ? "COUNT_TO" : "ZERO"),
                                .RESET_VALUE("COUNT_TO"),
                                .CLKIN_DIVIDE(1)
                        ) _TECHMAP_REPLACE_ (