-
Notifications
You must be signed in to change notification settings - Fork 120
Added gatemate_a1_evb board #249
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,305 @@ | ||||||||||||||||||||||
import os | ||||||||||||||||||||||
import argparse | ||||||||||||||||||||||
import subprocess | ||||||||||||||||||||||
import shutil | ||||||||||||||||||||||
import unittest | ||||||||||||||||||||||
|
||||||||||||||||||||||
from amaranth.build import * | ||||||||||||||||||||||
from amaranth.vendor import GateMatePlatform | ||||||||||||||||||||||
from .resources import * | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
__all__ = [ | ||||||||||||||||||||||
"GateMate_A1_EVB" | ||||||||||||||||||||||
] | ||||||||||||||||||||||
|
||||||||||||||||||||||
class _GateMate_A1_EVB(GateMatePlatform): | ||||||||||||||||||||||
device = "GateMate_A1_EVB" | ||||||||||||||||||||||
package = "CCGM1A1" | ||||||||||||||||||||||
default_clk = "clk0" | ||||||||||||||||||||||
|
||||||||||||||||||||||
resources = [ | ||||||||||||||||||||||
Resource("clk0", 0, Pins("IO_SB_A8", dir = "i"), Clock(10e6), Attrs(SCHMITT_TRIGGER="true")), | ||||||||||||||||||||||
Resource("clk1", 0, Pins("IO_SB_A7", dir = "i"), Clock(10e6)), # GPIO23 | ||||||||||||||||||||||
Resource("clk2", 0, Pins("IO_SB_A6", dir = "i"), Clock(10e6)), # GPIO24 | ||||||||||||||||||||||
Resource("clk3", 0, Pins("IO_SB_A5", dir = "i"), Clock(10e6)), | ||||||||||||||||||||||
Comment on lines
+21
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(Why is only the first one configured with a Schmitt trigger?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A good question. Generaly the board is new, and this general constraint file is written by me. In the official constraint file the |
||||||||||||||||||||||
|
||||||||||||||||||||||
*LEDResources(pins = "IO_SB_B6", attrs=Attrs()), | ||||||||||||||||||||||
*ButtonResources("fpga_but", pins="IO_SB_B7", attrs=Attrs()), | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
# Note: The documentation flipped the rx and tx pins | ||||||||||||||||||||||
UARTResource(0, | ||||||||||||||||||||||
rx="IO_SA_A6", tx="IO_SA_B6", role="dce" , attrs=Attrs() | ||||||||||||||||||||||
), | ||||||||||||||||||||||
|
||||||||||||||||||||||
# TODO: Check what is copi and cipo? | ||||||||||||||||||||||
# TODO: Check where to place SPI_D0, SPI_D1, SPI_D2, SPI_D3 and FPGA_SPI_FWD? | ||||||||||||||||||||||
#SPIResource(0, | ||||||||||||||||||||||
# cs_n="IO_WA_A8", clk="IO_WA_B8" | ||||||||||||||||||||||
#), | ||||||||||||||||||||||
|
||||||||||||||||||||||
PS2Resource(0, | ||||||||||||||||||||||
clk="IO_WB_A0", dat="IO_WB_B0" | ||||||||||||||||||||||
), | ||||||||||||||||||||||
|
||||||||||||||||||||||
Resource("psram", 0, | ||||||||||||||||||||||
Subsignal("psram_cs", Pins("IO_WC_A4", dir="o")), | ||||||||||||||||||||||
Subsignal("psram_sclk", Pins("IO_WC_B4", dir="o")), | ||||||||||||||||||||||
Subsignal("psram_data", Pins("IO_WC_A5 IO_WC_B5 IO_WC_A6 IO_WC_B6 " | ||||||||||||||||||||||
"IO_WC_A7 IO_WC_B7 IO_WC_A8 IO_WC_B8", | ||||||||||||||||||||||
dir="io")) | ||||||||||||||||||||||
|
Subsignal("psram_cs", Pins("IO_WC_A4", dir="o")), | |
Subsignal("psram_sclk", Pins("IO_WC_B4", dir="o")), | |
Subsignal("psram_data", Pins("IO_WC_A5 IO_WC_B5 IO_WC_A6 IO_WC_B6 " | |
"IO_WC_A7 IO_WC_B7 IO_WC_A8 IO_WC_B8", | |
dir="io")) | |
Subsignal("cs", Pins("IO_WC_A4", dir="o")), | |
Subsignal("sclk", Pins("IO_WC_B4", dir="o")), | |
Subsignal("data", Pins("IO_WC_A5 IO_WC_B5 IO_WC_A6 IO_WC_B6 " | |
"IO_WC_A7 IO_WC_B7 IO_WC_A8 IO_WC_B8", | |
dir="io")) |
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.
Removed the psram prefix.
Outdated
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.
This should use VGAResource
.
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.
Changed to use VGAResource
Resource("vga", 0, | |
VGAResource("vga", 0, | |
r="IO_WB_B3 IO_WB_A3 IO_WB_B2 IO_WB_A2", | |
g="IO_WB_B5 IO_WB_A5 IO_WB_B4 IO_WB_A4", | |
b="IO_WB_B7 IO_WB_A7 IO_WB_B6 IO_WB_A6", | |
vs= "IO_WB_B1", | |
hs="IO_WB_A1" | |
), |
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.
LED?
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 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.
Should use SPIResource
.
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.
The problem was I didn't know how to map the 'd' signals to the copi
cipo
signals of the SPIResource
.
Outdated
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.
You're looking for DiffPairs("true", "complement")
.
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.
Changed serdes
to use DiffPairs
and removed the ser
prefix.
Outdated
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.
This looks like a Connector
, not a Resource
.
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.
Changed it from a Resource
to a Connector
.
Outdated
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.
This is definitely a Connector
.
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.
Changed from Resource
to Connector
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.
This also looks like a Connector
.
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.
This is used for RP2040, and there are no external connections to these pins here. Are they still connectors?
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.
The point of a Connector
isn't necessarily that it's a physical connector, but that it's an extension point where a downstream user of this platform can attach project specific resources. A project using SPI to communicate with the RP2040 could e.g. want to attach a SPIResource
to some of those signals.
whitequark marked this conversation as resolved.
Show resolved
Hide resolved
Outdated
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.
Although it's not currently documented, required_tools
is only for the tools required to produce the bitstream. Programming tools should not included and it will cause issues if they are.
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 will remove that, but just to point out that ulx3s.py
has the same line aswell.
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.
Yes, that's also wrong (I missed it during review previously).
Outdated
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.
While these could and should be valid overrides in principle, they currently aren't: you are not doing anything with yosys_opts
or pr_opts
in your Amaranth PR. In addition, basic options like this should not be in a board file at all.
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.
Should I remove toolchain_prepare
?
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 can't see a reason why one would be needed here.
Outdated
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.
Since overrides only affect the build process, not the programming process, this option will never be used.
Outdated
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.
(In this particular case I don't think you need any toolchain overrides.)
Outdated
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.
class GateMate_A1_EVB(_GateMate_A1_EVB): | |
name = "Olimex GateMateA1-EVB" |
Uh oh!
There was an error while loading. Please reload this page.