From a13a21cbd6f756c3761630d8be20eefc14fa27e1 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 21 Sep 2019 06:53:13 +0000 Subject: [PATCH] hdl.ast: update docs. NFC. --- nmigen/hdl/ast.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/nmigen/hdl/ast.py b/nmigen/hdl/ast.py index d9e3d5e..6d891b3 100644 --- a/nmigen/hdl/ast.py +++ b/nmigen/hdl/ast.py @@ -963,29 +963,29 @@ class Array(MutableSequence): gpios = Array(Signal() for _ in range(10)) with m.If(bus.we): - m.d.sync += gpios[bus.adr].eq(bus.dat_w) + m.d.sync += gpios[bus.addr].eq(bus.w_data) with m.Else(): - m.d.sync += bus.dat_r.eq(gpios[bus.adr]) + m.d.sync += bus.r_data.eq(gpios[bus.addr]) Multidimensional array:: mult = Array(Array(x * y for y in range(10)) for x in range(10)) - a = Signal(max=10) - b = Signal(max=10) + a = Signal.range(10) + b = Signal.range(10) r = Signal(8) m.d.comb += r.eq(mult[a][b]) Array of records:: layout = [ - ("re", 1), - ("dat_r", 16), + ("r_data", 16), + ("r_en", 1), ] buses = Array(Record(layout) for busno in range(4)) master = Record(layout) m.d.comb += [ - buses[sel].re.eq(master.re), - master.dat_r.eq(buses[sel].dat_r), + buses[sel].r_en.eq(master.r_en), + master.r_data.eq(buses[sel].r_data), ] """ def __init__(self, iterable=()): -- 2.30.2