/// <summary>
 /// Registers Xilinx IP core models for the design.
 /// </summary>
 /// <param name="dd">the design</param>
 /// <param name="flags">which IP cores should be registered</param>
 public static void RegisterIPCores(this DesignDescriptor dd, EXilinxIPCores flags = EXilinxIPCores.All)
 {
     var plan = dd.GetHLSPlan();
     if (flags.HasFlag(EXilinxIPCores.FloatingPoint))
         plan.AddXILMapper(typeof(FloatingPointCore));
     if (flags.HasFlag(EXilinxIPCores.FixedPointAddSub))
         plan.AddXILMapper(typeof(XilinxAdderSubtracter));
     if (flags.HasFlag(EXilinxIPCores.Cordic))
     {
         plan.AddXILMapper(typeof(XilinxCordic));
         var fpi = (from t in plan.XILSTransformations
                    where t is FixPointImplementor
                    select t as FixPointImplementor).SingleOrDefault();
         if (fpi != null)
             fpi.HaveXilinxCordic = true;
     }
     if (flags.HasFlag(EXilinxIPCores.FixedPointDiv))
         plan.AddXILMapper(typeof(XilinxDivider));
     if (flags.HasFlag(EXilinxIPCores.FixedPointMul))
         plan.AddXILMapper(typeof(XilinxMultiplier));
     if (flags.HasFlag(EXilinxIPCores.BlockMem))
     {
         BlockMemXILMapper bmxm = new BlockMemXILMapper(plan.MemMapper.DefaultRegion);
         plan.AddXILMapper(bmxm);
     }
 }
示例#2
0
        /// <summary>
        /// Registers Xilinx IP core models for the design.
        /// </summary>
        /// <param name="dd">the design</param>
        /// <param name="flags">which IP cores should be registered</param>
        public static void RegisterIPCores(this DesignDescriptor dd, EXilinxIPCores flags = EXilinxIPCores.All)
        {
            var plan = dd.GetHLSPlan();

            if (flags.HasFlag(EXilinxIPCores.FloatingPoint))
            {
                plan.AddXILMapper(typeof(FloatingPointCore));
            }
            if (flags.HasFlag(EXilinxIPCores.FixedPointAddSub))
            {
                plan.AddXILMapper(typeof(XilinxAdderSubtracter));
            }
            if (flags.HasFlag(EXilinxIPCores.Cordic))
            {
                plan.AddXILMapper(typeof(XilinxCordic));
                var fpi = (from t in plan.XILSTransformations
                           where t is FixPointImplementor
                           select t as FixPointImplementor).SingleOrDefault();
                if (fpi != null)
                {
                    fpi.HaveXilinxCordic = true;
                }
            }
            if (flags.HasFlag(EXilinxIPCores.FixedPointDiv))
            {
                plan.AddXILMapper(typeof(XilinxDivider));
            }
            if (flags.HasFlag(EXilinxIPCores.FixedPointMul))
            {
                plan.AddXILMapper(typeof(XilinxMultiplier));
            }
            if (flags.HasFlag(EXilinxIPCores.BlockMem))
            {
                BlockMemXILMapper bmxm = new BlockMemXILMapper(plan.MemMapper.DefaultRegion);
                plan.AddXILMapper(bmxm);
            }
        }