Closed mgajda closed 9 years ago
Thanks for the bug-report. I fixed it for 'BitVector', but forgot to check the same error in 'Unsigned'. I just pushed a fix: https://github.com/clash-lang/clash-compiler/commit/3a5d5ad415c88b37dd1d6ccff5e8013620baae94
As a workaround until I push a new package to hackage: you can add the following blackbox definitions to the directory from which you run the clash compile.
CLaSH.Sized.Internal.Unsigned.json
[ { "BlackBox" :
{ "name" : "CLaSH.Sized.Internal.Unsigned.minBound#"
, "templateE" : "unsigned'(~LIT[0]-1 downto 0 => '0')"
}
}
, { "BlackBox" :
{ "name" : "CLaSH.Sized.Internal.Unsigned.maxBound#"
, "templateE" : "unsigned'(~LIT[0]-1 downto 0 => '1')"
}
}
]
The CLaSH compiler will then overwrite the default translation rule for minbound and maxbound with the correct definitions.
Thanks a lot!
Do you plan a tutorial on making your own BlackBox
es and emitting own compilation patterns?
I've just released version 0.5.4 of the VHDL backend. To install:
$ cabal update
$ cabal install clash-vhdl-0.5.4 clash-systemverilog-0.5.4 clash-ghc
Latest CLaSH 0.5 generates invalid VHDL, according to Xilinx ISE compiler:
Relevant VHDL code fragment is as follows:
It seems from creation of
Vec
tor of records:I put entire CLaSH input file on Paste
Even if you plan to revamp source entirely, this seems to be a good candidate to add to the unit tests.