Exemplo n.º 1
0
        private void CopyEDKFile(string libRoot, string fileName, string libName, XilinxProject xproj)
        {
            string path = xproj.AddFile(fileName);

            xproj.SetFileLibrary(fileName, libName);
            File.Copy(Path.Combine(libRoot, fileName), path, true);
        }
Exemplo n.º 2
0
 private void CopyEDKFile(string libRoot, string fileName, string libName, XilinxProject xproj)
 {
     string path = xproj.AddFile(fileName);
     xproj.SetFileLibrary(fileName, libName);
     File.Copy(Path.Combine(libRoot, fileName), path, true);
 }
        private void CreateUCF(XilinxProject proj)
        {
            string path = proj.AddFile(proj.ProjectName + ".ucf");
            var sw = new StreamWriter(path);
            foreach (var pin in PinList)
            {
                if (pin.AssociatedSignal == null)
                    continue;

                string indexExpr = "";
                if (pin.AssociatedIndex.Length > 0)
                    indexExpr = pin
                     .AssociatedIndex
                     .Select(i => "[" + i + "]")
                     .Aggregate((x, y) => x + y);

                var sd = (ISignalOrPortDescriptor)((IDescriptive)pin.AssociatedSignal).Descriptor;
                var pd = sd.AsSignalRef(SignalRef.EReferencedProperty.Instance)
                    .RelateToComponent(TopLevelComponent.Descriptor)
                    .Desc;

                sw.WriteLine("NET \"{0}{1}\" LOC = {2};",
                    pd.Name, indexExpr, pin.Name);
            }
            foreach (IPortDescriptor pd in TopLevelComponent.Descriptor.GetPorts())
            {
                var sd = pd.BoundSignal;
                if (sd == null)
                    continue;

                var csa = sd.QueryAttribute<ClockSpecAttribute>();
                if (csa == null)
                    continue;

                sw.WriteLine("TIMESPEC TS_{0} = PERIOD \"{1}\" {2} {3};",
                    pd.Name, pd.Name, csa.Period.Value, csa.Period.Unit);
                sw.WriteLine("NET \"{0}\" TNM_NET = \"{1}\";",
                    pd.Name, pd.Name);
            }
            sw.Close();
        }