-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust Synlig to recent Yosys changes (#2668)
This PR updates yosys. It also applies patch to yosys until: YosysHQ/yosys#4733 will be merged upstream.
- Loading branch information
Showing
13 changed files
with
110 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
|
||
CXXFLAGS += -I $(SYNLIG_SRC)/mods/yosys_ast | ||
|
||
SYNLIG_OBJS += mods/yosys_ast/synlig_const2ast.o | ||
SYNLIG_OBJS += mods/yosys_ast/synlig_edif.o | ||
SYNLIG_OBJS += mods/yosys_ast/synlig_simplify.o | ||
SYNLIG_OBJS += mods/yosys_ast/synlig_write_ilang.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "kernel/yosys.h" | ||
|
||
namespace Synlig | ||
{ | ||
|
||
using namespace ::Yosys; | ||
struct WriteIlangAlias : public Pass { | ||
WriteIlangAlias() : Pass("write_ilang", "alias for write_rtlil pass") {} | ||
void help() override | ||
{ | ||
log_warning("write_ilang pass is an alias for write_rtlil pass.\n\n"); | ||
run_pass("help write_rtlil"); | ||
} | ||
void execute(std::vector<std::string> args, RTLIL::Design *design) override | ||
{ | ||
log_warning("write_ilang pass is an alias for write_rtlil pass.\n\n"); | ||
std::string cmd = "write_rtlil"; | ||
for (int i = 1; i < args.size(); i++) | ||
cmd += " " + args[i]; | ||
run_pass(cmd, design); | ||
} | ||
} WriteIlangAliasPass; | ||
|
||
} // namespace Synlig |
25 changes: 25 additions & 0 deletions
25
src/yosys_patches/0001-Fix-setting-undef-bits-in-parameters.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 84a9827ed92421008542a7d85e9381607b9add7b Mon Sep 17 00:00:00 2001 | ||
From: mszelwiga <[email protected]> | ||
Date: Thu, 21 Nov 2024 14:26:39 +0100 | ||
Subject: [PATCH] Fix setting undef bits in parameters | ||
|
||
--- | ||
passes/cmds/setundef.cc | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/passes/cmds/setundef.cc b/passes/cmds/setundef.cc | ||
index 4ba58036b..dce33c05b 100644 | ||
--- a/passes/cmds/setundef.cc | ||
+++ b/passes/cmds/setundef.cc | ||
@@ -243,7 +243,7 @@ struct SetundefPass : public Pass { | ||
{ | ||
for (auto *cell : module->selected_cells()) { | ||
for (auto ¶meter : cell->parameters) { | ||
- for (auto bit : parameter.second) { | ||
+ for (auto &bit : parameter.second.bits()) { | ||
if (bit > RTLIL::State::S1) | ||
bit = worker.next_bit(); | ||
} | ||
-- | ||
2.39.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SYNLIG_SRC ?= $(TOP_DIR)/src | ||
YOSYS_SRC ?= $(TOP_DIR)/third_party/yosys | ||
PATCHES_DIR := $(SYNLIG_SRC)/yosys_patches | ||
|
||
apply_yosys_patches: | ||
if ! (cd $(YOSYS_SRC) && git apply --reverse --check $(PATCHES_DIR)/*.patch 2> /dev/null); then (cd $(YOSYS_SRC) && git apply $(PATCHES_DIR)/*.patch); fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters