3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-24 06:43:41 +00:00

Merge branch 'YosysHQ:main' into main

This commit is contained in:
Akash Levy 2024-11-08 14:10:24 -08:00 committed by GitHub
commit fa50434708
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 49 additions and 71 deletions

View file

@ -126,6 +126,7 @@ AWK ?= awk
ifeq ($(OS), Darwin) ifeq ($(OS), Darwin)
PLUGIN_LINKFLAGS += -undefined dynamic_lookup PLUGIN_LINKFLAGS += -undefined dynamic_lookup
LINKFLAGS += -rdynamic
# homebrew search paths # homebrew search paths
ifneq ($(shell :; command -v brew),) ifneq ($(shell :; command -v brew),)
@ -162,7 +163,7 @@ ifeq ($(OS), Haiku)
CXXFLAGS += -D_DEFAULT_SOURCE CXXFLAGS += -D_DEFAULT_SOURCE
endif endif
YOSYS_VER := 0.47+3 YOSYS_VER := 0.47+22
# Note: We arrange for .gitcommit to contain the (short) commit hash in # Note: We arrange for .gitcommit to contain the (short) commit hash in
# tarballs generated with git-archive(1) using .gitattributes. The git repo # tarballs generated with git-archive(1) using .gitattributes. The git repo

View file

@ -130,9 +130,15 @@ lld by enabling LTO:
$ make ENABLE_LTO=1 $ make ENABLE_LTO=1
On macOS, LTO requires using clang from homebrew which isn't in PATH
rather than xcode clang.
$ make ENABLE_LTO=1 CXX=$(brew --prefix)/opt/llvm/bin/clang++
For other compilers and build configurations it might be For other compilers and build configurations it might be
necessary to make some changes to the config section of the necessary to make some changes to the config section of the
Makefile. Makefile. It's also an alternative way to set the make variables
mentioned above.
$ vi Makefile # ..or.. $ vi Makefile # ..or..
$ vi Makefile.conf $ vi Makefile.conf

View file

@ -10,11 +10,11 @@ cd test_cells.tmp
for fn in test_*.il; do for fn in test_*.il; do
../../../yosys -p " ../../../yosys -p "
read_ilang $fn read_rtlil $fn
rename gold gate rename gold gate
synth synth
read_ilang $fn read_rtlil $fn
miter -equiv -make_assert -flatten gold gate main miter -equiv -make_assert -flatten gold gate main
hierarchy -top main hierarchy -top main
write_btor ${fn%.il}.btor write_btor ${fn%.il}.btor

View file

@ -464,21 +464,6 @@ struct RTLILBackend : public Backend {
} }
} RTLILBackend; } RTLILBackend;
struct IlangBackend : public Backend {
IlangBackend() : Backend("ilang", "(deprecated) alias of write_rtlil") { }
void help() override
{
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
log("\n");
log("See `help write_rtlil`.\n");
log("\n");
}
void execute(std::ostream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) override
{
RTLILBackend.execute(f, filename, args, design);
}
} IlangBackend;
struct DumpPass : public Pass { struct DumpPass : public Pass {
DumpPass() : Pass("dump", "print parts of the design in RTLIL format") { } DumpPass() : Pass("dump", "print parts of the design in RTLIL format") { }
void help() override void help() override

View file

@ -21,7 +21,7 @@ EOT
for x in $(set +x; ls test_*.il | sort -R); do for x in $(set +x; ls test_*.il | sort -R); do
x=${x%.il} x=${x%.il}
cat > $x.ys <<- EOT cat > $x.ys <<- EOT
read_ilang $x.il read_rtlil $x.il
copy gold gate copy gold gate
cd gate cd gate

View file

@ -17,11 +17,11 @@ EOT
for fn in test_*.il; do for fn in test_*.il; do
../../../yosys -p " ../../../yosys -p "
read_ilang $fn read_rtlil $fn
rename gold gate rename gold gate
synth synth
read_ilang $fn read_rtlil $fn
miter -equiv -flatten gold gate main miter -equiv -flatten gold gate main
hierarchy -top main hierarchy -top main
write_smv -tpl template.txt ${fn#.il}.smv write_smv -tpl template.txt ${fn#.il}.smv

View file

@ -15,23 +15,23 @@
\tikzstyle{data} = [draw, fill=blue!10, ellipse, minimum height=3em, minimum width=7em, node distance=15em] \tikzstyle{data} = [draw, fill=blue!10, ellipse, minimum height=3em, minimum width=7em, node distance=15em]
\node[process] (vlog) {Verilog Frontend}; \node[process] (vlog) {Verilog Frontend};
\node[process, dashed, fill=green!5] (vhdl) [right of=vlog] {VHDL Frontend}; \node[process, dashed, fill=green!5] (vhdl) [right of=vlog] {VHDL Frontend};
\node[process] (ilang) [right of=vhdl] {RTLIL Frontend}; \node[process] (rtlilfe) [right of=vhdl] {RTLIL Frontend};
\node[data] (ast) [below of=vlog, node distance=5em, xshift=7.5em] {AST}; \node[data] (ast) [below of=vlog, node distance=5em, xshift=7.5em] {AST};
\node[process] (astfe) [below of=ast, node distance=5em] {AST Frontend}; \node[process] (astfe) [below of=ast, node distance=5em] {AST Frontend};
\node[data] (rtlil) [below of=astfe, node distance=5em, xshift=7.5em] {RTLIL}; \node[data] (rtlil) [below of=astfe, node distance=5em, xshift=7.5em] {RTLIL};
\node[process] (pass) [right of=rtlil, node distance=5em, xshift=7.5em] {Passes}; \node[process] (pass) [right of=rtlil, node distance=5em, xshift=7.5em] {Passes};
\node[process] (vlbe) [below of=rtlil, node distance=7em, xshift=-13em] {Verilog Backend}; \node[process] (vlbe) [below of=rtlil, node distance=7em, xshift=-13em] {Verilog Backend};
\node[process] (ilangbe) [below of=rtlil, node distance=7em, xshift=0em] {RTLIL Backend}; \node[process] (rtlilbe) [below of=rtlil, node distance=7em, xshift=0em] {RTLIL Backend};
\node[process, dashed, fill=green!5] (otherbe) [below of=rtlil, node distance=7em, xshift=+13em] {Other Backends}; \node[process, dashed, fill=green!5] (otherbe) [below of=rtlil, node distance=7em, xshift=+13em] {Other Backends};
\draw[-latex] (vlog) -- (ast); \draw[-latex] (vlog) -- (ast);
\draw[-latex] (vhdl) -- (ast); \draw[-latex] (vhdl) -- (ast);
\draw[-latex] (ast) -- (astfe); \draw[-latex] (ast) -- (astfe);
\draw[-latex] (astfe) -- (rtlil); \draw[-latex] (astfe) -- (rtlil);
\draw[-latex] (ilang) -- (rtlil); \draw[-latex] (rtlilfe) -- (rtlil);
\draw[latex-latex] (rtlil) -- (pass); \draw[latex-latex] (rtlil) -- (pass);
\draw[-latex] (rtlil) -- (vlbe); \draw[-latex] (rtlil) -- (vlbe);
\draw[-latex] (rtlil) -- (ilangbe); \draw[-latex] (rtlil) -- (rtlilbe);
\draw[-latex] (rtlil) -- (otherbe); \draw[-latex] (rtlil) -- (otherbe);
\end{tikzpicture} \end{tikzpicture}
\end{document} \end{document}

View file

@ -96,20 +96,5 @@ struct RTLILFrontend : public Frontend {
} }
} RTLILFrontend; } RTLILFrontend;
struct IlangFrontend : public Frontend {
IlangFrontend() : Frontend("ilang", "(deprecated) alias of read_rtlil") { }
void help() override
{
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
log("\n");
log("See `help read_rtlil`.\n");
log("\n");
}
void execute(std::istream *&f, std::string filename, std::vector<std::string> args, RTLIL::Design *design) override
{
RTLILFrontend.execute(f, filename, args, design);
}
} IlangFrontend;
YOSYS_NAMESPACE_END YOSYS_NAMESPACE_END

View file

@ -21,6 +21,7 @@
#include "subcircuit.h" #include "subcircuit.h"
#include <algorithm> #include <algorithm>
#include <cstdlib>
#include <assert.h> #include <assert.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>

View file

@ -1,2 +1,2 @@
read_ilang bug1630.il.gz read_rtlil bug1630.il.gz
abc9 -lut 4 abc9 -lut 4

View file

@ -1,4 +1,4 @@
read_ilang << EOF read_rtlil << EOF
module \top module \top

View file

@ -1,4 +1,4 @@
read_ilang <<EOT read_rtlil <<EOT
# Generated by Yosys 0.9+1706 (git sha1 58ab9f60, clang 6.0.0-1ubuntu2 -fPIC -Os) # Generated by Yosys 0.9+1706 (git sha1 58ab9f60, clang 6.0.0-1ubuntu2 -fPIC -Os)
autoidx 2815 autoidx 2815
attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:9" attribute \src "../hdl/mem/ahb_async_sram_halfwidth.v:9"

View file

@ -1,2 +1,2 @@
read_ilang bug1644.il.gz read_rtlil bug1644.il.gz
synth_ice40 -top top -dsp -json adc_dac_pass_through.json -run :map_bram synth_ice40 -top top -dsp -json adc_dac_pass_through.json -run :map_bram

View file

@ -1,4 +1,4 @@
read_ilang << EOF read_rtlil << EOF
module \top module \top

View file

