Ready-to-run snippets

Code Examples

Ready-to-run Verilog, SystemVerilog, and UVM examples. Click any to open it live in the IDE.

← All examples

PD: 8-bit Counter, First Place and Route

Verilog Physical Design

An 8-bit counter to take through synthesis and Place and Route: 28 cells, about 300 um2 at 50 % utilization.

Open in IDE
design.v
module counter8 (
  input            clk,
  input            rst,
  input            en,
  output reg [7:0] q
);
  always @(posedge clk) begin
    if (rst)
      q <= 8'd0;
    else if (en)
      q <= q + 8'd1;
  end
endmodule
constraints.sdc
create_clock -name clk -period 5.0 [get_ports clk]
set_input_delay 1.0 -clock clk [get_ports {rst en}]
set_output_delay 1.0 -clock clk [get_ports q*]
Admin mode — edit and delete controls are visible on each row. Use the IDE to add new snippets via File → Save as Snippet.