Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blink.py error: unexpected keyword argument 'max' #3

Closed
pdp7 opened this issue Mar 29, 2020 · 4 comments · Fixed by #4
Closed

blink.py error: unexpected keyword argument 'max' #3

pdp7 opened this issue Mar 29, 2020 · 4 comments · Fixed by #4

Comments

@pdp7
Copy link

pdp7 commented Mar 29, 2020

I encountered this error:

pdp7@x1:~/dev/fpga/icebreaker-nmigen-examples/blink$ python3 ./blink.py 
Traceback (most recent call last):
  File "./blink.py", line 34, in <module>
    plat.build(Blinker(10000000), do_program=True)
  File "/home/pdp7/.local/lib/python3.7/site-packages/nmigen/build/plat.py", line 78, in build
    plan = self.prepare(elaboratable, name, **kwargs)
  File "/home/pdp7/.local/lib/python3.7/site-packages/nmigen/build/plat.py", line 118, in prepare
    fragment = Fragment.get(elaboratable, self)
  File "/home/pdp7/.local/lib/python3.7/site-packages/nmigen/hdl/ir.py", line 39, in get
    obj = obj.elaborate(platform)
  File "./blink.py", line 16, in elaborate
    counter = Signal(max=self.maxperiod+1)
TypeError: __init__() got an unexpected keyword argument 'max'
@pdp7
Copy link
Author

pdp7 commented Mar 29, 2020

I tried this:

diff --git a/blink/blink.py b/blink/blink.py
index 8e66c9f..0a828f4 100644
--- a/blink/blink.py
+++ b/blink/blink.py
@@ -13,8 +13,8 @@ class Blinker(Elaboratable):
         m.domains.sync = ClockDomain()
         m.d.comb += ClockSignal().eq(clk12)
         
-        counter = Signal(max=self.maxperiod+1)
-        period = Signal(max=self.maxperiod+1)
+        counter = Signal(self.maxperiod+1)
+        period = Signal(self.maxperiod+1)
         
         m.d.comb += period.eq(self.maxperiod)         

It does run but no blinking LED like with the migen example.

@pdp7
Copy link
Author

pdp7 commented Mar 29, 2020

note: I never see the bitstream programming output

@pdp7
Copy link
Author

pdp7 commented Mar 29, 2020

for contrast, this works:

pdp7@x1:~/dev/fpga/icebreaker-nmigen-examples/7seg_count$ python3 ./7seg_count.py 
init..
cdone: high
reset..
cdone: low
flash ID: 0xEF 0x40 0x18 0x00
file size: 104090
erase 64kB sector at 0x000000..
erase 64kB sector at 0x010000..
programming..
reading..
VERIFY OK
cdone: high
Bye.

@pdp7
Copy link
Author

pdp7 commented Mar 29, 2020

solved by @miek in #4

@cr1901 cr1901 closed this as completed in #4 Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant