Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Optimize shifter synthesis in Design Compiler

Status
Not open for further replies.

oAwad

Full Member level 2
Joined
Feb 15, 2017
Messages
136
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,312
I'm using Design Compiler to synthesize a simple arithmetic right shifter in verilog
Code:
out = in >>> shift
"shift" is 5-bits, but I know the max. value "shift" can get is 17 so I don't need the whole 32-bit shifter. How to instruct Design Compiler to synthesize the shifter as just a 17-bit shifter?

Thanks
 

Make an intermediary variable called shift_lim that’s limited to 17 and use that instead.

Also note that the size of in and out will also limit the size of the shifter.
 

Make an intermediary variable called shift_lim that’s limited to 17 and use that instead.
how can I create a variable that's limited to 17?
Also note that the size of in and out will also limit the size of the shifter.
yes sure, but my concern is the "shift" signal, since it controls the levels of the barrel shifter.

Thanks
 

wire [4:0] shift_lim = (shift > 5’d17) ? 5’d17 : shift;

Admittedly this requires some intelligence in the synthesizer to understand how to optimize it but my understanding is that a modern synthesizer can do it. You could check the schematic to see exactly what it did.


Another fallback is a 17 case case statement explicitly handling the 17 possible shifts.
 
  • Like
Reactions: oAwad

    oAwad

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top