synthesis don't like the std_logic'val(int) construct, change to if/else instead