cornell-brg / pymtl

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

possible bug in pclib/ifcs/ValRdyBundle.py #183

Open 3gx opened 4 years ago

3gx commented 4 years ago

Hi,

Was going through PymTL Tutorial3, and noticed something funny on Fig.41 and it is the same i the code: https://github.com/cornell-brg/pymtl/blob/master/pclib/ifcs/ValRdyBundle.py#L28

1:  def to_str( self, msg=None ):
2:   msg = self.msg if None else msg
3:   return valrdy_to_str( msg, self.val, self.rdy )

Shouldn't line 2 be :

msg = self.msg if msg is None else msg

Thanks

cbatten commented 4 years ago

Hmmm ... I think so? Note that pymtl2 will be deprecated this fall. We are working on pymtl3 -- a brand new and much better update!

3gx commented 4 years ago

Great. Will models written for pymtl2 be compatible with pymtl3? If not, is there a porting guide from pymtl2 -> pymtl3. Thanks

cbatten commented 4 years ago

They will not be compatible out of the box but the translation should be relatively straightforward. We are looking forward to the official pymtl3 3.0 release later this fall.