Exemple #1
0
        private GenerateLayoutCodeResult GenerateLayoutCode(Eagle.eagle eagle, Schematic.TestBench TestBench_obj)
        {
            // write layout file
            string layoutFile = Path.Combine(this.mainParameters.OutputDirectory, "layout-input.json");
            var    myLayout   = new Layout.LayoutGenerator(eagle.drawing.Item as Eagle.schematic, TestBench_obj, Logger, this.mainParameters.OutputDirectory, this,
                                                           onlyConsiderExactConstraints: ((CyPhy2Schematic_Settings)mainParameters.config).onlyConsiderExactConstraints);

            myLayout.Generate(layoutFile);
            GenerateLayoutCodeResult result = new GenerateLayoutCodeResult();

            result.bonesFound  = myLayout.bonesFound; // MOT-782
            result.boardLayout = myLayout.boardLayout;
            return(result);
        }
Exemple #2
0
        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);
        }