Skip to content
Snippets Groups Projects
Commit 7065bd2d authored by Wesley W. Terpstra's avatar Wesley W. Terpstra Committed by Tomasz Wlostowski
Browse files

wb_onewire_master: Add a local logarithm function to get it to compile under ISE.


Signed-off-by: default avatarTomasz Wlostowski <tomasz.wlostowski@cern.ch>
parent 35fd6da7
Branches
Tags
No related merge requests found
......@@ -105,18 +105,26 @@ module sockit_owm #(
// local parameters
//////////////////////////////////////////////////////////////////////////////
function integer clogb2;
input [31:0] value;
begin
for (clogb2 = 0; value > 0; clogb2 = clogb2 + 1)
value = value >> 1;
end
endfunction
// size of combined power and select registers
localparam PDW = (BDW==32) ? 24 : 8;
// size of boudrate generator counter (divider for normal mode is largest)
localparam CDW = CDR_E ? ((BDW==32) ? 16 : 8) : $clog2(CDR_N);
localparam CDW = CDR_E ? ((BDW==32) ? 16 : 8) : clogb2(CDR_N);
// size of port select signal
localparam SDW = $clog2(OWN);
localparam SDW = clogb2(OWN);
// size of cycle timing counter
localparam TDW = (T_RSTH_O+T_RSTL_O) > (T_RSTH_N+T_RSTL_N)
? $clog2(T_RSTH_O+T_RSTL_O) : $clog2(T_RSTH_N+T_RSTL_N);
? clogb2(T_RSTH_O+T_RSTL_O) : clogb2(T_RSTH_N+T_RSTL_N);
//////////////////////////////////////////////////////////////////////////////
// local signals
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment