-
Notifications
You must be signed in to change notification settings - Fork 34
Acacia I2C, Serial and Timer + new Python tooling #751
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
Draft
omeh-a
wants to merge
8
commits into
main
Choose a base branch
from
sdfgenpy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
959f432
(wip) Timer and i2c acacia adaptation
omeh-a a55c47c
Updated ina219 and bus scan i2c examples to use acacia
omeh-a 013449b
Lint Python with Acacia additions
omeh-a 6d06dfb
Update signatures to put SDF first for Acacia
omeh-a de0f706
Extract per-board / x86 metaprogram hacks to class.py
omeh-a 55b8d7b
Add I2CAddress type and I2C address decoding for I2C class
omeh-a f8215fb
Refactor sDDFDeviceClass to initialise configstructs at correct time,…
omeh-a 1d5b5c5
Added blk support using acacia
omeh-a File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Copyright 2026, UNSW | ||
| # SPDX-License-Identifier: BSD-2-Clause | ||
|
|
||
| from .i2c import sDDFI2C | ||
| from .timer import sDDFTimer | ||
| from .serial import sDDFSerial | ||
| from .blk import sDDFBlk | ||
| from .sddf import sDDFDriverClass, sDDFDriverConfig, sDDFDriverManifest | ||
| from .board import BOARDS, Board | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be under
acacia_sddf. It's not really clear what acacia is for a user. I think the timer/serial classes should either live in the appropriateserial/ortimer/directory and helpers undertools/metaortools/acacia.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a blunt reason for this: it means that we only need one Python import and it means that each driver class doesn't need to abuse importlib to find the others. I really think it's fine to have end users learn what Acacia is, given that they have to install it to use the sDDF. I did it as you suggest initially and it made things horrible. I'm really not eager to change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think having to set up PYTHONPATH (which you can do entirely in the Makefile) is that bad. If you want just one import you can still do that without separating the components from the rest of the components, you just have some path-mangling.
The other thing is to consider external users: LionsOS, for instance, could just do "import sddf.timer" if it's located in the timer folder, whereas with this way you need to either do "import sddf.acacia_sddf.timer" or have top level exports (not necessary if your project structure follows python module structure, no need for init.py etc). They'd have to put sDDF in their PythonPath but that's fine and reasonable.
tldr; no, I disagree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users of anything will be using acacia anyway though? How can a user of acacia who must be using it in their metaprogram not already know what acacia is? Making the entire sDDF tree a python module just complicates things. The only functional diff from what you're describing is whether the module is called
sddforacacia_sddf. We can renameacacia_sddfto justsddfif it matters ... I personally think it's inconsequential, but I also really think it's worse for code organisation to scatter the python through the source tree.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sidenote: I don't think we will need to
import sddf.acacia_sddf.blaheither? We can do this exactly as it is done in the metaprogram and not make a top level sDDF module