protected override void DoCommandAction() { IslandStyleSystemParameter systemParameter = new IslandStyleSystemParameter(); systemParameter.Read(XMLSpecificationInput); if (systemParameter.PartialAreas.Count != 1) { throw new ArgumentException("Expecting only one island"); } if (!Directory.Exists(XMLSpecificationOutputDirectory)) { Directory.CreateDirectory(XMLSpecificationOutputDirectory); } foreach (KeyValuePair <string, PartialAreaSetting> tupel in systemParameter.PartialAreas) { if (tupel.Value.Modules.Count != 1) { throw new ArgumentException("Expecting only one module setting"); } ModuleSetting ms = tupel.Value.Modules[0]; if (!ms.Settings.ContainsKey("netlist") || !ms.Settings.ContainsKey("name")) { throw new ArgumentException("Expecting a value for a netlist and name in the module setting"); } string path = ms.Settings["netlist"]; string name = ms.Settings["name"]; // is it a file if (!File.Exists(path)) { throw new ArgumentException("File " + path + " does not exist"); } FindPlacementForReconfigurableArea selCmd = new FindPlacementForReconfigurableArea(); selCmd.InstancePrefix = name; selCmd.XDLModules.Add(path); selCmd.TopN = TopN; selCmd.UserSelectionPrefix = "min_frag_for_placing_an_island_"; CommandExecuter.Instance.Execute(selCmd); for (int i = 1; i < TopN; i++) { systemParameter.PartialAreas[tupel.Key].Nodes[IslandStyleSystemParameter.Geometry].InnerText = ""; foreach (Command cmd in FPGA.TileSelectionManager.Instance.GetListOfAddToSelectionXYCommandsForUserSelection("min_frag_for_placing_an_island_" + i)) { systemParameter.PartialAreas[tupel.Key].Nodes[IslandStyleSystemParameter.Geometry].InnerText += cmd.ToString(); } string projectDir = XMLSpecificationOutputDirectory + @"\run" + i.ToString() + @"\"; systemParameter.StaticParameter[IslandStyleSystemParameter.ISEProjectDir].InnerText = projectDir; string specificationOutputFileWithoutExtension = projectDir + Path.GetFileNameWithoutExtension(XMLSpecificationInput); // save modifications systemParameter.XmlDoc.Save(specificationOutputFileWithoutExtension + ".xml"); } } }
protected override void DoCommandAction() { IslandStyleSystemParameter systemParameter = new IslandStyleSystemParameter(); systemParameter.Read(XMLSpecification); string staticProjectDir = systemParameter.StaticParameter[IslandStyleSystemParameter.ISEProjectDir].InnerText; string partialProjectDir = systemParameter.PartialParameter[IslandStyleSystemParameter.ISEProjectDir].InnerText; List <string> partialAreaPlaceholderVHDLFiles = new List <string>(); List <string> partialAreas = new List <string>(); // the blokcer around the partial areas List <string> staticPlaceHolder = new List <string>(); List <string> modulesPerArea = new List <string>(); // run the selection commands as the BuildIslandStyleStaticSystem works on them foreach (KeyValuePair <string, PartialAreaSetting> tupel in systemParameter.PartialAreas) { string selCommand = tupel.Value.Settings[IslandStyleSystemParameter.Geometry]; string prName = tupel.Key; partialAreas.Add(tupel.Key); partialAreaPlaceholderVHDLFiles.Add(staticProjectDir + "partial_area_placeholder_" + tupel.Key + ".vhd"); CommandExecuter.Instance.Execute(new ClearSelection()); CommandExecuter.Instance.Execute(selCommand); CommandExecuter.Instance.Execute(new ExpandSelection()); StoreCurrentSelectionAs storeAsCmd = new StoreCurrentSelectionAs(); storeAsCmd.UserSelectionType = prName; CommandExecuter.Instance.Execute(storeAsCmd); // assign the interfaces LoadInterfaceAsCSV loadInterfaceCmd = new LoadInterfaceAsCSV(); loadInterfaceCmd.FileName = tupel.Value.Settings[IslandStyleSystemParameter.Interface]; loadInterfaceCmd.PartialArea = prName; CommandExecuter.Instance.Execute(loadInterfaceCmd); staticPlaceHolder.Add(partialProjectDir + "static_placeholder_" + prName + ".vhd"); foreach (ModuleSetting moduleSetting in tupel.Value.Modules) { modulesPerArea.Add(prName + ":" + moduleSetting.Settings["path"]); } } List <string> connectionPrimitives = new List <string>(); foreach (KeyValuePair <string, PartialAreaSetting> tupel in systemParameter.PartialAreas) { connectionPrimitives.Add(tupel.Value.Settings[IslandStyleSystemParameter.ConnectionPrimitive]); } // read in the macro // CommandExecuter.Instance.Execute(systemParameter.SystemParameter[IslandStyleSystemParameter.ConnectionPrimitive].InnerText); // build static BuildIslandStyleStaticSystem buildStaticCmd = new BuildIslandStyleStaticSystem(); buildStaticCmd.ProjectDirectory = staticProjectDir; buildStaticCmd.ConnectionPrimitives = connectionPrimitives; buildStaticCmd.PartialAreas = partialAreas; buildStaticCmd.PartialAreaPlaceholderVHDLFiles = partialAreaPlaceholderVHDLFiles; CommandExecuter.Instance.Execute(buildStaticCmd); BuildIslandStyleModule buildModuleCmd = new BuildIslandStyleModule(); buildModuleCmd.ProjectDirectory = partialProjectDir; buildModuleCmd.ConnectionPrimitives = connectionPrimitives; buildModuleCmd.ModulesPerArea = modulesPerArea; buildModuleCmd.PartialAreas = partialAreas; buildModuleCmd.TopVHDLFile = partialProjectDir + systemParameter.PartialParameter[IslandStyleSystemParameter.VHDL].InnerText; buildModuleCmd.VHDLWrapper = staticPlaceHolder; CommandExecuter.Instance.Execute(buildModuleCmd); }