packages feed

clash-lib-1.10.3: prims/vhdl/GHC_Num_Natural.primitives.yaml

- BlackBox:
    name: ["GHC.Num.Natural.naturalMul", "GHC.Internal.Bignum.Natural.naturalMul"]
    kind: Expression
    type: 'timesNatural ::
      Natural -> Natural -> Natural'
    template: resize(~ARG[0] * ~ARG[1],~SIZE[~TYPO])
    warning: 'GHC.Num.Natural.timesNatural: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalFromWord#", "GHC.Internal.Bignum.Natural.naturalFromWord#"]
    kind: Expression
    type: 'naturalFromWord#
      :: Word# -> Natural'
    template: unsigned(std_logic_vector(~ARG[0]))
    warning: 'GHC.Num.Natural.naturalFromWord#: Naturals are dynamically sized in
      simulation, but fixed-length after synthesis. Use carefully.'
    workInfo: Never
- BlackBox:
    name: ["GHC.Num.Natural.naturalRem", "GHC.Internal.Bignum.Natural.naturalRem"]
    kind: Declaration
    type: 'naturalRem :: Natural
      -> Natural -> Natural'
    template: |-
      ~RESULT <= ~ARG[0] rem ~ARG[1]
          -- pragma translate_off
          when (~ARG[1] /= 0) else (others => 'X')
          -- pragma translate_on
          ;
    warning: 'GHC.Num.Natural.naturalRem: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalLogBase#", "GHC.Internal.Bignum.Natural.naturalLogBase#"]
    kind: Expression
    type: 'naturalLogBase#
      :: Natural -> Natural -> Word#'
    template: to_unsigned(integer(floor(log(real(to_integer(~ARG[1])),real(to_integer(~ARG[0]))))),~SIZE[~TYPO])
    warning: 'GHC.Num.Natural.naturalLogBase#: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalEq#", "GHC.Internal.Bignum.Natural.naturalEq#"]
    kind: Declaration
    type: 'naturalEq# :: Natural
      -> Natural -> Int#'
    template: ~RESULT <= to_unsigned(1,~SIZE[~TYPO]) when ~ARG[0] = ~ARG[1] else to_unsigned(0,~SIZE[~TYPO]);
    warning: 'GHC.Num.Natural.naturalEq#: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalNe#", "GHC.Internal.Bignum.Natural.naturalNe#"]
    kind: Declaration
    type: 'naturalNe# :: Natural
      -> Natural -> Int#'
    template: ~RESULT <= to_unsigned(1,~SIZE[~TYPO]) when ~ARG[0] /= ~ARG[1] else
      to_unsigned(0,~SIZE[~TYPO]);
    warning: 'GHC.Num.Natural.naturalNe#: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalLe#", "GHC.Internal.Bignum.Natural.naturalLe#"]
    kind: Declaration
    type: 'naturalLe# :: Natural
      -> Natural -> Int#'
    template: ~RESULT <= to_unsigned(1,~SIZE[~TYPO]) when ~ARG[0] <= ~ARG[1] else
      to_unsigned(0,~SIZE[~TYPO]);
    warning: 'GHC.Num.Natural.naturalLe#: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalGt#", "GHC.Internal.Bignum.Natural.naturalGt#"]
    kind: Declaration
    type: 'naturalGt# :: Natural
      -> Natural -> Int#'
    template: ~RESULT <= to_unsigned(1,~SIZE[~TYPO]) when ~ARG[0] > ~ARG[1] else to_unsigned(0,~SIZE[~TYPO]);
    warning: 'GHC.Num.Natural.naturalGt#: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalLt#", "GHC.Internal.Bignum.Natural.naturalLt#"]
    kind: Declaration
    type: 'naturalLt# :: Natural
      -> Natural -> Int#'
    template: ~RESULT <= to_unsigned(1,~SIZE[~TYPO]) when ~ARG[0] < ~ARG[1] else to_unsigned(0,~SIZE[~TYPO]);
    warning: 'GHC.Num.Natural.naturalLt#: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalGe#", "GHC.Internal.Bignum.Natural.naturalGe#"]
    kind: Declaration
    type: 'naturalGe# :: Natural
      -> Natural -> Int#'
    template: ~RESULT <= to_unsigned(1,~SIZE[~TYPO]) when ~ARG[0] >= ~ARG[1] else
      to_unsigned(0,~SIZE[~TYPO]);
    warning: 'GHC.Num.Natural.naturalGe#: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalShiftL#", "GHC.Internal.Bignum.Natural.naturalShiftL#"]
    kind: Declaration
    type: 'naturalShiftL#
      :: Natural -> Word# -> Natural'
    template: |-
      ~GENSYM[~RESULT_shiftL][0] : block
        signal ~GENSYM[sh][1] : natural;
      begin
        ~SYM[1] <=
            -- pragma translate_off
            natural'high when (~VAR[shI][1](~SIZE[~TYP[1]]-1 downto 31) /= 0) else
            -- pragma translate_on
            to_integer(~VAR[shI][1]);
        ~RESULT <= shift_left(~ARG[0],~SYM[1]);
      end block;
    warning: 'GHC.Num.Natural.naturalShiftL#: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalShiftR#", "GHC.Internal.Bignum.Natural.naturalShiftR#"]
    kind: Declaration
    type: 'naturalShiftR#
      :: Natural -> Word# -> Natural'
    template: |-
      ~GENSYM[~RESULT_shiftR][0] : block
        signal ~GENSYM[sh][1] : natural;
      begin
        ~SYM[1] <=
            -- pragma translate_off
            natural'high when (~VAR[shI][1](~SIZE[~TYP[1]]-1 downto 31) /= 0) else
            -- pragma translate_on
            to_integer(~VAR[shI][1]);
        ~RESULT <= shift_right(~ARG[0],~SYM[1]);
      end block;
    warning: 'GHC.Num.Natural.naturalShiftR#: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'
- BlackBox:
    name: ["GHC.Num.Natural.naturalCompare", "GHC.Internal.Bignum.Natural.naturalCompare"]
    kind: Declaration
    type: 'naturalCompare
      :: Natural -> Natural -> Ordering'
    template: |-
      -- begin naturalCompare
      ~RESULT <= "00" when ~ARG[0] < ~ARG[1] else
               "01" when ~ARG[0] = ~ARG[1] else
               "10";
      -- end naturalCompare
- BlackBox:
    name: ["GHC.Num.Natural.naturalQuot", "GHC.Internal.Bignum.Natural.naturalQuot"]
    kind: Declaration
    type: 'naturalQuot ::
      Natural -> Natural -> Natural'
    template: |-
      ~RESULT <= ~ARG[0] / ~ARG[1]
          -- pragma translate_off
          when (~ARG[1] /= 0) else (others => 'X')
          -- pragma translate_on
          ;
    warning: 'GHC.Num.Natural.naturalQuot: Naturals are dynamically sized in simulation,
      but fixed-length after synthesis. Use carefully.'