cornell-brg / pymtl

Python-based hardware modeling framework
BSD 3-Clause "New" or "Revised" License
237 stars 82 forks source link

Member and temporary variables with same name cause problems in verilog translation #86

Open dmlockhart opened 10 years ago

dmlockhart commented 10 years ago

The following code in PyMTL is valid, but causes issues during Verilog translation:


  def __init__(s):
    s.in_ = InPort(1)
    s.signal_name = OutPort(1)
  def elaborate_logic(s):
    s.combinational
    def logic():
      signal_name = s.another_signal

This will result in a redundant (and erroneous) signal declaration in the translated Verilog:

  ...
  input wire [0:0] in_,
  output wire [0:0] signal_name
  ...
  reg [0:0] signal_name;