Beispiel #1
0
        public static BuildResult BuildProject(string workingDirectory, string projectFilePath, string topModule)
        {
            string fusePath = XilinxHelper.GetXilinxToolPath("fuse.exe");

            if (string.IsNullOrEmpty(fusePath))
            {
                fusePath = XilinxHelper.GetXilinxToolPath("fuse");
                if (string.IsNullOrEmpty(fusePath))
                {
                    throw new Exception("Unable to find the fuse Executable");
                }
            }

            // Create prj file on disk
            string projectExecutablePath = PathHelper.Combine(workingDirectory, "x.exe");

            List <string> arguments = new List <string>();

            arguments.Add(string.Format("--prj \"{0}\"", projectFilePath));
            //arguments.Add(string.Format("-o \"{0}\"", projectExecutablePath));
            arguments.Add(topModule);

            ProcessHelper.ProcessExecutionResult result = XilinxProcess.ExecuteProcess(workingDirectory, fusePath, arguments);

            BuildResult buildResult = new BuildResult();

            buildResult.BuildLog         = result.StandardOutput + "\n\n\n" + result.StandardError;
            buildResult.WorkingDirectory = workingDirectory;
            buildResult.ExecutableFile   = projectExecutablePath;
            buildResult.Built            = true;

            return(buildResult);
        }
Beispiel #2
0
        public virtual void Execute()
        {
            if (DebugOutput)
            {
                Logger.Instance.VerbosityLevel = Logger.Verbosity.Debug;
            }
            else if (VerboseOutput)
            {
                Logger.Instance.VerbosityLevel = Logger.Verbosity.Low;
            }
            else
            {
                Logger.Instance.VerbosityLevel = Logger.Verbosity.Off;
            }

            // Get Xilinx Root Directory
            if (!DisableXilinxRepository)
            {
                Program.Repository.AddSearchPath(PathHelper.Combine(XilinxHelper.GetRootXilinxPath(), "EDK", "hw"));
            }

            // Get Enivornment Repositories
            if (AdditionalRepositories != null && AdditionalRepositories.Length >= 1)
            {
                foreach (string path in AdditionalRepositories)
                {
                    string fullPath = Path.GetFullPath(path.Trim('"'));
                    Logger.Instance.WriteVerbose("Repository: Adding {0}", fullPath);
                    Program.Repository.AddSearchPath(fullPath);
                }
            }

            // Get Enivornment Repositories
            if (!DisableEnvironmentRepository)
            {
                string environRepos = Environment.GetEnvironmentVariable("REPOSITORY");
                if (!string.IsNullOrEmpty(environRepos))
                {
                    string[] paths = environRepos.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (string path in paths)
                    {
                        string fullPath = Path.GetFullPath(path.Trim('"'));
                        Logger.Instance.WriteVerbose("Repository: Adding {0}", fullPath);
                        Program.Repository.AddSearchPath(fullPath);
                    }
                }
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            bool          debugEnable = false;
            bool          guiEnable   = false;
            List <string> files       = new List <string>();

            foreach (string a in args)
            {
                if (string.Compare(a, "-d", true) == 0)
                {
                    debugEnable = true;
                }
                else if (string.Compare(a, "-g", true) == 0)
                {
                    guiEnable = true;
                }
                else
                {
                    files.Add(a);
                }
            }

            if (debugEnable)
            {
                Logger.Instance.VerbosityLevel = Logger.Verbosity.Debug;
            }

            XilinxRepository repo = new XilinxRepository();

            repo.AddSearchPath(PathHelper.Combine(XilinxHelper.GetRootXilinxPath(), "EDK", "hw"));
            repo.AddSearchPath(@"C:\svn\uni-projects\uqrarg\hardware\Repo");

            string testRoot = PathHelper.Combine(repo.GetLibraryDefaultRootPath("avr_core_v1_00_a"), "test");

            foreach (string file in files)
            {
                string fullFilePath = file;
                if (!Path.IsPathRooted(fullFilePath))
                {
                    fullFilePath = PathHelper.Combine(testRoot, file);
                }

                if (File.Exists(fullFilePath))
                {
                    try
                    {
                        TestRunner runner = new TestRunner(repo, fullFilePath);
                        if (guiEnable)
                        {
                            runner.GuiEnabled = true;
                        }
                        runner.Run();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Exception {0}", ex.Message);
                        Console.WriteLine("{0}", ex.StackTrace);
                        Console.WriteLine("Continuing...");
                    }
                }
                else
                {
                    Logger.Instance.WriteError("{0} does not exist", Path.GetFileName(fullFilePath));
                }
            }
        }