Example #1
0
        static int Main(string[] args)
        {
            Repository = new XilinxRepository();

            ConsoleController controller = new ConsoleController();

            // Main Commands
            controller.Register(typeof(HelpCommand));

            // Core Commands
            controller.Register(typeof(CoreTreeCommand));
            controller.Register(typeof(CoreXiseGenCommand));
            controller.Register(typeof(CorePrjGenCommand));
            controller.Register(typeof(CoreISimCommand));
            controller.Register(typeof(CoreSynthesizeCommand));
            controller.Register(typeof(DeviceInformationCommand));
            controller.Register(typeof(ClearCacheCommand));

            // Set default command
            controller.SetDefaultCommand(typeof(HelpCommand));

            // For debugging purposes allow exceptions to passthrough the handler.
            controller.RethrowExceptions = true;

            try
            {
                return(controller.Execute(args));
            }
            catch
            {
                HelpCommand help = new HelpCommand();
                help.Execute();
#if DEBUG
                throw;
#endif
            }
#if !DEBUG
            return(1);
#endif
        }
Example #2
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));
                }
            }
        }
Example #3
0
 public TestRunner(XilinxRepository repo, string testBenchPath)
 {
     TestBenchPath = testBenchPath;
     Repository    = repo;
 }