-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add quickfeather board #117
Conversation
95ada36
to
7fdb181
Compare
Please submit the boards as separate PRs. |
d1bfc9b
to
4b54ab7
Compare
I removed the |
In the future you should test the pull requests you send locally to avoid this sort of problem. (Ideally we would test toolchains on CI, but this is not practical to do for most toolchains.) |
4b54ab7
to
f96a960
Compare
Attrs(IOSTANDARD="LVCMOS33") | ||
), | ||
|
||
Resource("i2c", 0, |
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.
These two resources would be completely unusable because the signal directions are wrong; an I2C core would not be able to read SCL/SDA status.
ba1da9f
to
83fe77e
Compare
I reworked board definition and tested two flows:
I also added a separate PR which contains a feature that will enable an internal SoC clock (link). I think it makes sense to enable internal clock by default in Quickfeather board, so the Blinky example could work out of the box. |
83fe77e
to
7507c57
Compare
Thanks! I have a Quickfeather, so I'm looking forward to using nMigen with it. |
7507c57
to
7de72c7
Compare
@kowalewskijan Please apply the following patch (which requires up-to-date nMigen to work) and tell me if commit 95a7eb03edd08ade54dd45dcab48377e5fb9a588 (HEAD -> pr/117)
Author: whitequark <whitequark@whitequark.org>
Date: Fri Nov 13 05:44:35 2020 +0000
Simplify Quickfeather toolchain_program().
diff --git a/nmigen_boards/quickfeather.py b/nmigen_boards/quickfeather.py
index 837e965..582bc69 100644
--- a/nmigen_boards/quickfeather.py
+++ b/nmigen_boards/quickfeather.py
@@ -59,37 +59,24 @@ class QuickfeatherPlatform(QuicklogicPlatform):
# https://github.com/antmicro/openocd/tree/eos-s3-support
def toolchain_program(self, products, name):
openocd = os.environ.get("OPENOCD", "openocd")
- with products.extract("{}.bit".format(name)) as bitstream_filename:
- bitstream_folder = os.path.dirname(bitstream_filename)
- top_ocd_path = os.path.join(bitstream_folder, "top.openocd")
- subprocess.call([sys.executable, "-m",
- "quicklogic_fasm.bitstream_to_openocd",
- bitstream_filename, top_ocd_path])
- # Merge IOMUX config with bitstream into one OpenOCD script
- with products.extract("{}_iomux.openocd".format(name)) as iomux_filename:
- merged_ocd_cfg = str()
- merged_ocd_cfg_path = os.path.join(bitstream_folder, 'top_and_iomux.openocd')
- with open(top_ocd_path, "r") as top_file:
- merged_ocd_cfg = top_file.read()[0:-2]
- with open(iomux_filename, "r") as iomux_file:
- merged_ocd_cfg += iomux_file.read() + '}'
- with open(merged_ocd_cfg_path, "w") as merged_ocd_cfg_file:
- merged_ocd_cfg_file.write(merged_ocd_cfg)
- cfg_path = merged_ocd_cfg_path
- try:
- openocd_proc = subprocess.Popen([openocd, "-s", "tcl",
- "-f", "interface/ftdi/antmicro-ftdi-adapter.cfg",
- "-f", "interface/ftdi/swd-resistor-hack.cfg",
- "-f", "board/quicklogic_quickfeather.cfg",
- "-f", cfg_path,
- "-c", "init",
- "-c", "reset halt",
- "-c", "load_bitstream",
- "-c", "exit"])
- except Exception as e:
- openocd_proc.kill()
- raise e
+ with products.extract("{}.openocd".format(name),
+ "{}_iomux.openocd".format(name)) as \
+ (bitstream_openocd_filename, iomux_openocd_filename):
+ subprocess.check_call([
+ openocd,
+ "-s", "tcl",
+ "-f", "interface/ftdi/antmicro-ftdi-adapter.cfg",
+ "-f", "interface/ftdi/swd-resistor-hack.cfg",
+ "-f", "board/quicklogic_quickfeather.cfg",
+ "-f", bitstream_openocd_filename,
+ "-c", "init",
+ "-c", "reset halt",
+ "-c", "load_bitstream",
+ "-f", iomux_openocd_filename,
+ "-c", "exit"
+ ])
+
if __name__ == "__main__":
from .test.blinky import *
- QuickfeatherPlatform().build(Blinky(), do_program=False)
+ QuickfeatherPlatform().build(Blinky()) |
Co-Authored-By: Kamil Rakoczy <krakoczy@antmicro.com> Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com> Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
7de72c7
to
4b08e3d
Compare
Thanks! |
This PR introduces two boards which utilize the QuickLogic EOS-S3 platform: amaranth-lang/amaranth#504
The contents are: