SILICON
Toggle main menu visibility
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
28
namespace
SILICON::yosys
{
29
30
struct
ToolOptions
{
31
std::optional<std::filesystem::path>
executable
;
32
std::optional<std::filesystem::path>
technologyLibraryDirectory
;
33
};
34
35
struct
ScriptResult
{
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
SILICON::yosys
Definition
component.hpp:37
SILICON::yosys::elaborateHierarchy
std::string elaborateHierarchy(const std::string_view json, const ToolOptions &options)
Definition
yosys_tool.cpp:461
SILICON::yosys::runScript
ScriptResult runScript(const std::string_view script, const ToolOptions &options)
Definition
yosys_tool.cpp:322
SILICON::yosys::writeVerilog
std::string writeVerilog(std::string_view json, const ToolOptions &options)
Definition
yosys_tool.cpp:494
SILICON::yosys::readVerilog
std::string readVerilog(const std::string_view source, const ToolOptions &options)
Definition
yosys_tool.cpp:401
sourceFile.hpp
SILICON::yosys::ScriptResult
Definition
yosys_tool.hpp:35
SILICON::yosys::ScriptResult::standardOutput
std::string standardOutput
Definition
yosys_tool.hpp:36
SILICON::yosys::ScriptResult::standardError
std::string standardError
Definition
yosys_tool.hpp:37
SILICON::yosys::ToolOptions
Definition
yosys_tool.hpp:30
SILICON::yosys::ToolOptions::technologyLibraryDirectory
std::optional< std::filesystem::path > technologyLibraryDirectory
Definition
yosys_tool.hpp:32
SILICON::yosys::ToolOptions::executable
std::optional< std::filesystem::path > executable
Definition
yosys_tool.hpp:31
src
core
serialization
yosys
yosys_tool.hpp
Generated by
1.17.0