public override void visit(ComponentAssembly obj) { var layoutFile = (obj.Impl.Impl as GME.MGA.MgaFCO).RegistryValue["layoutFile"]; if (layoutFile != null) { var pathLayoutFile = Path.Combine(obj.Impl.GetDirectoryPath(ComponentLibraryManager.PathConvention.ABSOLUTE), layoutFile); var layoutParser = new Layout.LayoutParser(pathLayoutFile, CodeGenerator.Logger) { parentInstanceGUID = (obj.Impl.Impl as GME.MGA.MgaFCO). RegistryValue["Elaborator/InstanceGUID_Chain"] }; Logger.WriteDebug("Parent GUID : {0}", layoutParser.parentInstanceGUID); layoutParser.BuildMaps(); CodeGenerator.preRouted.Add(obj, layoutParser); } }
public override void visit(ComponentAssembly obj) { var layoutFile = (obj.Impl.Impl as GME.MGA.MgaFCO).RegistryValue["layoutFile"]; int ancestorsWithLayoutJson = Layout.LayoutGenerator.getAncestorModels((GME.MGA.MgaFCO)obj.Impl.Impl).Where(parent => parent.RegistryValue["layoutFile"] != null).Count(); // we only care about the top-most layout.json if (layoutFile != null && ancestorsWithLayoutJson == 0) { var pathLayoutFile = Path.Combine(obj.Impl.GetDirectoryPath(ComponentLibraryManager.PathConvention.ABSOLUTE), layoutFile); var managedGUID = CyPhy2Schematic.Layout.LayoutGenerator.GetComponentAssemblyManagedGuid(obj.Impl.Impl as GME.MGA.MgaModel); var layoutParser = new Layout.LayoutParser(pathLayoutFile, CodeGenerator.Logger, CodeGenerator) { parentInstanceGUID = string.IsNullOrEmpty(managedGUID) == false ? managedGUID: CyPhy2Schematic.Layout.LayoutGenerator.GetComponentAssemblyChainGuid(obj.Impl.Impl as GME.MGA.MgaModel), parentGUID = CyPhy2Schematic.Layout.LayoutGenerator.GetComponentAssemblyID(obj.Impl.Impl as GME.MGA.MgaModel) }; Logger.WriteDebug("Design \"{0}\" is using layoutFile \"{1}\". Parent GUID : {2}", obj.Name, layoutFile, layoutParser.parentInstanceGUID ?? "[null]"); layoutParser.BuildMaps(); CodeGenerator.preRouted.Add(obj, layoutParser); } }
public Result GenerateCode() { Result result = new Result(); // map the root testbench obj var testbench = TonkaClasses.TestBench.Cast(this.mainParameters.CurrentFCO); if (testbench == null) { Logger.WriteError("Invalid context of invocation <{0}>, invoke the interpreter from a Testbench model", this.mainParameters.CurrentFCO.Name); return(result); } var TestBench_obj = new TestBench(testbench); BasePath = testbench.Path; CommonTraversal(TestBench_obj); GenerateReferenceDesignatorMappingTable(TestBench_obj); switch (mode) { case Mode.EDA: var eagleSch = GenerateSchematicCode(TestBench_obj); CopyBoardFilesSpecifiedInPcbComponent(TestBench_obj); CopyBoardFilesSpecifiedInTestBench(TestBench_obj); // copy DRU/board template file if the testbench has it specified GenerateLayoutCodeResult glcResult = GenerateLayoutCode(eagleSch, TestBench_obj); // MOT-782 result.bonesFound = glcResult.bonesFound; var layout = glcResult.boardLayout; GenerateChipFitCommandFile(); GenerateShowChipFitResultsCommandFile(); GeneratePlacementCommandFile(); GeneratePlaceOnlyCommandFile(); GenerateLayoutReimportFiles(layout); result.runCommandArgs = GenerateCommandArgs(TestBench_obj); break; case Mode.SPICE_SI: // parse and map the nets to ports signalIntegrityLayout = new Layout.LayoutParser("layout.json", Logger, this) { mode = this.mode }; signalIntegrityLayout.BuildMaps(); // spice code generator uses the mapped traces // to generate subcircuits for traces and inserts them appropriately GenerateSpiceCode(TestBench_obj); GenerateSpiceCommandFile(TestBench_obj); break; case Mode.SPICE: GeneratePopulateTemplateScriptFile(); GenerateSpiceCode(TestBench_obj); GenerateSpiceCommandFile(TestBench_obj); GenerateSpiceViewerLauncher(); break; default: throw new NotSupportedException(String.Format("Mode {0} is not supported", mode.ToString())); } return(result); }
public Result GenerateCode() { Result result = new Result(); // map the root testbench obj var testbench = TonkaClasses.TestBench.Cast(this.mainParameters.CurrentFCO); if (testbench == null) { Logger.WriteError("Invalid context of invocation <{0}>, invoke the interpreter from a Testbench model", this.mainParameters.CurrentFCO.Name); return result; } var TestBench_obj = new TestBench(testbench); BasePath = testbench.Path; CommonTraversal(TestBench_obj); GenerateReferenceDesignatorMappingTable(TestBench_obj); switch (mode) { case Mode.EDA: var eagle = GenerateSchematicCode(TestBench_obj); GenerateLayoutCode(eagle, TestBench_obj); CopyBoardFiles(TestBench_obj); // copy DRU/board template file if the testbench has it specified GenerateChipFitCommandFile(); GenerateShowChipFitResultsCommandFile(); GeneratePlacementCommandFile(); GeneratePlaceOnlyCommandFile(); result.runCommandArgs = GenerateCommandArgs(TestBench_obj); break; case Mode.SPICE_SI: // parse and map the nets to ports signalIntegrityLayout = new Layout.LayoutParser("layout.json", Logger) { mode = this.mode }; signalIntegrityLayout.BuildMaps(); // spice code generator uses the mapped traces // to generate subcircuits for traces and inserts them appropriately GenerateSpiceCode(TestBench_obj); GenerateSpiceCommandFile(TestBench_obj); break; case Mode.SPICE: GenerateSpiceCode(TestBench_obj); GenerateSpiceCommandFile(TestBench_obj); GenerateSpiceViewerLauncher(); break; default: throw new NotSupportedException(String.Format("Mode {0} is not supported", mode.ToString())); } return result; }