kernelbob

Error instantiating PLL

Sep 10th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.98 KB | None | 0 0
  1. from nmigen import *
  2. from nmigen_boards.icebreaker import ICEBreakerPlatform
  3.  
  4. class Example(Elaboratable):
  5.  
  6.     def elaborate(self, platform):
  7.         clk12 = platform.request('clk12')
  8.         led = platform.request('user_led')
  9.         pll_clk = Signal()
  10.         pll_lock = Signal()
  11.         counter = Signal(25)
  12.         cd_pll = ClockDomain('pll')
  13.         pll = Instance('SB_PLL40_PAD',
  14.             p_FEEDBACK_PATH='SIMPLE',
  15.             p_DIVR=0b0000,
  16.             p_DIVF=0b1001111,
  17.             p_DIVQ=0b100,
  18.             p_FILTER_RANGE=0b001,
  19.             i_PACKAGEPIN=clk12,
  20.             o_PLLOUTGLOBAL=pll_clk,
  21.             o_LOCK=pll_lock,
  22.             i_RESETB=Signal(reset=1),
  23.             i_BYPASS=Signal(reset=0))
  24.         m = Module()
  25.         m.domains.pll = cd_pll
  26.         m.submodules += pll
  27.         m.d.comb += cd_pll.clk.eq(pll_clk)
  28.         m.d.pll += counter.eq(counter + 1)
  29.         m.d.comb += led.eq(counter[counter.nbits - 1])
  30.         return m
  31.  
  32. ICEBreakerPlatform().build(Example(), do_program=True)
  33.  
  34. # Fails with
  35. #
  36. #     ERROR: PLL '$3' has a PACKAGEPIN driven by an SB_GB, should be directly connected to an input SB_IO.D_IN_0 port
  37. #     ERROR: Packing design failed.
  38. #     0 warnings, 2 errors
  39. #     Traceback (most recent call last):
  40. #       File "example3.py", line 39, in <module>
  41. #         ICEBreakerPlatform().build(Example(), do_program=True)
  42. #       File "/Users/kbob/Documents/Code/github/m-labs/nmigen/nmigen/build/plat.py", line 74, in build
  43. #         products = plan.execute_local(build_dir)
  44. #       File "/Users/kbob/Documents/Code/github/m-labs/nmigen/nmigen/build/run.py", line 98, in execute_local
  45. #         subprocess.check_call(["sh", "{}.sh".format(self.script)])
  46. #       File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 347, in check_call
  47. #         raise CalledProcessError(retcode, cmd)
  48. #     subprocess.CalledProcessError: Command '['sh', 'build_top.sh']' returned non-zero exit status 255.
Add Comment
Please, Sign In to add comment