Skip to content

Commit 72fb2a1

Browse files
committed
wip
1 parent 5e081df commit 72fb2a1

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

amaranth_orchard/io/gpio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(self, *, pin_count, addr_width=4, data_width=4, input_stages=2):
7070

7171
def elaborate(self, platform):
7272
m = Module()
73-
m.submodules._gpio = self._gpio
73+
m.submodules._gpio = gpio = self._gpio
7474

7575
connect(m, flipped(self.bus), self._gpio.bus)
7676
for i in range(self._gpio.pin_count):

amaranth_orchard/memory/hyperram.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Copyright (c) 2021-2022 gatecat <[email protected]>
66
# SPDX-License-Identifier: BSD-2-Clause
77

8-
from amaranth import Module, ClockSignal, ResetSignal, Signal, unsigned, ClockDomain
8+
from amaranth import Module, ClockSignal, ResetSignal, Signal, unsigned, ClockDomain, Cat
99
from amaranth.lib import wiring
1010
from amaranth.lib.wiring import In, Out, connect, flipped
1111
from amaranth.utils import ceil_log2
@@ -46,9 +46,8 @@ class HRAMConfig(csr.Register, access="w"):
4646
4747
This core favors portability and ease of use over performance.
4848
"""
49-
def __init__(self, mem_name=("mem",), *, pins, init_latency=7):
50-
self.pins = pins
51-
self.cs_count = pins.cs_count
49+
def __init__(self, mem_name=("mem",), *, cs_count=1, init_latency=7):
50+
self.cs_count = cs_count
5251
self.size = 2**23 * self.cs_count # 8MB per CS pin
5352
self.init_latency = init_latency
5453
assert self.init_latency in (6, 7) # TODO: anything else possible ?

tests/test_gpio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async def testbench(ctx):
145145
await self._csr_access(ctx, dut, output_addr, r_stb=1, r_data=0xa, w_stb=1, w_data=0x0)
146146
await ctx.tick()
147147
self.assertEqual(ctx.get(dut.pins.gpio.oe), 0b1111)
148-
self.assertEqual(ctx.get(dut.pins.gpio.o), 0b1111)
148+
self.assertEqual(ctx.get(dut.pins.gpio.o), 0b0000)
149149

150150
# - write 0x44 to SetClr (set pins[1] and pins[3]):
151151
await self._csr_access(ctx, dut, setclr_addr, w_stb=1, w_data=0x44)

0 commit comments

Comments
 (0)