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
+*.hex
+*.blif
-module counter #(parameter WIDTH=3, parameter MAX=(1<<WIDTH)-1) (
+module counter #(parameter WIDTH=4) (
input clock,
input reset,
+ input enable,
output logic [WIDTH-1:0] count,
- output logic max
);
-assign max = count == MAX;
-
always_ff @(posedge clock) begin
if (reset) count <= 0;
- else if (!max) count <= count + 1;
+ else if (enable) count <= count + 1;
end
endmodule
abc -liberty minecraft.lib
stat
show counter
+write_blif counter.blif