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

Superfluous port names in a Synthesize annotation get silently ignored #2243

Open
martijnbastiaan opened this issue Jun 17, 2022 · 0 comments

Comments

@martijnbastiaan
Copy link
Member

Superfluous port names in a Synthesize annotation get silently ignored. This is true for both inputs and outputs:

module Test where
  
import Clash.Prelude

{-# ANN topEntity
  (Synthesize
    { t_name     = "test"
    , t_inputs   = 
      [ PortProduct "" 
        [ PortName "i_a"
        , PortName "i_b"
        , PortName "i_c"
        ]
      ]
    , t_output  = PortProduct "" 
      [ PortName "o_a"
      , PortName "o_b"
      , PortName "o_c"
      ]
}) #-}
topEntity :: (Int, Int) -> (Int, Int)
topEntity (a, c) = (a, c)

Yields:

$ stack run clash -- Test.hs -fclash-no-cache --verilog
GHC: Setting up GHC took: 0.034s
GHC: Compiling and loading modules took: 0.303s
Clash: Parsing and compiling primitives took 0.165s
GHC+Clash: Loading modules cumulatively took 0.627s
Clash: Ignoring previously made caches
Clash: Compiling Test.topEntity
Clash: Normalization took 0.000s
Clash: Netlist generation took 0.000s
Clash: Compiling Test.topEntity took 0.009s
Clash: Total compilation took 0.636s

This can be especially confusing if you deleted one of the middle arguments, causing all port names to shift and up with unexpected names.

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

No branches or pull requests

1 participant