2 use ieee.std_logic_1164.all;
8 function fxm_to_num(fxm: std_ulogic_vector(7 downto 0)) return integer;
9 function num_to_fxm(num: integer) return std_ulogic_vector;
10 end package crhelpers;
12 package body crhelpers is
14 function fxm_to_num(fxm: std_ulogic_vector(7 downto 0)) return integer is
16 -- If multiple fields are set (undefined), match existing
17 -- hardware by returning the first one.
19 -- Big endian bit numbering
20 if fxm(7-i) = '1' then
25 -- If no fields are set (undefined), also match existing
26 -- hardware by returning cr7.
30 function num_to_fxm(num: integer) return std_ulogic_vector is
54 end package body crhelpers;