Skip to content

Commit 7764d0b

Browse files
committed
initial import
0 parents  commit 7764d0b

File tree

481 files changed

+54634
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

481 files changed

+54634
-0
lines changed

Makefile

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
2+
CONFIG := clang-debug
3+
# CONFIG := gcc-debug
4+
# CONFIG := release
5+
6+
OBJS = kernel/driver.o kernel/register.o kernel/rtlil.o kernel/log.o kernel/sha1.o kernel/calc.o kernel/select.o kernel/show.o
7+
OBJS += bigint/BigIntegerAlgorithms.o bigint/BigInteger.o bigint/BigIntegerUtils.o bigint/BigUnsigned.o bigint/BigUnsignedInABase.o
8+
9+
GENFILES =
10+
TARGETS = yosys
11+
12+
all: top-all
13+
14+
CXXFLAGS = -Wall -Wextra -ggdb -I$(shell pwd) -MD
15+
LDFLAGS =
16+
LDLIBS = -lstdc++ -lreadline -lm
17+
18+
-include Makefile.conf
19+
20+
ifeq ($(CONFIG),clang-debug)
21+
CXX = clang
22+
CXXFLAGS += -std=c++11 -O0
23+
endif
24+
25+
ifeq ($(CONFIG),gcc-debug)
26+
CXX = gcc
27+
CXXFLAGS += -std=gnu++0x -O0
28+
endif
29+
30+
ifeq ($(CONFIG),release)
31+
CXX = gcc
32+
CXXFLAGS += -std=gnu++0x -march=native -O3 -DNDEBUG
33+
endif
34+
35+
include frontends/*/Makefile.inc
36+
include passes/*/Makefile.inc
37+
include backends/*/Makefile.inc
38+
include techlibs/Makefile.inc
39+
40+
top-all: $(TARGETS)
41+
42+
yosys: $(OBJS)
43+
$(CXX) -o yosys $(LDFLAGS) $(OBJS) $(LDLIBS)
44+
45+
test: yosys
46+
cd tests/simple && bash run-test.sh
47+
cd tests/hana && bash run-test.sh
48+
cd tests/asicworld && bash run-test.sh
49+
50+
help:
51+
@find -name '*.cc' | xargs egrep -h '(Pass|Frontend|Backend)\(".*"\)' | \
52+
sed 's,.*: ,,; s, .*,,;' | sort | tr '\n' '\t' | expand -t25 | fmt
53+
54+
install: yosys
55+
install yosys /usr/local/bin/yosys
56+
57+
clean:
58+
rm -f $(OBJS) $(GENFILES) $(TARGETS)
59+
rm -f bigint/*.d frontends/*/*.d passes/*/*.d backends/*/*.d kernel/*.d
60+
61+
mrproper: clean
62+
svn st --no-ignore | grep '^[?I]' | cut -c8- | sed 's,^ *,,; /^Makefile.conf$$/ d;' | xargs -r -d '\n' rm -vrf
63+
64+
qtcreator:
65+
{ for file in $(basename $(OBJS)); do \
66+
for prefix in cc y l; do if [ -f $${file}.$${prefix} ]; then echo $$file.$${prefix}; fi; done \
67+
done; find backends bigint frontends kernel passes -type f \( -name '*.h' -o -name '*.hh' \); } > qtcreator.files
68+
{ echo .; find backends bigint frontends kernel passes -type f \( -name '*.h' -o -name '*.hh' \) -printf '%h\n' | sort -u; } > qtcreator.includes
69+
touch qtcreator.config qtcreator.creator
70+
71+
-include bigint/*.d
72+
-include frontends/*/*.d
73+
-include passes/*/*.d
74+
-include backends/*/*.d
75+
-include kernel/*.d
76+

README

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
2+
yosys -- Yosys Open SYnthesis Suite
3+
===================================
4+
5+
This is a framework for RTL synthesis tools. It is highly
6+
experimental and under construction. The goal for now is
7+
to implement an extensible Verilog-2005 synthesis tool.
8+
9+
The aim of this tool is to generate valid logic netlists
10+
from HDL designs in a manner that allows for easy addition
11+
of extra synthesis passes. This tool does not aim at generating
12+
efficient logic netlists. This can be done by passing the
13+
output of Yosys to a low-level synthesis tool such as ABC.
14+
15+
Yosys is free software licensed under the ISC license (a GPL
16+
compatible licence that is similar in terms to the MIT license
17+
or the 2-clause BSD license).
18+
19+
20+
Unsupported Verilog-2005 Features
21+
=================================
22+
23+
The following Verilog-2005 features are not supported by
24+
yosys and there are currently no plans to add support
25+
for them:
26+
27+
- Non-sythesizable language features as defined in
28+
IEC 62142(E):2005 / IEEE Std. 1364.1(E):2002
29+
30+
- The "tri", "triand", "trior", "wand" and "wor" net types
31+
32+
- The "library" and "configuration" source file formats
33+
34+
- The "disable" and "primitive" statements
35+
36+
- Latched logic (is synthesized as logic with feedback loops)
37+
38+
39+
Verilog Attributes and non-standard features
40+
============================================
41+
42+
- The 'full_case' attribute on case statements is supported
43+
(also the non-standard "// synopsys full_case" directive)
44+
45+
- The "// synopsys translate_off" and "// synopsys translate_on"
46+
directives are also supported (but the use of `ifdef .. `endif
47+
is strongly recommended instead).
48+
49+
- The "nomem2reg" attribute on modules or arrays prohibits the
50+
automatic early conversion of arrays to seperate registers.
51+
52+
- The "nolatches" attribute on modules or always-blocks
53+
prohibits the generation of logic-loops for latches. Instead
54+
all not explicitly assigned values default to x-bits.
55+
56+
- In addition to the (* ... *) attribute syntax, yosys supports
57+
the non-standard {* ... *} attribute syntax to set default attributes
58+
for everything that comes after the {* ... *} statement. (Reset
59+
by adding an empty {* *} statement.) The preprocessor define
60+
__YOSYS_ENABLE_DEFATTR__ must be set in order for this featre to be active.
61+
62+
63+
TODOs / Open Bugs
64+
=================
65+
66+
- Write "design and implementation of.." document
67+
68+
- Add brief sourcecode documentation to:
69+
70+
- Most passes and kernel functionalities
71+
72+
- Implement missing Verilog 2005 features:
73+
74+
- Signed constants
75+
- ROM modelling using "initial" blocks
76+
- Builtin primitive gates (and, nand, cmos, nmos, pmos, etc..)
77+
- Ignore what needs to be ignored (e.g. drive and charge strenghts)
78+
- Check standard vs. implementation to identify missing features
79+
80+
- Actually use range information on parameters
81+
82+
- Implement mux-to-tribuf pass and rebalance mixed mux/tribuf trees
83+
84+
- TCL and Python interfaces to frontends, passes, backends and RTLIL
85+
86+
- Additional internal cell types: $bitcount, $pla, $lut and $pmux
87+
88+
- Subsystem for selecting stuff (and limiting scope of passes)
89+
90+
- Support for registering designs (as collection of modules) to CellTypes
91+
92+
- Kernel support for collections of cells (from input/output cones, etc)
93+
94+
- Smarter resource sharing pass (add MUXes and get rid of duplicated cells)
95+
96+
- FSM state encoding and technology mapping
97+

backends/autotest/Makefile.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
OBJS += backends/autotest/autotest.o
3+

0 commit comments

Comments
 (0)