SILICON
Loading...
Searching...
No Matches
yosys_tool.hpp
Go to the documentation of this file.
1/*
2 Copyright (c) 2026. Giulio Cocconi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include <filesystem>
21#include <optional>
22#include <span>
23#include <string>
24#include <string_view>
25
26#include <core/sourceFile.hpp>
27
28namespace SILICON::yosys {
29
31 std::optional<std::filesystem::path> executable;
32 std::optional<std::filesystem::path> technologyLibraryDirectory;
33};
34
36 std::string standardOutput;
37 std::string standardError;
38};
39
40[[nodiscard]] ScriptResult runScript(std::string_view script,
41 const ToolOptions& options = {});
42
44[[nodiscard]] std::string readVerilog(std::string_view source,
45 const ToolOptions& options = {});
46[[nodiscard]] std::string readVerilog(std::span<const SILICON::core::SourceFile> sources,
47 std::string_view entryPath,
48 const ToolOptions& options = {});
49
51[[nodiscard]] std::string elaborateHierarchy(std::string_view json,
52 const ToolOptions& options = {});
53
55[[nodiscard]] std::string writeVerilog(std::string_view json,
56 const ToolOptions& options = {});
57
58} // namespace SILICON::yosys
std::string elaborateHierarchy(const std::string_view json, const ToolOptions &options)
ScriptResult runScript(const std::string_view script, const ToolOptions &options)
std::string writeVerilog(std::string_view json, const ToolOptions &options)
std::string readVerilog(const std::string_view source, const ToolOptions &options)
std::optional< std::filesystem::path > technologyLibraryDirectory
std::optional< std::filesystem::path > executable