@ -1,4 +1,4 @@
read_ilang <<EOT read_rtlil <<EOT
module \mod module \mod
wire input 1 \clk wire input 1 \clk

View file

@ -1,4 +1,4 @@
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 4 input 0 \S wire width 4 input 0 \S

View file

@ -1,3 +1,3 @@
read_ilang opt_lut_elim.il read_rtlil opt_lut_elim.il
opt_lut opt_lut
select -assert-count 0 t:$lut select -assert-count 0 t:$lut

View file

@ -1,4 +1,4 @@
read_ilang << EOF read_rtlil << EOF
module \top module \top

View file

@ -1,3 +1,3 @@
read_ilang opt_lut_port.il read_rtlil opt_lut_port.il
opt_lut opt_lut
select -assert-count 2 t:$lut select -assert-count 2 t:$lut

View file

@ -1,4 +1,4 @@
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 12 input 0 \A wire width 12 input 0 \A
@ -22,7 +22,7 @@ select -assert-count 1 t:$bmux r:WIDTH=4 %i
design -reset design -reset
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 6 input 0 \A wire width 6 input 0 \A
@ -46,7 +46,7 @@ select -assert-count 0 t:$bmux
design -reset design -reset
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 160 input 0 \A wire width 160 input 0 \A
@ -70,7 +70,7 @@ select -assert-count 1 t:$bmux r:S_WIDTH=2 %i
design -reset design -reset
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 10 input 0 \A wire width 10 input 0 \A
@ -95,7 +95,7 @@ select -assert-count 1 t:$mux
design -reset design -reset
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 5 input 0 \A wire width 5 input 0 \A

View file

@ -1,4 +1,4 @@
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 4 input 0 \A wire width 4 input 0 \A
@ -22,7 +22,7 @@ select -assert-count 1 t:$demux r:WIDTH=4 %i
design -reset design -reset
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 2 input 1 \S wire width 2 input 1 \S
@ -45,7 +45,7 @@ select -assert-count 0 t:$demux
design -reset design -reset
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 5 input 0 \A wire width 5 input 0 \A
@ -69,7 +69,7 @@ select -assert-count 1 t:$demux r:S_WIDTH=2 %i
design -reset design -reset
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 5 input 0 \A wire width 5 input 0 \A

View file

@ -1,4 +1,4 @@
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 4 input 1 \a wire width 4 input 1 \a
wire width 2 input 2 \b wire width 2 input 2 \b

View file

@ -188,7 +188,7 @@ equiv_opt -assert -run prepare: dummy
design -reset design -reset
read_ilang <<EOT read_rtlil <<EOT
module \m module \m
wire width 3 input 1 \a wire width 3 input 1 \a

View file

@ -5,7 +5,7 @@ def derive(module, parameters):
assert module == r"python_inv" assert module == r"python_inv"
if parameters.keys() != {r"\width"}: if parameters.keys() != {r"\width"}:
raise ValueError("Invalid parameters") raise ValueError("Invalid parameters")
return "ilang", r""" return "rtlil", r"""
module \impl module \impl
wire width {width:d} input 1 \i wire width {width:d} input 1 \i
wire width {width:d} output 2 \o wire width {width:d} output 2 \o

View file

@ -1,4 +1,4 @@
read_ilang <<EOT read_rtlil <<EOT
module \top module \top
wire input 3 \A wire input 3 \A
wire width 2 input 2 \B wire width 2 input 2 \B

View file

@ -8,7 +8,7 @@ EOT
cat > $1.ys <<EOT cat > $1.ys <<EOT
echo on echo on
read_ilang $1.il read_rtlil $1.il
hierarchy; proc; opt hierarchy; proc; opt
rename -top uut rename -top uut
design -save gold design -save gold

View file

@ -1,4 +1,4 @@
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 4 input 0 \S wire width 4 input 0 \S
@ -21,7 +21,7 @@ equiv_opt -assert bmuxmap -pmux
### ###
design -reset design -reset
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire width 10 input 0 \A wire width 10 input 0 \A

View file

@ -1,4 +1,4 @@
read_ilang <<EOT read_rtlil <<EOT
autoidx 2 autoidx 2
module \top module \top
wire output 3 $y wire output 3 $y

View file

@ -1,4 +1,4 @@
read_ilang << EOF read_rtlil << EOF
module \top module \top
wire input 1 \A wire input 1 \A
wire output 2 \Y wire output 2 \Y

View file

@ -1,4 +1,4 @@
read_ilang << EOT read_rtlil << EOT
module \top module \top
wire $a wire $a

View file

@ -1,6 +1,6 @@
# https://github.com/yosyshq/yosys/issues/2035 # https://github.com/yosyshq/yosys/issues/2035
read_ilang <<END read_rtlil <<END
module \top module \top
wire width 1 input 0 \halfbrite wire width 1 input 0 \halfbrite
wire width 2 output 1 \r_on wire width 2 output 1 \r_on