Skip to content

Commit b968cfa

Browse files
committed
Rename nMigen to Amaranth HDL.
1 parent bd7fdd3 commit b968cfa

File tree

136 files changed

+6603
-6148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+6603
-6148
lines changed

CONTRIBUTING.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ this purpose.
77

88
COPYRIGHTS and LICENSE
99

10-
nMigen is licensed under the 2-clause BSD license, which is contained in the
11-
LICENSE.txt file.
10+
Amaranth HDL is licensed under the 2-clause BSD license, which is contained in
11+
the LICENSE.txt file.
1212

1313
All authors retain copyright ownership of their contributions.
1414

LICENSE.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Copyright (C) 2019-2020 whitequark
2-
Copyright (C) 2011-2019 M-Labs Limited
1+
Copyright (C) 2019-2021 Amaranth HDL contributors
32

43
Redistribution and use in source and binary forms, with or without modification,
54
are permitted provided that the following conditions are met:

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
# nMigen boards and connectors
1+
# Amaranth HDL board definitions
22

3-
## Ready to use board and connector pinouts, and programming scripts
3+
TODO
44

5-
TBD
5+
## License
66

7-
### License
8-
9-
nMigen is released under the very permissive two-clause BSD license. Under the terms of this license, you are authorized to use nMigen for closed-source proprietary designs.
7+
Amaranth is released under the very permissive two-clause BSD license. Under the terms of this license, you are authorized to use Amaranth for closed-source proprietary designs.
108

119
See LICENSE file for full copyright and license info.

amaranth_boards/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
try:
2+
try:
3+
from importlib import metadata as importlib_metadata # py3.8+ stdlib
4+
except ImportError:
5+
import importlib_metadata # py3.7- shim
6+
__version__ = importlib_metadata.version(__package__)
7+
except ImportError:
8+
# No importlib_metadata. This shouldn't normally happen, but some people prefer not installing
9+
# packages via pip at all, instead using PYTHONPATH directly or copying the package files into
10+
# `lib/pythonX.Y/site-packages`. Although not a recommended way, we still try to support it.
11+
__version__ = "unknown" # :nocov:

amaranth_boards/alchitry_au.py

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import os
2+
import subprocess
3+
import shutil
4+
5+
from amaranth.build import *
6+
from amaranth.vendor.xilinx_7series import *
7+
from .resources import *
8+
9+
10+
__all__ = ["AlchitryAuPlatform"]
11+
12+
13+
def find_loader():
14+
loader_prgm = os.environ.get("ALCHITRY_LOADER", shutil.which("loader"))
15+
if loader_prgm is None:
16+
raise EnvironmentError("Could not find Alchrity Loader. Place "
17+
"it directly in PATH or specify path explicitly via the "
18+
"ALCHITRY_LOADER environment variable")
19+
bridge_bin = os.environ.get("ALCHITRY_BRIDGE_BIN", os.path.join(os.path.dirname(loader_prgm), "au_loader.bin"))
20+
return (loader_prgm, bridge_bin)
21+
22+
23+
class AlchitryAuPlatform(Xilinx7SeriesPlatform):
24+
device = "XC7A35T" # Artix 7 33K LEs
25+
package = "FTG256"
26+
speed = "1"
27+
default_clk = "clk100"
28+
resources = [
29+
Resource("clk100", 0, Pins("N14", dir="i"),
30+
Clock(10e7), Attrs(IOSTANDARD="LVCMOS33")),
31+
32+
# On-Board LED Array
33+
*LEDResources(
34+
pins="K13 K12 L14 L13 M16 M14 M12 N16",
35+
attrs=Attrs(IOSTANDARD="LVCMOS33")),
36+
37+
Resource("usb", 0,
38+
Subsignal("usb_tx", Pins("P16", dir="o")),
39+
Subsignal("usb_rx", Pins("P15", dir="i")),
40+
Attrs(IOSTANDARD="LVCMOS33")
41+
),
42+
43+
# TODO: This is untested
44+
DDR3Resource(0,
45+
rst_n="D13", clk_p="G14", clk_n="F14", clk_en="D15", cs_n="D16", we_n="E11", ras_n="D14", cas_n="D14",
46+
a="F12 G16 G15 E16 H11 G12 H16 H12 H16 H13 E12 H14 F13 J15",
47+
ba="E13 F15 E15",
48+
dqs_p="B15 A15", dqs_n="B9 A10",
49+
dq="A13 B16 B14 C11 C13 C16 C12 C14 D8 B11 C8 B10 A12 A8 B12 A9",
50+
dm="A14 C9", odt="G11",
51+
diff_attrs=Attrs(IOSTANDARD="LVDS"),
52+
attrs=Attrs(IOSTANDARD="LVCMOS15")),
53+
]
54+
55+
connectors = [
56+
Connector("bank", 0, "T8 T7 T5 R5 R8 P8 L2 L3 J1 K1 H1 H2 G1 G2 K5 E6 "
57+
"T10 T9 R6 R7 P9 N9 K2 K3 J4 J5 H3 J3 H4 H5 N6 M6 "),
58+
Connector("bank", 1, "D1 E2 A2 B2 E1 F2 F3 F4 A3 B4 A4 A5 B5 B6 A7 B7 "
59+
"B1 C1 C2 C3 D3 E3 C4 D4 G4 G5 E5 F5 D5 D6 C6 C7 "),
60+
Connector("bank", 2, "T13 R13 T12 R12 R11 R10 N2 N3 P3 P4 M4 L4 N4 M5 L5 P5 "
61+
"P11 P10 N12 N11 P13 N13 M1 M2 P1 N1 R1 R2 T2 R3 T3 T4 "),
62+
Connector("bank", 3, "L14 L13 M12 N16 R16 R15 P14 M15 P16 P15 - - - - - - "
63+
"K13 K12 M16 M14 T16 T14 N14 - - - - - - - - - ")
64+
]
65+
66+
def toolchain_program(self, products, name):
67+
(loader, bridge_bin) = find_loader()
68+
with products.extract("{}.bin".format(name)) as bitstream_filename:
69+
subprocess.check_call([loader, "-e", "-f", bitstream_filename,
70+
"-p", bridge_bin
71+
])
72+
73+
74+
if __name__ == "__main__":
75+
from .test.blinky import Blinky
76+
AlchitryAuPlatform().build(Blinky(), do_program=True)

