I did find one of the original versions of the FIR example in the Berkeley Chisel Tutorial paper from 2017.
def Delays[T <: Data](x: T, n: Int): List[T] =
if (n <= 1) List(x) else x :: Delays(RegNext(x), n-1)
def FIR[T <: Data with Num[T]](ws: Seq[T], x: T): T =
(ws, Delays(x, ws.length)).zipped.
map( _ *
_ ).reduce( _ + _ )
Definitely like this style of using functions to instantiate the logic since it's like building a library of hardware that can then be worked into the modules.
Paper can be found here: