packages feed

clash-verilog-0.7: primitives/CLaSH.Promoted.Nat.json

[ { "BlackBox" :
    { "name"      : "CLaSH.Promoted.Nat.powSNat"
    , "type"      : "CLaSH.Promoted.Nat.powSNat :: SNat a -> SNat b -> SNat (a^b)"
    , "templateE" : "~LIT[0] ** ~LIT[1]"
    }
  }
, { "BlackBox" :
    { "name"      : "CLaSH.Promoted.Nat.flogBaseSNat"
    , "type"      : "CLaSH.Promoted.Nat.flogBaseSNat :: (2 <= base, 1 <= x)
                                                     => SNat base -- ARG[2]
                                                     -> SNat x    -- ARG[3]
                                                     -> SNat (FLog base x"
    , "templateD" :
"// flogBaseSNat begin
function integer ~GENSYM[flogBase][0];
  input integer base, value;
  begin
    for (~SYM[0] = 0; value >= base; ~SYM[0]=~SYM[0]+1)
      value = value / base;
  end
endfunction

assign ~RESULT = ~SYM[0](~LIT[2],~LIT[3]);
// flogBaseSNat end"
    }
  }
, { "BlackBox" :
    { "name"      : "CLaSH.Promoted.Nat.clogBaseSNat"
    , "type"      : "CLaSH.Promoted.Nat.clogBaseSNat :: (2 <= base, 1 <= x)
                                                     => SNat base -- ARG[2]
                                                     -> SNat x    -- ARG[3]
                                                     -> SNat (CLog base x"
    , "templateD" :
"// clogBaseSNat begin
function integer ~GENSYM[clogBase][0];
  input integer base, value;
  begin
    for (~SYM[0] = 0; base ** ~SYM[0] < value; ~SYM[0]=~SYM[0]+1);
  end
endfunction

assign ~RESULT = ~SYM[0](~LIT[2],~LIT[3]);
// clogBaseSNat end"
    }
  }
, { "BlackBox" :
    { "name"      : "CLaSH.Promoted.Nat.logBaseSNat"
    , "type"      : "CLaSH.Promoted.Nat.logBaseSNat :: (FLog base x ~ CLog base x)
                                                    => SNat base -- ARG[1]
                                                    -> SNat x    -- ARG[2]
                                                    -> SNat (Log base x)"
    , "templateD" :
"// logBaseSNat begin
function integer ~GENSYM[logBase][0];
  input integer base, value;
  begin
    for (~SYM[0] = 0; value >= base; ~SYM[0]=~SYM[0]+1)
      value = value / base;
  end
endfunction

assign ~RESULT = ~SYM[0](~LIT[1],~LIT[2]);
// logBaseSNat end"
    }
  }
]