amaranth_boards/arrow_deca.py

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import os
2+
import subprocess
3+
4+
from amaranth.build import *
5+
from amaranth.vendor.intel import *
6+
from .resources import *
7+
8+
9+
__all__ = ["ArrowDECAPlatform"]
10+
11+
12+
class ArrowDECAPlatform(IntelPlatform):
13+
device = "10M50DA" # MAX 10
14+
package = "F484"
15+
speed = "C6"
16+
suffix = "GES"
17+
default_clk = "clk50"
18+
resources = [
19+
Resource("clk50", 0, Pins("M8", dir="i"),
20+
Clock(50e6), Attrs(io_standard="2.5 V")),
21+
Resource("clk50", 1, Pins("P11", dir="i"),
22+
Clock(50e6), Attrs(io_standard="3.3 V")),
23+
Resource("clk50", 2, Pins("N15", dir="i"),
24+
Clock(50e6), Attrs(io_standard="1.5 V")),
25+
Resource("clk10", 0, Pins("M9", dir="i"),
26+
Clock(10e6), Attrs(io_standard="2.5 V")),
27+
28+
*LEDResources(
29+
pins="C7 C8 A6 B7 C4 A5 B4 C5",
30+
invert=True,
31+
attrs=Attrs(io_standard="1.2 V")),
32+
*ButtonResources(
33+
pins="H21 H22",
34+
invert=True,
35+
attrs=Attrs(io_standard="1.5 V")),
36+
*SwitchResources(
37+
pins="J21 J22",
38+
attrs=Attrs(io_standard="1.5 V")),
39+
]
40+
connectors = [
41+
Connector("gpio", 0,
42+
"W18 Y18 Y19 AA17 AA20 AA19 AB21 AB20 AB19 Y16 V16 "
43+
"AB18 V15 W17 AB17 AA16 AB16 W16 AB15 W15 Y14 AA15 "
44+
"AB14 AA14 AB13 AA13 AB12 AA12 AB11 AA11 AB10 Y13 Y11 "
45+
"W13 W12 W11 V12 V11 V13 V14 Y17 W14 U15 R13"),
46+
Connector("gpio", 1,
47+
"Y5 Y6 W6 W7 W8 V8 AB8 V7 R11 AB7 AB6 "
48+
"AA7 AA6 Y7 V10 U7 W9 W5 R9 W4 P9 V17 "
49+
"W3"),
50+
]
51+
52+
def toolchain_program(self, products, name):
53+
quartus_pgm = os.environ.get("QUARTUS_PGM", "quartus_pgm")
54+
with products.extract("{}.sof".format(name)) as bitstream_filename:
55+
subprocess.check_call([quartus_pgm, "--haltcc", "--mode", "JTAG",
56+
"--operation", "P;" + bitstream_filename])
57+
58+
@property
59+
def file_templates(self):
60+
# Configure the voltages of the I/O banks by appending the global
61+
# assignments to the template. However, we create our own copy of the
62+
# file templates before modifying them to avoid modifying the original.
63+
return {
64+
**super().file_templates,
65+
"{{name}}.qsf":
66+
super().file_templates.get("{{name}}.qsf") +
67+
r"""
68+
set_global_assignment -name IOBANK_VCCIO 2.5V -section_id 1A
69+
set_global_assignment -name IOBANK_VCCIO 2.5V -section_id 1B
70+
set_global_assignment -name IOBANK_VCCIO 2.5V -section_id 2
71+
set_global_assignment -name IOBANK_VCCIO 3.3V -section_id 3
72+
set_global_assignment -name IOBANK_VCCIO 3.3V -section_id 4
73+
set_global_assignment -name IOBANK_VCCIO 1.5V -section_id 5
74+
set_global_assignment -name IOBANK_VCCIO 1.5V -section_id 6
75+
set_global_assignment -name IOBANK_VCCIO 1.8V -section_id 7
76+
set_global_assignment -name IOBANK_VCCIO 1.2V -section_id 8
77+
78+
set_global_assignment -name FORCE_CONFIGURATION_VCCIO ON
79+
set_global_assignment -name AUTO_RESTART_CONFIGURATION OFF
80+
set_global_assignment -name ENABLE_CONFIGURATION_PINS OFF
81+
set_global_assignment -name ENABLE_BOOT_SEL_PIN OFF
82+
"""
83+
}
84+
85+
86+
if __name__ == "__main__":
87+
from .test.blinky import Blinky
88+
ArrowDECAPlatform().build(Blinky(), do_program=True)

0 commit comments

Comments
 (0)