YosysHQ / yosys

Yosys Open SYnthesis Suite
https://yosyshq.net/yosys/
ISC License
3.5k stars 895 forks source link

portarcs: New command to derive propagation arcs #4736

Closed povik closed 1 week ago

povik commented 1 week ago

What are the reasons/motivation for this change?

To preserve boundaries of arithmetic operators we need to synthesize them separately and box them for synthesis of the surrounding logic. We need to characterize the propagation delay of this box so the technology mapper is aware of it, this characterization step is where this new command comes in.

Help sample:


    portarcs [options] [selection]

This command characterizes the combinational content of selected modules and
derives timing arcs going from module inputs to module outputs representing the
propagation delay of the module.

    -draw
        plot the computed delay table to the terminal

    -icells
        assign unit delay to gates from the internal Yosys cell library

    -write
        write the computed arcs back into the module as $specify2 instances
povik commented 1 week ago

Sample plot of a mapped $alu (columns inputs, rows outputs):

Screenshot 2024-11-13 at 16 24 48

Ravenslofty commented 1 week ago

To review #4737 I should probably look at what this does.

My first question is: where's the timing data coming from? The timinginfo.h stuff deals with Verilog specify rules, and this is intended for use in ASIC flows, right? Does this assume the gates have already been STA'd and turned into specify rules for Yosys to parse?

(or is the idea to just use -icells and punt that problem down the road?)

povik commented 1 week ago

Does this assume the gates have already been STA'd and turned into specify rules for Yosys to parse?

It does assume having specify rules for the gates, currently the main way to get those is with read_liberty -unit_delay; later we can have read_liberty -gain_model X to match ABC's read_lib -G X

The philosophy here is that $specify2 arcs on gate definitions are enough to match the timing model used by ABC internally

Ravenslofty commented 1 week ago

This is maybe a little big to Just Merge It, but I don't think there's much to discuss/dispute, so whatever.