Esempio n. 1
0
 private static void CreateRMap()
 {
     _rmap = new Dictionary <string, EDeviceResource>();
     foreach (var value in Enum.GetValues(typeof(EDeviceResource)))
     {
         string str = PropEnum.ToString(value, EPropAssoc.PARReport);
         _rmap[str] = (EDeviceResource)value;
     }
 }
Esempio n. 2
0
        private void PostInitializeProperties()
        {
            Properties[EXilinxProjectProperties.PROP_DevFamilyPMName] =
                PropEnum.ToString(
                    Properties[EXilinxProjectProperties.DeviceFamily], EPropAssoc.CoreGen);

            if (TopLevelComponent != null)
            {
                var gi = TopLevelComponent.QueryAttribute <VHDLGenInfo>();
                PutProperty(EXilinxProjectProperties.AutoImplementationTop, false);
                PutProperty(EXilinxProjectProperties.ImplementationTop, "Architecture|" + gi.EntityName + "|" + gi.DefaultArch);
                PutProperty(EXilinxProjectProperties.ImplementationTopInstancePath, VHDLGenInfo.GetInstancePath(TopLevelComponent));
                PutProperty(EXilinxProjectProperties.ImplementationTopFile, gi.FileName);
            }
        }
Esempio n. 3
0
        public void Save()
        {
            PostInitializeProperties();

            string        path = MakeFullPath(ProjectName + ".xise");
            XmlTextWriter wr   = new XmlTextWriter(path, Encoding.UTF8);

            wr.Formatting = Formatting.Indented;
            wr.WriteStartDocument(false);
            //wr.WriteStartElement("project", "http://www.xilinx.com/XMLSchema");
            wr.WriteStartElement("project");
            wr.WriteAttributeString("xmlns", "http://www.xilinx.com/XMLSchema");
            wr.WriteAttributeString("xmlns:xil_pn", "http://www.xilinx.com/XMLSchema");
            wr.WriteStartElement("header");
            wr.WriteEndElement();

            wr.WriteStartElement("version");

            wr.WriteAttributeString("xil_pn:ise_version", PropEnum.ToString(ISEVersion, EPropAssoc.ISE));
            wr.WriteAttributeString("xil_pn:schema_version", "2");
            wr.WriteEndElement();

            var    libraries = new HashSet <string>();
            string ucf       = null;

            wr.WriteStartElement("files");
            foreach (string file in _projectFiles)
            {
                string type = GetFileType(file);
                wr.WriteStartElement("file");
                wr.WriteAttributeString("xil_pn:name", MakeUNIXPath(file));
                wr.WriteAttributeString("xil_pn:type", type);
                EComponentPurpose purpose = LookupAttribute <EComponentPurpose>(file);
                if (purpose == EComponentPurpose.SimulationAndSynthesis ||
                    purpose == EComponentPurpose.SimulationOnly)
                {
                    wr.WriteStartElement("association");
                    wr.WriteAttributeString("xil_pn:name", "BehavioralSimulation");
                    wr.WriteEndElement();
                }
                if (purpose == EComponentPurpose.SimulationAndSynthesis ||
                    purpose == EComponentPurpose.SynthesisOnly)
                {
                    wr.WriteStartElement("association");
                    wr.WriteAttributeString("xil_pn:name", "Implementation");
                    wr.WriteEndElement();
                }
                var library = LookupAttribute <LibraryAttribute>(file);
                if (library != null)
                {
                    wr.WriteStartElement("library");
                    wr.WriteAttributeString("xil_pn:name", library.Name);
                    libraries.Add(library.Name);
                    wr.WriteEndElement();
                }
                wr.WriteEndElement();
            }
            wr.WriteEndElement();

            wr.WriteStartElement("properties");
            IList <PropDesc> allProps = PropEnum.EnumProps(typeof(EXilinxProjectProperties));

            foreach (PropDesc pdesc in allProps)
            {
                string propID;
                if (!pdesc.IDs.TryGetValue(EPropAssoc.ISE, out propID))
                {
                    continue;
                }
                object propVal;
                //if (!Properties.TryGetValue(propID, out propVal))
                if (!Properties.TryGetValue((EXilinxProjectProperties)pdesc.EnumValue, out propVal))
                {
                    propVal = pdesc.DefaultValue;
                }
                bool   isDefault  = propVal.Equals(pdesc.DefaultValue);
                string propValStr = PropEnum.ToString(propVal, EPropAssoc.ISE);
                wr.WriteStartElement("property");
                wr.WriteAttributeString("xil_pn:name", propID);
                wr.WriteAttributeString("xil_pn:value", propValStr);
                wr.WriteAttributeString("xil_pn:valueState", isDefault ? "default" : "non-default");
                wr.WriteEndElement();
            }
            wr.WriteEndElement();

            wr.WriteStartElement("bindings");
            if (ucf != null && TopLevelComponent != null)
            {
                var gi = TopLevelComponent.QueryAttribute <VHDLGenInfo>();
                wr.WriteStartElement("binding");
                wr.WriteAttributeString("xil_pn:location", "/" + gi.EntityName);
                wr.WriteAttributeString("xil_pn:name", ucf);
                wr.WriteEndElement();
            }
            wr.WriteEndElement();

            wr.WriteStartElement("libraries");
            foreach (string lib in libraries)
            {
                wr.WriteStartElement("library");
                wr.WriteAttributeString("xil_pn:name", lib);
                wr.WriteEndElement();
            }
            wr.WriteEndElement();

            wr.WriteStartElement("autoManagedFiles");
            wr.WriteEndElement();

            wr.WriteEndElement();
            wr.Close();

            if (TwinProject != null)
            {
                TwinProject.Save();
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Combines device, speed grade and package to a part name.
 /// </summary>
 public static string MakePartName(EDevice device, ESpeedGrade grade, EPackage package)
 {
     return(device.ToString() +
            PropEnum.ToString(grade, EPropAssoc.ISE) + "-" +
            package.ToString());
 }
Esempio n. 5
0
 /// <summary>
 /// Translates an ISE version to its textual identifier.
 /// </summary>
 public static string GetVersionText(this EISEVersion ver)
 {
     return(PropEnum.ToString(ver, EPropAssoc.ISE));
 }