Skip to content

Wires used but never driven #422

@JulianKemmerer

Description

@JulianKemmerer

Hi there,

I am quite unsure if this issue stems from PyRTL itself and am looking for some feedback/suggestions.

I have a flow where I am doing timing analysis on VHDL code.

VHDL -> GHDL plugin for yosys -> yosys write_blif -> pyrtl.input_from_blif

PyRTL steps look like:
processor_instances_0CLK_a3e7f19d_top.blif.zip

import pyrtl
pyrtl.reset_working_block()
print("Opening .blif...", flush=True)
f=open("processor_instances_0CLK_a3e7f19d_top.blif")
blif = f.read()
pyrtl.input_from_blif(blif)
#print("Optimizing...", flush=True)
#pyrtl.optimize(skip_sanity_check=True)
print("Computing FMAX...", flush=True)
timing = pyrtl.TimingAnalysis()
print("Fmax (MHz):", timing.max_freq(), flush=True)
Traceback (most recent call last):
  File "COPY_processor_instances_0CLK_a3e7f19d_top.py", line 10, in <module>
    timing = pyrtl.TimingAnalysis()
  File "/home/julian/.local/lib/python3.8/site-packages/pyrtl/analysis.py", line 165, in __init__
    self.block.sanity_check()
  File "/home/julian/.local/lib/python3.8/site-packages/pyrtl/core.py", line 557, in sanity_check
    raise PyrtlError('Wires used but never driven: %s \n\n %s' %
pyrtl.pyrtlexceptions.PyrtlError: Wires used but never driven: ['tmp1983138', 'tmp1082396', 'tmp1822303', 'tmp1983160', 'tmp1757923', 'tmp278173', 'tmp889418', 'tmp1114543', 'tmp1725667', 'tmp1050205', 'tmp85153', ' ... ALOT OF THESE

Previously I was happy with results from adding in those two commented out lines

print("Optimizing...", flush=True)
pyrtl.optimize(skip_sanity_check=True)

It was apparently doing what was needed to trim the unused/undriven? wires...

The cause for this issue is that pyrtl.optimize is taking a long time (and this is a ~smaller version of the design). I think it is doing more than the bare minimum I need it to regarding the Wires used but never driven tmp wires.

Maybe adding a skip_sanity_check=True option to TimingAnalysis could work?

Or I think the _remove_unlistened_nets step in optmize is all I need?

Open to any comments+suggestions on the whole flow using the tools

Thanks folks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions