[ { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.pack#" , "workInfo" : "Never" , "kind" : "Expression" , "type" : "pack# :: Index n -> BitVector (CLog 2 n)" , "template" : "std_logic_vector(~ARG[0])" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.unpack#" , "workInfo" : "Never" , "kind" : "Expression" , "type" : "unpack# :: (KnownNat n, 1 <= n) => BitVector (CLog 2 n) -> Index n" , "template" : "unsigned(~ARG[2])" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.eq#" , "kind" : "Expression" , "type" : "eq# :: Index n -> Index n -> Bool" , "template" : "~IF~SIZE[~TYP[0]]~THEN~ARG[0] = ~ARG[1]~ELSEtrue~FI" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.neq#" , "kind" : "Expression" , "type" : "neq# :: Index n -> Index n -> Bool" , "template" : "~IF~SIZE[~TYP[0]]~THEN~ARG[0] /= ~ARG[1]~ELSEfalse~FI" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.lt#" , "kind" : "Expression" , "type" : "lt# :: Index n -> Index n -> Bool" , "template" : "~IF~SIZE[~TYP[0]]~THEN~ARG[0] < ~ARG[1]~ELSEfalse~FI" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.ge#" , "kind" : "Expression" , "type" : "ge# :: Index n -> Index n -> Bool" , "template" : "~IF~SIZE[~TYP[0]]~THEN~ARG[0] >= ~ARG[1]~ELSEtrue~FI" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.gt#" , "kind" : "Expression" , "type" : "gt# :: Index n -> Index n -> Bool" , "template" : "~IF~SIZE[~TYP[0]]~THEN~ARG[0] > ~ARG[1]~ELSEfalse~FI" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.le#" , "kind" : "Expression" , "type" : "le# :: Index n -> Index n -> Bool" , "template" : "~IF~SIZE[~TYP[0]]~THEN~ARG[0] <= ~ARG[1]~ELSEtrue~FI" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.maxBound#" , "workInfo" : "Constant" , "kind" : "Expression" , "type" : "maxBound# :: KnownNat n => Index n" , "template" : "to_unsigned(~LIT[0]-1,~SIZE[~TYPO])" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.+#" , "kind" : "Expression" , "type" : "(+#) :: KnownNat n => Index n -> Index n -> Index n" , "template" : "~ARG[1] + ~ARG[2]" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.-#" , "kind" : "Expression" , "type" : "(-#) :: KnownNat n => Index n -> Index n -> Index n" , "template" : "~ARG[1] - ~ARG[2]" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.*#" , "kind" : "Expression" , "type" : "(*#) :: KnownNat n => Index n -> Index n -> Index n" , "template" : "resize(~ARG[1] * ~ARG[2], ~SIZE[~TYPO])" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.fromInteger#" , "workInfo" : "Never" , "kind" : "Expression" , "type" : "fromInteger# :: KnownNat n => Integer -> Index n" , "template" : "resize(unsigned(std_logic_vector(~ARG[1])),~SIZE[~TYPO])" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.plus#" , "kind" : "Expression" , "type" : "Index m -> Index n -> Index (m + n - 1)" , "template" : "resize(~ARG[0],~SIZE[~TYPO]) + resize(~ARG[1],~SIZE[~TYPO])" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.minus#" , "kind" : "Expression" , "type" : "Index m -> Index n -> Index (m + n - 1)" , "template" : "resize(~ARG[0],~SIZE[~TYPO]) - resize(~ARG[1],~SIZE[~TYPO])" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.times#" , "kind" : "Expression" , "type" : "Index m -> Index n -> Index (((m-1) * (n-1)) + 1)" , "template" : "resize(~ARG[0] * ~ARG[1],~SIZE[~TYPO])" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.rem#" , "kind" : "Expression" , "type" : "rem# :: Index n -> Index n -> Index n" , "template" : "~ARG[0] rem ~ARG[1]" } } , { "BlackBoxHaskell" : { "name" : "Clash.Sized.Internal.Index.toInteger#" , "workInfo" : "Never" , "templateFunction" : "Clash.Primitives.Sized.ToInteger.indexToIntegerVHDL" } } , { "BlackBox" : { "name" : "Clash.Sized.Internal.Index.resize#" , "workInfo" : "Never" , "kind" : "Expression" , "type" : "resize# :: KnownNat m => Index n -> Index m" , "template" : "~IF~SIZE[~TYP[1]]~THENresize(~ARG[1],~SIZE[~TYPO])~ELSEunsigned'(~SIZE[~TYPO]-1 downto 0 => '0')~FI" } } ]