Skip to content

Commit 750b948

Browse files
committed
Fix to do everything modern CSR way
1 parent a5b70c8 commit 750b948

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

amaranth_orchard/base/gpio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ def __init__(self, width):
5555
5656
All pins default to input at power up.
5757
"""
58-
def __init__(self, *, name, pins):
58+
def __init__(self, *, pins):
5959

6060
self.width = pins.width
6161
self.pins = pins
6262

63-
regs = csr.Builder(addr_width=4, data_width=8, name=name)
63+
regs = csr.Builder(addr_width=4, data_width=8)
6464

6565
self._do = regs.add("do", self.DO(self.width), offset=0x0)
6666
self._oe = regs.add("oe", self.OE(self.width), offset=0x4)

amaranth_orchard/base/soc_id.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ def __init__(self, width):
2121
Two read-only CSRs; the first contains a SoC-defined type ID and the second the git hash of the
2222
repo being used to build the SoC.
2323
"""
24-
def __init__(self, *, name, type_id=0xbadca77e):
24+
def __init__(self, *, type_id=0xbadca77e):
2525
self.type_id = type_id
2626
self.git_hash = int(subprocess.check_output('git rev-parse --verify HEAD'.split(' ')).strip()[0:8], base=16)
2727

28-
regs = csr.Builder(addr_width=4, data_width=8, name=name)
28+
regs = csr.Builder(addr_width=4, data_width=8)
2929

3030
self._soc_type = regs.add("soc_type", self.Register(32), offset=0x0)
3131
self._soc_version = regs.add("soc_version", self.Register(32), offset=0x4)

amaranth_orchard/io/uart.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ def __init__(self, init_divisor):
5555
5656
TODO: Interrupts support, perhaps mimic something with upstream Linux kernel support...
5757
"""
58-
def __init__(self, *, name, init_divisor, pins):
58+
def __init__(self, *, init_divisor, pins):
5959
self.init_divisor = init_divisor
6060
self.pins = pins
6161

62-
regs = csr.Builder(addr_width=5, data_width=8, name=name)
62+
regs = csr.Builder(addr_width=5, data_width=8)
6363

6464
self._tx_data = regs.add("tx_data", self.TxData(), offset=0x00)
6565
self._rx_data = regs.add("rx_data", self.RxData(), offset=0x04)

amaranth_orchard/memory/spimemio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def elaborate(self, platform):
5555
- ctrl_bus is the original 32-bit control register
5656
- data_bus is a bus peripheral that directly maps the 16MB of read-only flash memory.
5757
"""
58-
def __init__(self, *, name, flash):
58+
def __init__(self, flash):
5959
self.flash = flash
6060
self.size = 2**24
6161
size_words = (self.size * 8) // 32
@@ -67,11 +67,11 @@ def __init__(self, *, name, flash):
6767
})
6868

6969
ctrl_memory_map = MemoryMap(addr_width=exact_log2(4), data_width=8)
70-
ctrl_memory_map.add_resource(name=(name,), size=4, resource=self)
70+
ctrl_memory_map.add_resource(name="spimemio", size=4, resource=self)
7171
self.ctrl_bus.memory_map = ctrl_memory_map
7272

7373
data_memory_map = MemoryMap(addr_width=exact_log2(self.size), data_width=8)
74-
data_memory_map.add_resource(name=(name,), size=self.size, resource=self)
74+
data_memory_map.add_resource(name="spimemio", size=self.size, resource=self)
7575
self.data_bus.memory_map = data_memory_map
7676

7777
def elaborate(self, platform):

0 commit comments

Comments
 (0)