Пример #1
0
        public void Run()
        {
            _logStream.WriteLine(DirectoryLogging.Summary, $"QRV32 translation completed");
            _logStream.WriteLine(DirectoryLogging.Summary, $"Source location: {_runtimeConfiguration.SourceLocation}");
            _logStream.WriteLine(DirectoryLogging.Summary, $"Config name: {Path.GetFileName(_runtimeConfiguration.ConfigPath)}");

            var config = _runtimeConfiguration.Config;
            var generatedFilesLocation = FileTools.ToAbsolutePath(_runtimeConfiguration.SourceLocation, config.ProjectLocation);

            _logStream.WriteLine(DirectoryLogging.Summary, $"Generated files location: {generatedFilesLocation}");

            var hdlLocation = Path.Combine(Path.GetDirectoryName(_runtimeConfiguration.SourceLocation), "QRV32.HDL");
            var qsfPath     = Path.Combine(hdlLocation, "Verilog.qsf");

            _logStream.WriteLine(DirectoryLogging.Summary, $"Updating quartus files: {qsfPath}");

            if (File.Exists(qsfPath))
            {
                var generatedFiles = _virtualFS
                                     .RecursiveFileNames
                                     .Where(f => Path.GetFileNameWithoutExtension(f) != "Quokka")
                                     .Select(f => Path.Combine(generatedFilesLocation, f))
                                     .OrderBy(f => f)
                                     .ToList();

                foreach (var fileName in generatedFiles)
                {
                    _logStream.WriteLine(DirectoryLogging.Summary, $"Generated file: {fileName}");
                }

                _quartusTools.RemoveGeneratedFiles(qsfPath);
                _quartusTools.AddFiles(qsfPath, generatedFiles);
            }
            else
            {
                _logStream.WriteLine(DirectoryLogging.Summary, $"Project not found");
            }

            _logStream.WriteLine(DirectoryLogging.Summary, $"======================================");
        }
Пример #2
0
        public void Run()
        {
            _logStream.WriteLine(DirectoryLogging.Summary, $"QuSoC translation completed");
            _logStream.WriteLine(DirectoryLogging.Summary, $"Source location: {_runtimeConfiguration.SourceLocation}");
            _logStream.WriteLine(DirectoryLogging.Summary, $"Config name: {_runtimeConfiguration.ConfigName}");

            var config = QuokkaConfigLoader.Load(Path.Combine(_runtimeConfiguration.SourceLocation, _runtimeConfiguration.ConfigName));
            var generatedFilesLocation = FileTools.ToAbsolutePath(Path.Combine(_runtimeConfiguration.SourceLocation, config.ProjectLocation));

            _logStream.WriteLine(DirectoryLogging.Summary, $"Generated files location: {generatedFilesLocation}");

            var hdlLocation = Path.Combine(Path.GetDirectoryName(_runtimeConfiguration.SourceLocation), "QuSoC.HDL");
            var qsfPath     = Path.Combine(hdlLocation, "Verilog.qsf");

            _logStream.WriteLine(DirectoryLogging.Summary, $"Updating quartus files: {qsfPath}");

            if (File.Exists(qsfPath))
            {
                var generatedFiles = _virtualFS
                                     .RecursiveFileNames
                                     .Where(f => Path.GetFileNameWithoutExtension(f) != "Quokka")
                                     .Select(f => Path.Combine(generatedFilesLocation, f))
                                     .OrderBy(f => f)
                                     .ToList();

                foreach (var fileName in generatedFiles)
                {
                    _logStream.WriteLine(DirectoryLogging.Summary, $"Generated file: {fileName}");
                }

                _quartusTools.RemoveGeneratedFiles(qsfPath);
                _quartusTools.AddFiles(qsfPath, generatedFiles);
            }
            else
            {
                _logStream.WriteLine(DirectoryLogging.Summary, $"Project not found");
            }


            var quokkaPath = Path.Combine(hdlLocation, "Quokka.qsf");

            _logStream.WriteLine(DirectoryLogging.Summary, $"Updating quokka files: {quokkaPath}");

            if (File.Exists(qsfPath))
            {
                var quokkaProjects = new[]
                {
                    "BlinkerInf",
                    "Counter"
                };

                var generatedFiles = _virtualFS
                                     .RecursiveFileNames
                                     .Where(f => Path.GetFileNameWithoutExtension(f) != "Quokka")
                                     .Where(f => quokkaProjects.Any(p => f.Contains(p)))
                                     .Select(f => Path.Combine(generatedFilesLocation, f))
                                     .OrderBy(f => f)
                                     .ToList();

                foreach (var fileName in generatedFiles)
                {
                    _logStream.WriteLine(DirectoryLogging.Summary, $"Generated file: {fileName}");
                }

                _quartusTools.RemoveGeneratedFiles(quokkaPath);
                _quartusTools.AddFiles(quokkaPath, generatedFiles);
            }
            else
            {
                _logStream.WriteLine(DirectoryLogging.Summary, $"Project not found");
            }

            _logStream.WriteLine(DirectoryLogging.Summary, $"====================================== {DateTime.Now}");
        }