From: Andrew Zonenberg Date: Wed, 13 Sep 2017 22:47:06 +0000 (-0700) Subject: Added RESET_TO_MAX parameter to $__COUNT_ cell. Cannot yet be extracted. X-Git-Tag: yosys-0.8~320^2~2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=122532b7e137a53a91be155668687246a25d27e7;p=yosys.git Added RESET_TO_MAX parameter to $__COUNT_ cell. Cannot yet be extracted. --- diff --git a/passes/techmap/extract_counter.cc b/passes/techmap/extract_counter.cc index 3746a3cb6..1e20b1fd8 100644 --- a/passes/techmap/extract_counter.cc +++ b/passes/techmap/extract_counter.cc @@ -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)); diff --git a/techlibs/greenpak4/cells_blackbox.v b/techlibs/greenpak4/cells_blackbox.v index 8dd38a027..1895b90de 100644 --- a/techlibs/greenpak4/cells_blackbox.v +++ b/techlibs/greenpak4/cells_blackbox.v @@ -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; diff --git a/techlibs/greenpak4/cells_map.v b/techlibs/greenpak4/cells_map.v index 9897d4e35..b971a51fa 100644 --- a/techlibs/greenpak4/cells_map.v +++ b/techlibs/greenpak4/cells_map.v @@ -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_ (