#### Cesar0182

##### Member level 5

**Error: Subprogram <mmcm_count_calc> does not have a body when creating vhdl package.**

Greetings ... comment that I am new creating vhdl packages and a couple of days ago I am trying to create one, but I am having the following error shown in the image.

Can someone please help me with this error? I leave the code I am using.

Code:

```
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_unsigned.all;
USE ieee.std_logic_misc.all;
USE ieee.numeric_std.all;
package g1_mmcme2_drp_func_vhdl is
function mmcm_count_calc (divide : std_logic_vector(7 downto 0) ; phase: std_logic_vector(31 downto 0) ; duty_cycle : integer) return std_logic_vector(37 downto 0);
end package g1_mmcme2_drp_func_vhdl;
package body g1_mmcme2_drp_func_vhdl is
function mmcm_count_calc (
divide : in std_logic_vector(7 downto 0); -- Max divide is 128
phase : in std_logic_vector(31 downto 0);
duty_cycle : integer) -- Multiplied by 100,000
return std_logic_vector is
variable div_calc : std_logic_vector(13 downto 0);
variable phase_calc : std_logic_vector(16 downto 0);
begin
div_calc := mmcm_divider(divide, std_logic_vector(to_unsigned(duty_cycle,32)));
-- mx[10:9], pm[8:6], dt[5:0]
phase_calc(10 downto 0) := mmcm_phase(divide, phase);
-- Return value is the upper and lower address of counter
-- Upper address is:
-- RESERVED [31:26]
-- MX [25:24]
-- EDGE [23]
-- NOCOUNT [22]
-- DELAY_TIME [21:16]
-- Lower Address is:
-- PHASE_MUX [15:13]
-- RESERVED [12]
-- HIGH_TIME [11:6]
-- LOW_TIME [5:0]
return
-- Upper Address
"000000000000" & phase_calc(10 downto 9) & div_calc(13 downto 12) & phase_calc(5 downto 0) &
-- Lower Address
phase_calc(8 downto 6) & '0' & div_calc(11 downto 0);
end function;
end g1_mmcme2_drp_func_vhdl;
```