1 // ==================================================================
2 // >>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<
3 // ------------------------------------------------------------------
4 // Copyright (c) 2006-2011 by Lattice Semiconductor Corporation
6 // ------------------------------------------------------------------
8 // IMPORTANT: THIS FILE IS AUTO-GENERATED BY THE LATTICEMICO SYSTEM.
12 // Lattice Semiconductor grants permission to use this code
13 // pursuant to the terms of the Lattice Semiconductor Corporation
14 // Open Source License Agreement.
18 // Lattice Semiconductor provides no warranty regarding the use or
19 // functionality of this code. It is the user's responsibility to
20 // verify the user's design for consistency and functionality through
21 // the use of formal verification methods.
23 // --------------------------------------------------------------------
25 // Lattice Semiconductor Corporation
26 // 5555 NE Moore Court
27 // Hillsboro, OR 97214
30 // TEL: 1-800-Lattice (USA and Canada)
31 // 503-286-8001 (other locations)
33 // web: http://www.latticesemi.com/
34 // email: techsupport@latticesemi.com
36 // --------------------------------------------------------------------
38 // Project : LatticeMico32
39 // File : lm32_functions.v
40 // Title : Common functions
43 // Version : 7.0SP2, 3.0
46 // : Added function to generate log-of-two that rounds-up to
48 // =============================================================================
50 function integer clogb2;
53 for (clogb2 = 0; value > 0; clogb2 = clogb2 + 1)
58 function integer clogb2_v1;
65 for (i = 0; temp < value; i = i + 1)