clash-lib-0.99: prims/commonverilog/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"
, "imports" : ["~INCLUDENAME.inc"]
, "include" :
{ "name" : "flogBase"
, "extension" : "inc"
, "content" :
"// floor of logBase
function integer ~INCLUDENAME;
input integer base, value;
begin
for (~INCLUDENAME = 0; value >= base; ~INCLUDENAME=~INCLUDENAME+1)
value = value / base;
end
endfunction"
}
, "templateE" : "~INCLUDENAME(~LIT[2],~LIT[3])"
}
}
, { "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"
, "imports" : ["~INCLUDENAME.inc"]
, "include" :
{ "name" : "clogBase"
, "extension" : "inc"
, "content" :
"// ceiling of logBase
function integer ~INCLUDENAME;
input integer base, value;
begin
for (~INCLUDENAME = 0; base ** ~INCLUDENAME < value; ~~INCLUDENAME=~INCLUDENAME+1);
end
endfunction"
}
, "templateE" : "~INCLUDENAME(~LIT[2],~LIT[3])"
}
}
, { "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)"
, "imports" : ["~INCLUDENAME.inc"]
, "include" :
{ "name" : "clogBase"
, "extension" : "inc"
, "content" :
"// logBaseSNat begin
function integer ~INCLUDENAME;
input integer base, value;
begin
for (~INCLUDENAME = 0; value >= base; ~INCLUDENAME=~INCLUDENAME+1)
value = value / base;
end
endfunction"
}
, "templateE" : "~INCLUDENAME(~LIT[1],~LIT[2])"
}
}
]