PyHDI / veriloggen

Veriloggen: A Mixed-Paradigm Hardware Construction Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slice in Wire with two dimension

LucasBraganca opened this issue · comments

Hi, I'm trying to do the following structure in Veriloggen:

m  = Module('test')
my_wire0 = m.Wire('my_wire0',8,2)
my_wire1 = m.Output('my_wire1',2)
my_wire1.assign(my_wire0[0][0:2])
print(m.to_verilog())

But an exception is raised!

I test this code, and found that the current Slice operator supports only raw variables (such as Input, Output, Reg, and Wire) as the first argument. I will fixed in the next version.

Please use this workaround:

m  = Module('test')
my_wire0 = m.Wire('my_wire0', 8, 2)
my_wire1 = m.Output('my_wire1', 2)
tmp = m.TmpWireLike(my_wire0[0])
my_wire1.assign(tmp[0:2])