leonardt / fault

A Python package for testing hardware (part of the magma ecosystem)
BSD 3-Clause "New" or "Revised" License
41 stars 13 forks source link

update magma IO syntax #217

Closed hofstee closed 4 years ago

hofstee commented 4 years ago

How do you append to IO with the new syntax?

leonardt commented 4 years ago

There's an open issue on this here: https://github.com/phanrahan/magma/issues/596

For now, the best way would be to incrementally construct a python dictionary ("appending" by adding keys to the dictionary), then passing the dict to IO

leonardt commented 4 years ago

Another option is to keep IO as a list and do a

io = m.IO(**{key: value for key, value in zip(IO[::2], IO[1::2])})

but i think this will trigger a different warning (mixing IO and io), so ideally you'd also rename the IO list to be something like IO_

leonardt commented 4 years ago

Manually fixing up these cases might be okay though, if writing the script is too tricky

leonardt commented 4 years ago

(Let me know if that's the case and I can go ahead and take care of the manual fixes)

hofstee commented 4 years ago

I think these might need to be manually handled. ~(Maybe you could still do io += m.ClkInterface()?)~