cucapra / filament

Fearless hardware design

Home Page:http://filamenthdl.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bundle assignments of same length

gabizon103 opened this issue · comments

If a and b are bundles of length N, the assignment a = b will cause the compiler to throw an unassigned bundle location error, where it'll say indices 1, 2, ..., N-1 are unassigned. You need to instead do a{0..N} = b{0..N}. Similarly if we have a module Foo that takes as input a bundle of length N, the invocation Foo<'G>(a) will not type check because the compiler thinks a is a bundle of length 1. You need to do Foo<'G>(a{0..N}) instead.

Not a super high priority but would be nice to fix.

I think long term maybe we want this to be explicit (a{..}) and have a better error message? I thin the a = b syntax is a little tricky because a and b could either be individual ports or complete bundles. The unwieldy thing there is that multi-dimensional assignments start looking really ugly (a{..}{..} = b{..})