Skip to content

vecLen of a non-vector type in "delay by n" function #373

Closed
@martijnbastiaan

Description

@martijnbastiaan

This:

module Test4 where

import Clash.Prelude

topEntity
  :: HiddenClockReset System 'Source 'Asynchronous
  => Signal System Int
topEntity =
  delayBy (SNat @3) (pure 1)

delayBy n signal =
  foldr (\_ s -> delay s) signal (replicate n ())
{-# NOINLINE delayBy #-}

Behaves perfectly fine in simulation:

*Test4> printX $ sampleN 10 topEntity 
[X,X,X,1,1,1,1,1,1,1]

but refuses to compile down to verilog:

$ cabal new-run clash -- Test4.hs --verilog
Up to date
Loaded package environment from /home/martijn/Code/clash-compiler/.ghc.environment.x86_64-linux-8.4.3
Loading dependencies took 1.055727952s
Parsing and compiling primitives took 0.380146334s
Compiling: Test4.topEntity
Applied 62 transformations
Normalisation took 0.424106646s
Netlist generation took 0.001500679s

<no location info>: error:
    Clash error call:
    Clash.Netlist.BlackBox.Util(467): vecLen of a non-vector type

Metadata

Metadata

Labels

bugpatch-providedPatch provided in comments: needs review, merge, etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions