Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slice in Wire with two dimension #47

Open
LucasBraganca opened this issue Mar 21, 2022 · 1 comment
Open

Slice in Wire with two dimension #47

LucasBraganca opened this issue Mar 21, 2022 · 1 comment

Comments

@LucasBraganca
Copy link

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!

@shtaxxx
Copy link
Member

shtaxxx commented Apr 5, 2022

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])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants