SILICON
Loading...
Searching...
No Matches
verilog.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 <span>
21#include <string>
22#include <string_view>
23
25#include <core/sourceFile.hpp>
26
27namespace SILICON::core {
28class Circuit;
29}
30
31namespace SILICON::verilog {
32
34
35[[nodiscard]] std::string read(std::string_view source,
36 const yosys::ToolOptions& options = {});
37[[nodiscard]] std::string read(std::span<const SourceFile> sources,
38 std::string_view entryPath,
39 const yosys::ToolOptions& options = {});
40
42[[nodiscard]] std::string postprocess(std::string_view source);
43
44[[nodiscard]] std::string write(std::string_view yosysJson,
45 const yosys::ToolOptions& options = {});
46[[nodiscard]] std::string write(const core::Circuit& circuit, std::string_view moduleName,
47 const yosys::ToolOptions& options = {});
48
49} // namespace SILICON::verilog
Represents a digital circuit as a directed graph of components.
Definition circuit.hpp:125
std::string write(const std::string_view yosysJson, const yosys::ToolOptions &options)
Definition verilog.cpp:494
std::string postprocess(const std::string_view source)
Definition verilog.cpp:488
std::string read(const std::string_view source, const yosys::ToolOptions &options)
Definition verilog.cpp:477
core::SourceFile SourceFile
Definition verilog.hpp:33