private static XElement CreateFileElement(string path, string type, string library, ExecutionType assoc) { XElement element = new XElement(xm + "file"); element.SetAttributeValue(xm + "name", path); element.SetAttributeValue(xm + "type", type); if (!string.IsNullOrEmpty(library)) { element.Add(new XElement(xm + "library", new XAttribute(xm + "name", library))); } // Determine Association for sim/synthesis if (EnumHelpers.ExecutionTypeMatchesRequirement(ExecutionType.SimulationOnly, assoc)) { XElement childAssociation = new XElement(xm + "association"); childAssociation.SetAttributeValue(xm + "name", "BehavioralSimulation"); element.Add(childAssociation); } if (EnumHelpers.ExecutionTypeMatchesRequirement(ExecutionType.SynthesisOnly, assoc)) { XElement childAssociation = new XElement(xm + "association"); childAssociation.SetAttributeValue(xm + "name", "Implementation"); element.Add(childAssociation); } return(element); }
public string ToString(ExecutionType execution) { StringBuilder builder = new StringBuilder(); List <IModule> modules = ReferenceHelper.SortModulesByReference(Modules); for (int i = modules.Count - 1; i >= 0; i--) { if (EnumHelpers.ExecutionTypeMatchesRequirement(execution, modules[i].Execution)) { builder.AppendLine(IModuleToPrjLine(modules[i])); } } return(builder.ToString()); }