diff --git a/src/bin/nl_opt.rs b/src/bin/nl_opt.rs index 6b27324e..27ec5a99 100644 --- a/src/bin/nl_opt.rs +++ b/src/bin/nl_opt.rs @@ -195,9 +195,27 @@ impl Pass for MarkCriticalPath { } } -register_passes!(PrimitiveCell; PrintVerilog, DotGraph, Clean, DisconnectRegisters, - DisconnectArcSet, MarkArcSet, RenameNets, ReportSccs, - ReportDepth, MarkCriticalPath); +register_passes!(PrimitiveCell; + /// A dummy pass that emits the Verilog of the netlist. + PrintVerilog, + /// Print the dot graph of the netlist + DotGraph, + /// Clean the netlist of cells which are not used + Clean, + /// Disconnect all register inputs + DisconnectRegisters, + /// Disconnect wires based on greedy arc set heuristic, creating a DAG + DisconnectArcSet, + /// Rename wires and instances that are part of the feedback arc set (prefixed with "arc_") + MarkArcSet, + /// Rename wires and instances sequentially 0, 1, ... + RenameNets, + /// Report the number of strongly connected components + ReportSccs, + /// Report the longest path in the netlist + ReportDepth, + /// Mark the node names of cells along the critical path (prefixed with "crit_") + MarkCriticalPath); /// Netlist optimization debugging tool #[derive(Parser, Debug)] diff --git a/src/pass.rs b/src/pass.rs index 9372b94d..390ef771 100644 --- a/src/pass.rs +++ b/src/pass.rs @@ -37,13 +37,28 @@ pub trait Pass { } /// Register all these passes in an enum for clap args +/// +/// # Example +/// ``` +/// use eqmap::register_passes; +/// use eqmap::netlist::PrimitiveCell; +/// use eqmap::pass::PrintVerilog; +/// // This defines a enum called `Passes` with unit variants. +/// // They operate on netlists containing `PrimitiveCell` cells. +/// register_passes!(PrimitiveCell; +/// /// A dummy pass that emits the Verilog of the netlist. +/// PrintVerilog); +/// ``` #[macro_export] macro_rules! register_passes { - ($i:ty ; $($pass:ident),+ $(,)?) => { + ($i:ty ; $($(#[$meta:meta])* $pass:ident),+ $(,)?) => { /// Enum containing all registered passes for argument parsing. #[derive(Debug, Clone, Copy, PartialEq, Eq, clap::ValueEnum)] pub enum Passes { - $($pass),+ + $( + $(#[$meta])* + $pass + ),+ } impl std::fmt::Display for Passes {