The other minecraft logic synthesis projects have used this as their
placement benchmark, so it's good to match them.
/mc-mask/target
minecraft.lib
/mc-mask/target
minecraft.lib
-module counter #(parameter WIDTH=3, parameter MAX=(1<<WIDTH)-1) (
+module counter #(parameter WIDTH=4) (
input clock,
input reset,
input clock,
input reset,
output logic [WIDTH-1:0] count,
output logic [WIDTH-1:0] count,
-assign max = count == MAX;
-
always_ff @(posedge clock) begin
if (reset) count <= 0;
always_ff @(posedge clock) begin
if (reset) count <= 0;
- else if (!max) count <= count + 1;
+ else if (enable) count <= count + 1;
abc -liberty minecraft.lib
stat
show counter
abc -liberty minecraft.lib
stat
show counter