Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from nmigen import *
- from nmigen_boards.icebreaker import ICEBreakerPlatform
- class Example(Elaboratable):
- def elaborate(self, platform):
- clk12 = platform.request('clk12')
- led = platform.request('user_led')
- pll_clk = Signal()
- pll_lock = Signal()
- counter = Signal(25)
- cd_pll = ClockDomain('pll')
- pll = Instance('SB_PLL40_PAD',
- p_FEEDBACK_PATH='SIMPLE',
- p_DIVR=0b0000,
- p_DIVF=0b1001111,
- p_DIVQ=0b100,
- p_FILTER_RANGE=0b001,
- i_PACKAGEPIN=clk12,
- o_PLLOUTGLOBAL=pll_clk,
- o_LOCK=pll_lock,
- i_RESETB=Signal(reset=1),
- i_BYPASS=Signal(reset=0))
- m = Module()
- m.domains.pll = cd_pll
- m.submodules += pll
- m.d.comb += cd_pll.clk.eq(pll_clk)
- m.d.pll += counter.eq(counter + 1)
- m.d.comb += led.eq(counter[counter.nbits - 1])
- return m
- ICEBreakerPlatform().build(Example(), do_program=True)
- # Fails with
- #
- # ERROR: PLL '$3' has a PACKAGEPIN driven by an SB_GB, should be directly connected to an input SB_IO.D_IN_0 port
- # ERROR: Packing design failed.
- # 0 warnings, 2 errors
- # Traceback (most recent call last):
- # File "example3.py", line 39, in <module>
- # ICEBreakerPlatform().build(Example(), do_program=True)
- # File "/Users/kbob/Documents/Code/github/m-labs/nmigen/nmigen/build/plat.py", line 74, in build
- # products = plan.execute_local(build_dir)
- # File "/Users/kbob/Documents/Code/github/m-labs/nmigen/nmigen/build/run.py", line 98, in execute_local
- # subprocess.check_call(["sh", "{}.sh".format(self.script)])
- # File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 347, in check_call
- # raise CalledProcessError(retcode, cmd)
- # subprocess.CalledProcessError: Command '['sh', 'build_top.sh']' returned non-zero exit status 255.
Add Comment
Please, Sign In to add comment