m-labs / migen

A Python toolbox for building complex digital hardware
https://m-labs.hk/migen
Other
1.21k stars 209 forks source link

tutorial out of date (was: Issue with importing Signal) #80

Open sheeets opened 6 years ago

sheeets commented 6 years ago

In your documentation I've seen you import in these 2 ways:

>>> from migen.fhdl.std import *
or
>>> from migen.fhdl import *

However, when I try to do run this command:

>>> a = Signal(1)
NameError: name 'Signal' is not defined

but this works when I do:

>>> from migen import *
>>> a = Signal(1)

Is this due to some change along the way in regards to how the modules are setup?

>>> type(Signal())
migen.fhdl.structure.Signal
sbourdeauducq commented 6 years ago

migen.fhdl.std has been removed. Where in the documentation is it still mentioned?

sheeets commented 6 years ago

It was a tutorial from 2014. Is from migen.fhdl import * the correct import statement to use Signal()?

sbourdeauducq commented 6 years ago

No, usually you want from migen import *.