cornell-brg/pymtl

Support `s.connect()` with constant `Bits` object

Opened this issue · 0 comments

It looks likes pymtl is unable to support using Bits objects as constants. For example, if we wish to connect a constant to an input port, pymtl will accept a constant literal, but not a bits object:

  # A left-shift

  s.lshift = LeftLogicalShifter( a_nbits, 1 )
  ...
  s.connect( Bits( 1, 1 ), s.lshift.shamt )

Causes py.test to complain:

E     AttributeError: 'Bits' object has no attribute '_signal'

However, using a constant literal, instead, causes no such error:

  # A left-shift

  s.lshift = LeftLogicalShifter( a_nbits, 1 )
  ...
  s.connect( 1, s.lshift.shamt )