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

applet.memory.prom: modify to use port groups. #606

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

q3k
Copy link
Contributor

@q3k q3k commented Jun 26, 2024

Part of #599.

This one fails with a nasty stacktrace if --pins-a isn't set:

$ venv/bin/glasgow build  --rev C3 memory-prom
Traceback (most recent call last):
  File "/home/q3k/Projects/glasgow2/software/venv/bin/glasgow", line 8, in <module>
    sys.exit(run_main())
             ^^^^^^^^^^
  File "/home/q3k/Projects/glasgow2/software/glasgow/cli.py", line 939, in run_main
    exit(asyncio.run(main()))
         ^^^^^^^^^^^^^^^^^^^
  File "/run/current-system/sw/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/run/current-system/sw/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/current-system/sw/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/q3k/Projects/glasgow2/software/glasgow/cli.py", line 822, in main
    target, applet = _applet(args.rev, args)
                     ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/q3k/Projects/glasgow2/software/glasgow/cli.py", line 424, in _applet
    applet.build(target, args)
  File "/home/q3k/Projects/glasgow2/software/glasgow/applet/memory/prom/__init__.py", line 522, in build
    ports=iface.get_port_group(
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/q3k/Projects/glasgow2/software/glasgow/access/__init__.py", line 73, in get_port_group
    return PortGroup(**{
                       ^
  File "/home/q3k/Projects/glasgow2/software/glasgow/access/__init__.py", line 74, in <dictcomp>
    name: self.get_port(pin_or_pins, name=name) for name, pin_or_pins in kwargs.items()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/q3k/Projects/glasgow2/software/glasgow/access/direct/multiplexer.py", line 226, in get_port
    assert port is not None

Not sure what to do about it. I guess not having address pins is an error that was just not caught so far?

@q3k q3k requested a review from whitequark as a code owner June 26, 2024 23:36
@whitequark
Copy link
Member

That could be a bug, I'll look.

@whitequark
Copy link
Member

Not sure what to do about it. I guess not having address pins is an error that was just not caught so far?

OK so, this assertion appears if you have an empty list of pins rather than None. I didn't know whether this situation will ever arise and I guess now I do :)

@whitequark
Copy link
Member

whitequark commented Jun 27, 2024

@q3k The nasty backtrace is going to be fixed in #609. Since using zero address pins are a valid configuraiton for this applet (in case you want only the shift register, to save pins), please check that it works.

@whitequark
Copy link
Member

@q3k Do you recall what's needed to finish this?

@whitequark whitequark enabled auto-merge July 19, 2024 22:01
@whitequark whitequark added this pull request to the merge queue Jul 19, 2024
Merged via the queue into GlasgowEmbedded:main with commit 9055187 Jul 19, 2024
20 checks passed
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 this pull request may close these issues.

2 participants