From af4eb02551300434d676980d9877da428ad63adf Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 18 Mar 2013 18:37:23 +0100 Subject: [PATCH] examples/basic/arrays: demonstrate lowering of Array in Instance expression --- examples/basic/arrays.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/basic/arrays.py b/examples/basic/arrays.py index a041658f..7792dc91 100644 --- a/examples/basic/arrays.py +++ b/examples/basic/arrays.py @@ -1,11 +1,12 @@ from migen.fhdl.structure import * +from migen.fhdl.specials import Instance from migen.fhdl.module import Module from migen.fhdl import verilog class Example(Module): def __init__(self): - dx = 5 - dy = 5 + dx = 2 + dy = 2 x = Signal(max=dx) y = Signal(max=dy) @@ -20,4 +21,8 @@ class Example(Module): my_2d_array[x][y].eq(inp) ) + ina = Array(Signal() for a in range(dx)) + outa = Array(Signal() for a in range(dy)) + self.specials += Instance("test", Instance.Output("O", outa[y]), Instance.Input("I", ina[x])) + print(verilog.convert(Example())) -- 2.30.2