- Overview
- Key Features
- Architecture
- Design Methodology
- Performance Results
- Implementation Results
- Complete Design Flow
- Getting Started
- References
- Author
This project implements a scalable high-performance priority encoder using an innovative 1D-to-2D array conversion technique. The design demonstrates significant improvements in operating frequency and scalability through a semi-custom ASIC design flow using Cadence tools.
A priority encoder is a combinational circuit that outputs the binary representation of the highest-priority active input. Applications include:
- Interrupt handling in processors
- Data compression algorithms
- Network packet classification
- TCAM (Ternary Content Addressable Memory)
- Arbitration circuits
Traditional priority encoders face scalability challenges. This design converts L-bit linear input into an M×N matrix, enabling:
- Parallel processing of row and column priority detection
- Reduced critical path delay
- Better scalability for large input sizes
- Optimized (M, N) pairing for maximum performance
- 🚀 High Performance: Operating frequency up to 649 MHz for 64-bit encoder
- 📊 Scalable Design: Supports 4-bit to 4096-bit configurations
- ⚡ Superior Speed: 1.2× to 1.5× faster than state-of-the-art designs
- 🔧 Semi-Custom Flow: Complete RTL-to-GDS implementation
- 💡 Optimized Architecture: Smart matrix dimension selection
- 🎯 Verified Design: Comprehensive functional and timing verification
- 🔨 Industry Standard: 180nm/90nm/45nm CMOS technology
Block diagram of conventional priority encoder PE64 and Parallel priority encoder of 64-bit (PE64) (Kun et al. 2004)
The design transforms L-bit linear input into a 2D matrix structure:
L-bit Input Array
↓
M × N Matrix Formation
↓
├─→ Row Priority Encoder (N-bit)
└─→ Column Priority Encoder (M-bit)
↓
Index Combination Logic
↓
Final Priority Index Output
- Input Conversion Module: Arranges L-bit input into M×N matrix
- Row Priority Encoder: Detects highest priority in each row
- Column Priority Encoder: Determines active row with highest priority
- Output Logic: Combines row and column indices for final output
This project follows a complete RTL-to-GDS semi-custom design flow using Cadence tools:
RTL Design (Verilog)
↓
Functional Simulation (NCLaunch/Incisive)
↓
Logic Synthesis (Genus)
↓
Physical Design (Innovus)
├─→ Floorplanning
├─→ Power Planning
├─→ Placement
├─→ Clock Tree Synthesis
└─→ Routing
↓
Post-Layout Verification
↓
GDS II Generation
| Parameter | Specification |
|---|---|
| Process Nodes | 180nm / 90nm / 45nm CMOS |
| Supply Voltage | 1.8V (180nm), 1.0V (90nm), 0.9V (45nm) |
| Corner | TT (Typical-Typical) |
| Temperature | 25°C |
| Input Sizes | 4-bit, 8-bit, 16-bit, 64-bit, 64-bit with mux, 256-bit |
| Configuration | Matrix Size | Target Freq | Achieved Freq | Critical Path | Improvement |
|---|---|---|---|---|---|
| 64-bit | 16×4 | 500 MHz | 649 MHz | 1.54 ns | 1.2× |
| 256-bit | 64×4 | 400 MHz | 520 MHz | 1.92 ns | 1.5× |
This implementation achieves 1.2× to 1.5× higher operating frequency compared to conventional priority encoder designs, while maintaining scalability across different input sizes.
Before starting the design flow, ensure the following:
- Licensing Server is switched ON and client is connected
- Cadence Tools are properly installed and licensed
- Technology Libraries (180nm/90nm/45nm) are available
# Open terminal in project directory
csh
source /home/install/cshrc
# You should see: "Welcome to Cadence Tool Suite"Create Verilog RTL code for the priority encoder design.
Commands:
# Create RTL file
gedit priority_encoder_64bit.v
# Create testbench file
gedit tb_priority_encoder_64bit.vFiles to Create:
priority_encoder_4bit.v- 4-bit basic encoderpriority_encoder_8bit.v- 8-bit encoderpriority_encoder_64bit.v- 64-bit scalable encodertb_priority_encoder_64bit.v- Comprehensive testbench
Step 1: Launch NCLaunch
nclaunch -new # First time only
nclaunch # Subsequent runsStep 2: Create cds.lib File
- Select Multiple Step
- Select Create cds.lib
- Choose library type based on RTL (Verilog/VHDL)
- Save the cds.lib file
Step 3: Compilation, Elaboration, and Simulation
The simulation runs in 3 stages:
-
Compilation
- Select
.vor.vhdlfiles - Click on Verilog Compiler or VHDL Compiler
- Modules appear under "Worklib" after successful compilation
- Select
-
Elaboration
- Select module under Worklib
- Click Launch Elaborator
- "Snapshots" are generated on success
-
Simulation
- Select testbench under snapshots
- Click Launch Simulator
- Design Browser opens showing module hierarchy
Step 4: Waveform Analysis
- Right-click on signals → Send to Waveform Window
- Click Run simulation to start
- Use pause to stop simulation
- Analyze waveforms using zoom controls
Verification Checklist:
- ✓ All input combinations tested
- ✓ Priority logic verified
- ✓ Edge cases validated
- ✓ Timing behavior checked
Inputs Required:
- RTL Code (
.vor.vhdl) - Chip-level SDC (System Design Constraints)
- Liberty Files (
.lib)
Expected Outputs:
- Gate-level netlist
- Block-level netlist
- Timing, Area, Power reports
Synthesis Stages:
- Translation: RTL codes are compiled
- Elaboration/Mapping: Logic replaced with gates from libraries
- Optimization: Cell count reduction without functionality loss
Step 1: Create Synthesis Script
Create run.tcl:
# Set design name
set DESIGN priority_encoder_64bit
# Read Liberty files
read_libs /path/to/library.lib
# Read RTL
read_hdl priority_encoder_64bit.v
# Elaborate design
elaborate $DESIGN
# Read constraints
read_sdc constraints.sdc
# Synthesize to generic gates
syn_generic
# Synthesize to technology gates
syn_map
# Optimize design
syn_opt
# Write outputs
write_hdl > ${DESIGN}_netlist.v
write_sdc > ${DESIGN}_block.sdc
# Generate reports
report_timing > timing_report.txt
report_area > area_report.txt
report_power > power_report.txt
# Launch GUI
gui_showStep 2: Create SDC File
Create constraints.sdc:
# Clock definition
create_clock -name clk -period 2.0 [get_ports clk]
# Input/Output delays
set_input_delay -clock clk 0.5 [all_inputs]
set_output_delay -clock clk 0.5 [all_outputs]
# Load constraints
set_load 0.1 [all_outputs]Step 3: Run Synthesis
genus -f run.tclStep 4: Analyze Results
- Schematic Viewer: Right-click on design → Schematic Viewer → In Main
- Timing Report: Check worst timing paths
- Area Report: Verify cell count and total area
- Power Report: Analyze power consumption
Mandatory Inputs:
- Gate-level netlist (from Synthesis)
- Block-level SDC (from Synthesis)
- Liberty files (
.lib) - LEF files (Layer Exchange Format)
Expected Outputs:
- GDS II file (for fabrication)
- Post-layout netlists
- Timing, power, area reports
- DRC/LVS clean layout
Launch Innovus:
innovusStep 1: Create Globals File
Create design.globals:
# Set design name
set DESIGN priority_encoder_64bit
# Read LEF files
read_lef /path/to/tech.lef
read_lef /path/to/cells.lef
# Read netlist
read_netlist ${DESIGN}_netlist.v
# Initialize design
init_designStep 2: Create View File
Create design.view:
# Read Liberty files
read_libs /path/to/library.lib
# Read SDC
read_sdc ${DESIGN}_block.sdcStep 3: Import in Innovus
source design.globalsThe design is imported and core area is calculated automatically.
GUI Method:
- Select Floorplan → Specify Floorplan
- Set parameters:
- Aspect Ratio: 1.0 (square) or custom
- Core Utilization: 70-80%
- Core to I/O Spacing: 10-20 µm
Script Method:
floorPlan -r 1.0 0.7 10 10 10 10Parameters:
-r: Aspect ratio and core utilization- Last 4 values: Left, Bottom, Right, Top spacing
Step 1: Connect Global Nets
# GUI: Power → Connect Global Nets
# Add connections:
globalNetConnect VDD -type pgpin -pin VDD -inst * -override
globalNetConnect VSS -type pgpin -pin VSS -inst * -override
globalNetConnect VDD -type tiehi -inst * -override
globalNetConnect VSS -type tielo -inst * -overrideStep 2: Add Power Rings
# GUI: Power → Power Planning → Add Rings
addRing -nets {VDD VSS} \
-type core_rings \
-layer {top METAL9 bottom METAL9 left METAL8 right METAL8} \
-width 5 \
-spacing 2 \
-offset 2Parameters:
- Use highest metals (METAL8/METAL9) for lowest resistance
- Width: 5 µm (or as per design requirements)
- Spacing: 2 µm (minimum spacing)
Step 3: Add Power Stripes
# GUI: Power → Power Planning → Add Stripes
addStripe -nets {VDD VSS} \
-layer METAL8 \
-direction vertical \
-width 2 \
-spacing 2 \
-set_to_set_distance 20Step 4: Special Route (Add Vias)
# GUI: Route → Special Route
sroute -connect {corePin} \
-layerChangeRange {METAL1 METAL9} \
-blockPinTarget {nearestTarget} \
-allowJogging 1 \
-crossoverViaLayerRange {METAL1 METAL9} \
-nets {VDD VSS} \
-allowLayerChange 1This connects power mesh from highest metal to METAL1 (standard cells).
Step 1: Add End Caps
# GUI: Place → Physical Cell → Add End Caps
addEndCap -preCap ENDCAP -postCap ENDCAP -prefix ENDCAPEnd caps prevent standard cells from moving beyond core boundaries.
Step 2: Add Well Taps
# GUI: Place → Physical Cell → Add Well Tap
addWellTap -cell WELLTAP \
-cellInterval 30 \
-prefix WELLTAPWell taps prevent latch-up effects (typical interval: 30-45 µm).
Step 1: Run Placement
# GUI: Place → Place Standard Cell → Run Full Placement
# Enable "Place I/O Pins" option
place_design -concurrent_macrosStep 2: Generate Reports
# Timing Report (Pre-CTS Setup)
report_timing -late > reports/preCTS_setup_timing.rpt
# Area Report
report_area > reports/preCTS_area.rpt
# Power Report
report_power > reports/preCTS_power.rptStep 3: Optimize Design (Pre-CTS)
# GUI: ECO → Optimize Design
# Select: Design Stage = PreCTS, Optimization Type = Setup
optDesign -preCTS -setupStep 4: Generate Post-Optimization Reports
report_timing -late > reports/preCTS_setup_timing_opt.rpt
report_area > reports/preCTS_area_opt.rpt
report_power > reports/preCTS_power_opt.rptStep 1: Create CTS Script
Create cts_spec.tcl:
create_ccopt_clock_tree_spec -file ccopt.spec
source ccopt.spec
ccopt_designStep 2: Build Clock Tree
# Source CTS script
source cts_spec.tcl
# View clock tree
# GUI: Clock → CCOpt Clock Tree DebuggerThe clock tree uses buffers and inverters to distribute clock signal with minimal skew.
Step 3: Generate CTS Reports
# Setup Analysis
report_timing -late > reports/postCTS_setup_timing.rpt
# Hold Analysis
report_timing -early > reports/postCTS_hold_timing.rpt
# Area Report
report_area > reports/postCTS_area.rpt
# Power Report
report_power > reports/postCTS_power.rptStep 4: Optimize Design (Post-CTS)
# Setup Optimization
optDesign -postCTS -setup
# Hold Optimization
optDesign -postCTS -holdStep 5: Generate Post-Optimization Reports
report_timing -late > reports/postCTS_setup_timing_opt.rpt
report_timing -early > reports/postCTS_hold_timing_opt.rpt
report_area > reports/postCTS_area_opt.rpt
report_power > reports/postCTS_power_opt.rptStep 1: Run Nano Route
# GUI: Route → Nano Route → Route
# Enable: Timing Driven, SI Driven
routeDesign -globalDetailOptions:
- Timing Driven: Optimizes routing for timing
- SI Driven: Reduces signal integrity issues (crosstalk)
Step 2: Generate Post-Route Reports
# Setup Analysis
report_timing -late > reports/postRoute_setup_timing.rpt
# Hold Analysis
report_timing -early > reports/postRoute_hold_timing.rpt
# Area Report
report_area > reports/postRoute_area.rpt
# Power Report
report_power > reports/postRoute_power.rpt
# DRC Report
verify_drc -report reports/drc.rptStep 3: Optimize Design (Post-Route)
# Post-route optimization
optDesign -postRoute -setup
optDesign -postRoute -holdStep 4: Generate Final Reports
report_timing -late > reports/postRoute_setup_timing_final.rpt
report_timing -early > reports/postRoute_hold_timing_final.rpt
report_area > reports/postRoute_area_final.rpt
report_power > reports/postRoute_power_final.rptStep 1: Save Design Database
# Save Innovus database
saveDesign design.encStep 2: Save Netlist
# Save gate-level netlist with parasitics
saveNetlist priority_encoder_64bit_final.v -excludeLeafCellStep 3: Generate GDS II File
# Save GDS for fabrication
streamOut priority_encoder_64bit.gds \
-mapFile streamOut.map \
-libName DESIGN_LIB \
-units 1000 \
-mode ALLStep 4: Extract SDF for Simulation
# Extract delay information
write_sdf -version 3.0 priority_encoder_64bit.sdfStep 5: Generate Final Reports
# Summary report
summaryReport -outFile reports/summary.rpt
# Connection report
report_connectivity -file reports/connectivity.rpt
# Geometry report
report_geometry -file reports/geometry.rptStep 1: DRC (Design Rule Check)
verify_drc -report reports/drc_final.rptStep 2: LVS (Layout vs Schematic)
verifyConnectivity -report reports/lvs.rptStep 3: Timing Verification
- Use extracted SDF with gate-level netlist
- Run post-layout simulation with NCLaunch
- Verify setup and hold timing
# Required Tools
- Cadence Incisive/NCLaunch (RTL Simulation)
- Cadence Genus (Logic Synthesis)
- Cadence Innovus (Place & Route)
- Technology Libraries (180nm/90nm/45nm CMOS)# Clone Repository
git clone https://github.com/sohan2311/Scalable-High-Performance-Priority-Encoder-Using-1D-Array-to-2D-Array-Conversion.git
cd Scalable-High-Performance-Priority-Encoder-Using-1D-Array-to-2D-Array-Conversion
# Setup Cadence environment
csh
source /home/install/cshrc1. Run RTL Simulation:
cd simulation/nclaunch
nclaunch -new # First time
# Or
nclaunch # Subsequent runs2. Run Synthesis:
cd synthesis/scripts
genus -f rc_script.tcl -log ../logs/genus.log3. Run Physical Design:
cd pnr/scripts
innovus
# In Innovus prompt:
source run.tcl4. Complete Automated Flow:
# Run entire flow from RTL to GDS
./scripts/run_all.sh| Tool/Technology | Purpose | Version |
|---|---|---|
| Cadence Incisive/NCLaunch | RTL Simulation | 21.09 |
| Cadence Genus | Logic Synthesis | 21.1 |
| Cadence Innovus | Physical Design | 21.1 |
| GPDK 180nm | Technology Library | 180nm CMOS |
| GPDK 90nm | Technology Library | 90nm CMOS |
| GPDK 45nm | Technology Library | 45nm CMOS |
- RTL:
.v(Verilog),.vhdl(VHDL) - Testbench:
.v,.sv - Scripts:
.tcl(Tool Command Language) - Constraints:
.sdc(Synopsys Design Constraints) - Libraries:
.lib(Liberty),.lef(Layer Exchange Format) - Netlist:
.v(Gate-level Verilog) - Layout:
.gds(GDSII) - Timing:
.sdf(Standard Delay Format) - Database:
.enc(Innovus Database)
- Use appropriate clock period constraints
- Optimize critical paths during synthesis
- Enable timing-driven placement and routing
- Balance clock tree for minimal skew
- Use clock gating where applicable
- Select low-power cells from library
- Optimize switching activity
- Use power-aware synthesis options
- Increase core utilization (75-85%)
- Use area optimization during synthesis
- Remove redundant logic
- Share common sub-circuits
-
Huang, W.-C., & Oklobdzija, V. G. (2017). "A Scalable High-Performance Priority Encoder Using 1D-Array to 2D-Array Conversion." IEEE Transactions on Circuits and Systems—II: Express Briefs.
-
Cadence Design Systems - Genus Synthesis User Guide
-
Cadence Design Systems - Innovus Implementation User Guide
-
Weste, N. H. E., & Harris, D. (2011). CMOS VLSI Design: A Circuits and Systems Perspective (4th ed.).
Vikramaditya Singh Roll Number - 123EC0042
- GitHub: @vikramzw-max)
- Project Link: Priority Encoder Repository
Sohan Maity Roll Number - 523EC0001
- GitHub: @sohan2311
- Project Link: Priority Encoder Repository
For questions or collaboration:
- GitHub Issues: Open an Issue
- Email: [sohan.maity2311@gmail.com] [vikramzw@gmail.com]
⭐ If you find this project useful, please give it a star! ⭐
© 2025 | IIITDM Kurnool - All Rights Reserved.



/gui_schematic.png)
/Images/innovus/post_nano_optimisation_without_layer.png)
/Images/innovus/post_nano_optimisation_layout.png)
/Images/innovus/3d_layout_design.jpg)
/Images/innovus/3d_layout_back.jpg)
/Waveforms/wave1.png)
/Waveforms/wave2.png)
/Waveforms/wave3.png)
/Waveforms/wave4.png)
/Waveforms/wave5.png)
/Images/nclaunch/Genus Timing Analysis.png)
/Innovus Reports/post_power_analysis.jpg)
/Innovus Reports/post_area_analysis.jpg)