Skip to content

Clash errors if it finds the same data file twice #3141

@martijnbastiaan

Description

@martijnbastiaan
-- In `src/Memory.hs`
module Memory where

import Clash.Explicit.Prelude

topEntity ::
  Clock System ->
  Enable System ->
  Signal System (Unsigned 4) ->
  Signal System (Maybe (Unsigned 4, BitVector 8)) ->
  Signal System (BitVector 8)
topEntity clk ena = blockRamFile clk ena d16 "memory.bin"

Reproducer:

$ cabal run clash -- -isrc -isrc Memory --vhdl
<no location info>: error:
    Clash error call:
    Multiple data files for "memory.bin" found. The following candidates were found:
      ["src/memory.bin","src/memory.bin"]
    Please disambiguate data files.
    CallStack (from HasCallStack):
      error, called at src/Clash/Netlist/BlackBox/Util.hs:343:20 in clash-lib-1.9.0-inplace:Clash.Netlist.BlackBox.Util

This of course sounds silly, but passing down the same directory twice can happen more easily in build systems / generic environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions