dan-fritchman / Hdl21

Hardware Description Library
BSD 3-Clause "New" or "Revised" License
56 stars 10 forks source link

Some kinda more general connectable Array #210

Open dan-fritchman opened 7 months ago

dan-fritchman commented 7 months ago

Particularly, there's currently a trade-off between using Bundle and having parametric sizes/ lengths/ arrays thereof.

(Conceptual, not working) example:

@h.paramclass 
class Params:
  how_many_diffs = h.Param(dtype=int, desc="how many diffs?")

@h.generator
def ThatManyDiffs(params: Params) -> h.Module:
  @h.module
  class ThatManyDiffs:
    something = params.how_many_diffs * h.Diff(port=True)
  return ThatManyDiffs

There's nothing that fits the role of something as of now, i.e. nothing that can be "N bundle instances", where both N and the kind of bundle is parametric.

Don't know just what we want here yet, or how to implement it.
More of a starting point for thinking about it.