Skip to content

Add pipeline progress indicators to crun/circt-sim #16

@thomasnormal

Description

@thomasnormal

Problem

Long compilations and simulations are completely silent. Users can't tell if the tool is hung or making progress, especially for large UVM designs where initialization alone takes 4+ seconds.

Proposed Solution

Add a --verbose or --progress flag that prints pipeline stage transitions:

[crun] parsing sources... (3 files)
[crun] lowering to MLIR... done (1.2s)
[crun] running MooreToCore passes... done (0.8s)
[crun] initializing simulation... done (4.3s)
[crun] simulating...

Implementation

The infrastructure already exists:

  • circt-sim.cpp has reportStage() (lines 3130-3144) which uses std::chrono::steady_clock and prints [circt-sim] [stageName] X.XXXs (total: Y.YYYs)
  • crun.cpp has the pipeline stages clearly separated: parse → MooreToCore → simulation init → run

Changes needed:

  1. Add --verbose cl::opt to crun
  2. Wire reportStage() calls around each pipeline stage in crun's main()
  3. Print to stderr so it doesn't interfere with simulation output
  4. Consider a compact single-line progress mode for TTY (overwrite with \r)

Nice-to-have

  • Show signal/process counts after init: [crun] initialized: 1,234 signals, 56 processes
  • Show simulation progress: [crun] simulated 100ns (wall: 2.3s, 43 ns/s)
  • Quiet mode (default): no progress, only errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions