├── .clang-format ├── .dockerignore ├── .editorconfig ├── .gitattributes ├── .gitcommit ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ ├── docs_report.yml │ └── feature_request.yml ├── PULL_REQUEST_TEMPLATE.md ├── actions │ └── setup-build-env │ │ └── action.yml └── workflows │ ├── codeql.yml │ ├── extra-builds.yml │ ├── prepare-docs.yml │ ├── source-vendor.yml │ ├── test-build.yml │ ├── test-compile.yml │ ├── test-verific.yml │ ├── update-flake-lock.yml │ ├── version.yml │ ├── wheels.yml │ └── wheels │ ├── _run_cibw_linux.py │ ├── cibw_before_all.sh │ └── cibw_before_build.sh ├── .gitignore ├── .gitmodules ├── .mailmap ├── .readthedocs.yaml ├── Brewfile ├── CHANGELOG ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── COPYING ├── Dockerfile ├── Makefile ├── README.md ├── backends ├── aiger │ ├── Makefile.inc │ ├── aiger.cc │ └── xaiger.cc ├── aiger2 │ ├── Makefile.inc │ └── aiger.cc ├── blif │ ├── Makefile.inc │ └── blif.cc ├── btor │ ├── .gitignore │ ├── Makefile.inc │ ├── btor.cc │ └── test_cells.sh ├── cxxrtl │ ├── Makefile.inc │ ├── cxxrtl_backend.cc │ └── runtime │ │ ├── README.txt │ │ └── cxxrtl │ │ ├── capi │ │ ├── cxxrtl_capi.cc │ │ ├── cxxrtl_capi.h │ │ ├── cxxrtl_capi_vcd.cc │ │ └── cxxrtl_capi_vcd.h │ │ ├── cxxrtl.h │ │ ├── cxxrtl_replay.h │ │ ├── cxxrtl_time.h │ │ └── cxxrtl_vcd.h ├── edif │ ├── Makefile.inc │ ├── edif.cc │ └── runtest.py ├── firrtl │ ├── .gitignore │ ├── Makefile.inc │ ├── firrtl.cc │ ├── test.sh │ └── test.v ├── functional │ ├── Makefile.inc │ ├── cxx.cc │ ├── cxx_runtime │ │ └── sim.h │ ├── smtlib.cc │ ├── smtlib_rosette.cc │ └── test_generic.cc ├── intersynth │ ├── Makefile.inc │ └── intersynth.cc ├── jny │ ├── Makefile.inc │ └── jny.cc ├── json │ ├── Makefile.inc │ └── json.cc ├── rtlil │ ├── Makefile.inc │ ├── rtlil_backend.cc │ └── rtlil_backend.h ├── simplec │ ├── .gitignore │ ├── Makefile.inc │ ├── simplec.cc │ ├── test00.sh │ ├── test00_tb.c │ └── test00_uut.v ├── smt2 │ ├── .gitignore │ ├── Makefile.inc │ ├── example.v │ ├── example.ys │ ├── smt2.cc │ ├── smtbmc.py │ ├── smtbmc_incremental.py │ ├── smtio.py │ ├── test_cells.sh │ ├── witness.py │ └── ywio.py ├── smv │ ├── .gitignore │ ├── Makefile.inc │ ├── smv.cc │ └── test_cells.sh ├── spice │ ├── Makefile.inc │ └── spice.cc ├── table │ ├── Makefile.inc │ └── table.cc └── verilog │ ├── Makefile.inc │ └── verilog_backend.cc ├── docs ├── .gitignore ├── Makefile ├── source │ ├── _downloads │ │ ├── APPNOTE_010_Verilog_to_BLIF.pdf │ │ └── APPNOTE_012_Verilog_to_BTOR.pdf │ ├── _images │ │ ├── Makefile │ │ ├── internals │ │ │ ├── approach_flow.tex │ │ │ ├── overview_flow.tex │ │ │ ├── overview_rtlil.tex │ │ │ ├── simplified_rtlil.tex │ │ │ └── verilog_flow.tex │ │ └── primer │ │ │ ├── basics_abstractions.tex │ │ │ ├── basics_ast.tex │ │ │ ├── basics_flow.tex │ │ │ ├── basics_parsetree.tex │ │ │ └── levels_of_abstraction.tex │ ├── _static │ │ ├── custom.css │ │ └── logo.png │ ├── appendix │ │ ├── APPNOTE_010_Verilog_to_BLIF.rst │ │ ├── APPNOTE_012_Verilog_to_BTOR.rst │ │ ├── auxlibs.rst │ │ ├── auxprogs.rst │ │ ├── env_vars.rst │ │ ├── primer.rst │ │ └── rtlil_text.rst │ ├── bib.rst │ ├── cell │ │ ├── gate_comb_combined.rst │ │ ├── gate_comb_simple.rst │ │ ├── gate_other.rst │ │ ├── gate_reg_ff.rst │ │ ├── gate_reg_latch.rst │ │ ├── index_gate.rst │ │ ├── index_word.rst │ │ ├── properties.rst │ │ ├── word_arith.rst │ │ ├── word_binary.rst │ │ ├── word_debug.rst │ │ ├── word_formal.rst │ │ ├── word_fsm.rst │ │ ├── word_logic.rst │ │ ├── word_mem.rst │ │ ├── word_mux.rst │ │ ├── word_reg.rst │ │ ├── word_spec.rst │ │ ├── word_unary.rst │ │ └── word_wire.rst │ ├── cell_index.rst │ ├── cmd_ref.rst │ ├── code_examples │ │ ├── .gitignore │ │ ├── axis │ │ │ ├── axis_master.v │ │ │ ├── axis_test.v │ │ │ └── axis_test.ys │ │ ├── extensions │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── absval_ref.v │ │ │ ├── my_cmd.cc │ │ │ └── sigmap_test.v │ │ ├── fifo │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── fifo.libmap │ │ │ ├── fifo.v │ │ │ ├── fifo.ys │ │ │ └── fifo_map.ys │ │ ├── functional │ │ │ └── dummy.cc │ │ ├── intro │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── counter.v │ │ │ ├── counter.ys │ │ │ ├── mycells.lib │ │ │ └── mycells.v │ │ ├── macc │ │ │ ├── Makefile │ │ │ ├── macc_simple_test.v │ │ │ ├── macc_simple_test.ys │ │ │ ├── macc_simple_test_01.v │ │ │ ├── macc_simple_test_02.v │ │ │ ├── macc_simple_xmap.v │ │ │ ├── macc_xilinx_swap_map.v │ │ │ ├── macc_xilinx_test.v │ │ │ ├── macc_xilinx_test.ys │ │ │ ├── macc_xilinx_unwrap_map.v │ │ │ ├── macc_xilinx_wrap_map.v │ │ │ └── macc_xilinx_xmap.v │ │ ├── macro_commands │ │ │ ├── fsm.ys │ │ │ ├── memory.ys │ │ │ ├── opt.ys │ │ │ ├── proc.ys │ │ │ └── synth_ice40.ys │ │ ├── opt │ │ │ ├── Makefile │ │ │ ├── opt_expr.ys │ │ │ ├── opt_merge.ys │ │ │ ├── opt_muxtree.ys │ │ │ └── opt_share.ys │ │ ├── primetest.v │ │ ├── scrambler │ │ │ ├── Makefile │ │ │ ├── scrambler.v │ │ │ └── scrambler.ys │ │ ├── selections │ │ │ ├── Makefile │ │ │ ├── foobaraddsub.v │ │ │ ├── memdemo.v │ │ │ ├── memdemo.ys │ │ │ ├── select.v │ │ │ ├── select.ys │ │ │ ├── submod.ys │ │ │ ├── sumprod.v │ │ │ └── sumprod.ys │ │ ├── show │ │ │ ├── Makefile │ │ │ ├── cmos.v │ │ │ ├── cmos.ys │ │ │ ├── example.v │ │ │ ├── example.ys │ │ │ ├── example_lscd.ys │ │ │ ├── example_show.ys │ │ │ └── splice.v │ │ ├── stubnets │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── stubnets.cc │ │ │ └── test.v │ │ ├── synth_flow │ │ │ ├── Makefile │ │ │ ├── memory_01.v │ │ │ ├── memory_01.ys │ │ │ ├── memory_02.v │ │ │ ├── memory_02.ys │ │ │ ├── proc_01.v │ │ │ ├── proc_01.ys │ │ │ ├── proc_02.v │ │ │ ├── proc_02.ys │ │ │ ├── proc_03.v │ │ │ ├── proc_03.ys │ │ │ ├── techmap_01.v │ │ │ ├── techmap_01.ys │ │ │ └── techmap_01_map.v │ │ └── techmap │ │ │ ├── Makefile │ │ │ ├── addshift_map.v │ │ │ ├── addshift_test.v │ │ │ ├── addshift_test.ys │ │ │ ├── mulshift_map.v │ │ │ ├── mulshift_test.v │ │ │ ├── mulshift_test.ys │ │ │ ├── mymul_map.v │ │ │ ├── mymul_test.v │ │ │ ├── mymul_test.ys │ │ │ ├── red_or3x1_cells.v │ │ │ ├── red_or3x1_map.v │ │ │ ├── red_or3x1_test.v │ │ │ ├── red_or3x1_test.ys │ │ │ ├── sym_mul_cells.v │ │ │ ├── sym_mul_map.v │ │ │ ├── sym_mul_test.v │ │ │ └── sym_mul_test.ys │ ├── conf.py │ ├── getting_started │ │ ├── example_synth.rst │ │ ├── index.rst │ │ ├── installation.rst │ │ └── scripting_intro.rst │ ├── index.rst │ ├── introduction.rst │ ├── literature.bib │ ├── requirements.txt │ ├── using_yosys │ │ ├── index.rst │ │ ├── more_scripting │ │ │ ├── data_flow_tracking.rst │ │ │ ├── index.rst │ │ │ ├── interactive_investigation.rst │ │ │ ├── load_design.rst │ │ │ ├── model_checking.rst │ │ │ └── selections.rst │ │ └── synthesis │ │ │ ├── abc.rst │ │ │ ├── cell_libs.rst │ │ │ ├── extract.rst │ │ │ ├── fsm.rst │ │ │ ├── index.rst │ │ │ ├── memory.rst │ │ │ ├── opt.rst │ │ │ ├── proc.rst │ │ │ ├── synth.rst │ │ │ └── techmap_synth.rst │ └── yosys_internals │ │ ├── extending_yosys │ │ ├── build_verific.rst │ │ ├── contributing.rst │ │ ├── extensions.rst │ │ ├── functional_ir.rst │ │ ├── index.rst │ │ └── test_suites.rst │ │ ├── flow │ │ ├── control_and_data.rst │ │ ├── index.rst │ │ ├── overview.rst │ │ └── verilog_frontend.rst │ │ ├── formats │ │ ├── index.rst │ │ └── rtlil_rep.rst │ │ ├── hashing.rst │ │ ├── index.rst │ │ ├── techmap.rst │ │ └── verilog.rst ├── tests │ └── macro_commands.py └── util │ ├── RtlilLexer.py │ ├── __init__.py │ ├── cellref.py │ └── cmdref.py ├── examples ├── aiger │ ├── .gitignore │ ├── README │ ├── demo.sh │ └── demo.v ├── anlogic │ ├── .gitignore │ ├── README │ ├── build.sh │ ├── build.tcl │ ├── demo.adc │ ├── demo.v │ └── demo.ys ├── basys3 │ ├── README │ ├── example.v │ ├── example.xdc │ ├── run.sh │ ├── run_prog.tcl │ ├── run_vivado.tcl │ └── run_yosys.ys ├── cmos │ ├── .gitignore │ ├── README │ ├── cmos_cells.lib │ ├── cmos_cells.sp │ ├── cmos_cells.v │ ├── cmos_cells_digital.sp │ ├── counter.v │ ├── counter.ys │ ├── counter_digital.ys │ ├── counter_tb.gtkw │ ├── counter_tb.v │ ├── testbench.sh │ ├── testbench.sp │ ├── testbench_digital.sh │ └── testbench_digital.sp ├── cxx-api │ ├── demomain.cc │ ├── evaldemo.cc │ └── scopeinfo_example.cc ├── gowin │ ├── .gitignore │ ├── README │ ├── demo.cst │ ├── demo.sdc │ ├── demo.v │ ├── device.cfg │ ├── pnr.cfg │ ├── run.sh │ ├── run.tcl │ └── testbench.v ├── igloo2 │ ├── .gitignore │ ├── example.pdc │ ├── example.sdc │ ├── example.v │ ├── libero.tcl │ └── runme.sh ├── intel │ ├── DE2i-150 │ │ ├── quartus_compile │ │ │ ├── de2i.qpf │ │ │ ├── de2i.qsf │ │ │ └── runme_quartus │ │ ├── run_cycloneiv │ │ ├── sevenseg.v │ │ └── top.v │ ├── MAX10 │ │ ├── run_max10 │ │ ├── runme_postsynth │ │ ├── sevenseg.v │ │ └── top.v │ └── asicworld_lfsr │ │ ├── README │ │ ├── lfsr_updown.v │ │ ├── lfsr_updown_tb.v │ │ ├── run_cycloneiv │ │ ├── run_max10 │ │ ├── runme_postsynth │ │ └── runme_presynth ├── mimas2 │ ├── README │ ├── example.ucf │ ├── example.v │ ├── run.sh │ └── run_yosys.ys ├── osu035 │ ├── .gitignore │ ├── Makefile │ ├── example.constr │ ├── example.v │ └── example.ys ├── python-api │ ├── .gitignore │ ├── pass.py │ └── script.py └── smtbmc │ ├── .gitignore │ ├── Makefile │ ├── demo1.v │ ├── demo2.v │ ├── demo3.smtc │ ├── demo3.v │ ├── demo4.smtc │ ├── demo4.v │ ├── demo5.v │ ├── demo6.v │ ├── demo7.v │ ├── demo8.v │ ├── demo9.v │ └── glift │ ├── C7552.v │ ├── C7552.ys │ ├── C880.v │ ├── C880.ys │ ├── alu2.v │ ├── alu2.ys │ ├── alu4.v │ ├── alu4.ys │ ├── mux2.ys │ ├── t481.v │ ├── t481.ys │ ├── too_large.v │ ├── too_large.ys │ ├── ttt2.v │ ├── ttt2.ys │ ├── x1.v │ └── x1.ys ├── flake.lock ├── flake.nix ├── frontends ├── aiger │ ├── Makefile.inc │ ├── aigerparse.cc │ └── aigerparse.h ├── aiger2 │ ├── Makefile.inc │ └── xaiger.cc ├── ast │ ├── Makefile.inc │ ├── ast.cc │ ├── ast.h │ ├── ast_binding.cc │ ├── ast_binding.h │ ├── dpicall.cc │ ├── genrtlil.cc │ └── simplify.cc ├── blif │ ├── Makefile.inc │ ├── blifparse.cc │ └── blifparse.h ├── json │ ├── Makefile.inc │ └── jsonparse.cc ├── liberty │ ├── Makefile.inc │ └── liberty.cc ├── rpc │ ├── Makefile.inc │ └── rpc_frontend.cc ├── rtlil │ ├── .gitignore │ ├── Makefile.inc │ ├── rtlil_frontend.cc │ ├── rtlil_frontend.h │ ├── rtlil_lexer.l │ └── rtlil_parser.y ├── verific │ ├── Makefile.inc │ ├── README │ ├── example.sby │ ├── example.sv │ ├── verific.cc │ ├── verific.h │ └── verificsva.cc └── verilog │ ├── .gitignore │ ├── Makefile.inc │ ├── const2ast.cc │ ├── preproc.cc │ ├── preproc.h │ ├── verilog_frontend.cc │ ├── verilog_frontend.h │ ├── verilog_lexer.l │ └── verilog_parser.y ├── guidelines └── GettingStarted ├── kernel ├── binding.cc ├── binding.h ├── bitpattern.h ├── calc.cc ├── cellaigs.cc ├── cellaigs.h ├── celledges.cc ├── celledges.h ├── celltypes.h ├── compute_graph.h ├── consteval.h ├── constids.inc ├── cost.cc ├── cost.h ├── driver.cc ├── drivertools.cc ├── drivertools.h ├── ff.cc ├── ff.h ├── ffinit.h ├── ffmerge.cc ├── ffmerge.h ├── fmt.cc ├── fmt.h ├── fstdata.cc ├── fstdata.h ├── functional.cc ├── functional.h ├── gzip.cc ├── gzip.h ├── hashlib.h ├── io.cc ├── io.h ├── json.cc ├── json.h ├── log.cc ├── log.h ├── macc.h ├── mem.cc ├── mem.h ├── modtools.h ├── qcsat.cc ├── qcsat.h ├── register.cc ├── register.h ├── rtlil.cc ├── rtlil.h ├── satgen.cc ├── satgen.h ├── scopeinfo.cc ├── scopeinfo.h ├── sexpr.cc ├── sexpr.h ├── sigtools.h ├── tclapi.cc ├── timinginfo.h ├── topo_scc.h ├── utils.h ├── yosys.cc ├── yosys.h ├── yosys_common.h ├── yw.cc └── yw.h ├── libs ├── bigint │ ├── .gitignore │ ├── BigInteger.cc │ ├── BigInteger.hh │ ├── BigIntegerAlgorithms.cc │ ├── BigIntegerAlgorithms.hh │ ├── BigIntegerLibrary.hh │ ├── BigIntegerUtils.cc │ ├── BigIntegerUtils.hh │ ├── BigUnsigned.cc │ ├── BigUnsigned.hh │ ├── BigUnsignedInABase.cc │ ├── BigUnsignedInABase.hh │ ├── ChangeLog │ ├── Makefile │ ├── NumberlikeArray.hh │ ├── README │ ├── run-testsuite │ ├── sample.cc │ └── testsuite.cc ├── dlfcn-win32 │ ├── dlfcn.cc │ └── dlfcn.h ├── ezsat │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── demo_bit.cc │ ├── demo_cmp.cc │ ├── demo_vec.cc │ ├── ezminisat.cc │ ├── ezminisat.h │ ├── ezsat.cc │ ├── ezsat.h │ ├── puzzle3d.cc │ ├── puzzle3d.scad │ └── testbench.cc ├── fst │ ├── 00_PATCH_i386_endian.patch │ ├── 00_PATCH_strict_alignment.patch │ ├── 00_PATCH_win_io.patch │ ├── 00_PATCH_win_zlib.patch │ ├── 00_PATCH_wx_len_overread.patch │ ├── 00_UPDATE.sh │ ├── block_format.txt │ ├── config.h │ ├── fastlz.cc │ ├── fastlz.h │ ├── fst_win_unistd.h │ ├── fstapi.cc │ ├── fstapi.h │ ├── lz4.cc │ └── lz4.h ├── json11 │ ├── json11.cpp │ └── json11.hpp ├── minisat │ ├── 00_PATCH_mkLit_default_arg.patch │ ├── 00_PATCH_no_fpu_control.patch │ ├── 00_PATCH_remove_zlib.patch │ ├── 00_PATCH_typofixes.patch │ ├── 00_PATCH_warnings.patch │ ├── 00_PATCH_wasm.patch │ ├── 00_UPDATE.sh │ ├── Alg.h │ ├── Alloc.h │ ├── Dimacs.h │ ├── Heap.h │ ├── IntMap.h │ ├── IntTypes.h │ ├── LICENSE │ ├── Map.h │ ├── Options.cc │ ├── Options.h │ ├── ParseUtils.h │ ├── Queue.h │ ├── Rnd.h │ ├── SimpSolver.cc │ ├── SimpSolver.h │ ├── Solver.cc │ ├── Solver.h │ ├── SolverTypes.h │ ├── Sort.h │ ├── System.cc │ ├── System.h │ ├── Vec.h │ └── XAlloc.h ├── sha1 │ ├── sha1.cpp │ └── sha1.h └── subcircuit │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── demo.cc │ ├── scshell.cc │ ├── subcircuit.cc │ ├── subcircuit.h │ ├── test_large.spl │ ├── test_macc22.txt │ ├── test_mine.txt │ ├── test_perm.pl │ └── test_shorts.spl ├── misc ├── __init__.py ├── create_vcxsrc.sh ├── jny.schema.json ├── launcher.c ├── py_wrap_generator.py ├── yosys-config.in └── yosysjs │ ├── demo01.html │ ├── demo02.html │ ├── demo03.html │ ├── yosysjs.js │ └── yosyswrk.js ├── passes ├── cmds │ ├── Makefile.inc │ ├── abstract.cc │ ├── add.cc │ ├── autoname.cc │ ├── blackbox.cc │ ├── box_derive.cc │ ├── bugpoint.cc │ ├── check.cc │ ├── chformal.cc │ ├── chtype.cc │ ├── clean_zerowidth.cc │ ├── connect.cc │ ├── connwrappers.cc │ ├── copy.cc │ ├── cover.cc │ ├── delete.cc │ ├── design.cc │ ├── dft_tag.cc │ ├── edgetypes.cc │ ├── example_dt.cc │ ├── exec.cc │ ├── future.cc │ ├── glift.cc │ ├── internal_stats.cc │ ├── logcmd.cc │ ├── logger.cc │ ├── ltp.cc │ ├── plugin.cc │ ├── portarcs.cc │ ├── portlist.cc │ ├── printattrs.cc │ ├── rename.cc │ ├── scatter.cc │ ├── scc.cc │ ├── scratchpad.cc │ ├── select.cc │ ├── setattr.cc │ ├── setenv.cc │ ├── setundef.cc │ ├── show.cc │ ├── splice.cc │ ├── splitcells.cc │ ├── splitnets.cc │ ├── sta.cc │ ├── stat.cc │ ├── tee.cc │ ├── test_select.cc │ ├── timeest.cc │ ├── torder.cc │ ├── trace.cc │ ├── viz.cc │ ├── wrapcell.cc │ ├── write_file.cc │ └── xprop.cc ├── equiv │ ├── Makefile.inc │ ├── equiv_add.cc │ ├── equiv_induct.cc │ ├── equiv_make.cc │ ├── equiv_mark.cc │ ├── equiv_miter.cc │ ├── equiv_opt.cc │ ├── equiv_purge.cc │ ├── equiv_remove.cc │ ├── equiv_simple.cc │ ├── equiv_status.cc │ └── equiv_struct.cc ├── fsm │ ├── Makefile.inc │ ├── fsm.cc │ ├── fsm_detect.cc │ ├── fsm_expand.cc │ ├── fsm_export.cc │ ├── fsm_extract.cc │ ├── fsm_info.cc │ ├── fsm_map.cc │ ├── fsm_opt.cc │ ├── fsm_recode.cc │ └── fsmdata.h ├── hierarchy │ ├── Makefile.inc │ ├── hierarchy.cc │ ├── keep_hierarchy.cc │ ├── submod.cc │ └── uniquify.cc ├── memory │ ├── Makefile.inc │ ├── memlib.cc │ ├── memlib.h │ ├── memlib.md │ ├── memory.cc │ ├── memory_bmux2rom.cc │ ├── memory_bram.cc │ ├── memory_collect.cc │ ├── memory_dff.cc │ ├── memory_libmap.cc │ ├── memory_map.cc │ ├── memory_memx.cc │ ├── memory_narrow.cc │ ├── memory_nordff.cc │ ├── memory_share.cc │ └── memory_unpack.cc ├── opt │ ├── .gitignore │ ├── Makefile.inc │ ├── muxpack.cc │ ├── opt.cc │ ├── opt_clean.cc │ ├── opt_demorgan.cc │ ├── opt_dff.cc │ ├── opt_expr.cc │ ├── opt_ffinv.cc │ ├── opt_lut.cc │ ├── opt_lut_ins.cc │ ├── opt_mem.cc │ ├── opt_mem_feedback.cc │ ├── opt_mem_priority.cc │ ├── opt_mem_widen.cc │ ├── opt_merge.cc │ ├── opt_muxtree.cc │ ├── opt_reduce.cc │ ├── opt_share.cc │ ├── peepopt.cc │ ├── peepopt_formal_clockgateff.pmg │ ├── peepopt_muldiv.pmg │ ├── peepopt_muldiv_c.pmg │ ├── peepopt_shiftadd.pmg │ ├── peepopt_shiftmul_left.pmg │ ├── peepopt_shiftmul_right.pmg │ ├── pmux2shiftx.cc │ ├── rmports.cc │ ├── share.cc │ └── wreduce.cc ├── pmgen │ ├── .gitignore │ ├── Makefile.inc │ ├── README.md │ ├── generate.h │ ├── pmgen.py │ ├── test_pmgen.cc │ └── test_pmgen.pmg ├── proc │ ├── Makefile.inc │ ├── proc.cc │ ├── proc_arst.cc │ ├── proc_clean.cc │ ├── proc_dff.cc │ ├── proc_dlatch.cc │ ├── proc_init.cc │ ├── proc_memwr.cc │ ├── proc_mux.cc │ ├── proc_prune.cc │ ├── proc_rmdead.cc │ └── proc_rom.cc ├── sat │ ├── Makefile.inc │ ├── assertpmux.cc │ ├── async2sync.cc │ ├── clk2fflogic.cc │ ├── cutpoint.cc │ ├── eval.cc │ ├── example.v │ ├── example.ys │ ├── expose.cc │ ├── fmcombine.cc │ ├── fminit.cc │ ├── formalff.cc │ ├── freduce.cc │ ├── miter.cc │ ├── mutate.cc │ ├── qbfsat.cc │ ├── qbfsat.h │ ├── recover_names.cc │ ├── sat.cc │ ├── sim.cc │ ├── supercover.cc │ └── synthprop.cc ├── techmap │ ├── Makefile.inc │ ├── abc.cc │ ├── abc9.cc │ ├── abc9_exe.cc │ ├── abc9_ops.cc │ ├── abc_new.cc │ ├── aigmap.cc │ ├── alumacc.cc │ ├── attrmap.cc │ ├── attrmvcp.cc │ ├── bmuxmap.cc │ ├── booth.cc │ ├── bufnorm.cc │ ├── bwmuxmap.cc │ ├── cellmatch.cc │ ├── clkbufmap.cc │ ├── clockgate.cc │ ├── constmap.cc │ ├── deminout.cc │ ├── demuxmap.cc │ ├── dffinit.cc │ ├── dfflegalize.cc │ ├── dfflibmap.cc │ ├── dffunmap.cc │ ├── extract.cc │ ├── extract_counter.cc │ ├── extract_fa.cc │ ├── extract_reduce.cc │ ├── extractinv.cc │ ├── filterlib.cc │ ├── flatten.cc │ ├── flowmap.cc │ ├── hilomap.cc │ ├── insbuf.cc │ ├── iopadmap.cc │ ├── libcache.cc │ ├── libparse.cc │ ├── libparse.h │ ├── lut2mux.cc │ ├── maccmap.cc │ ├── muxcover.cc │ ├── nlutmap.cc │ ├── pmuxtree.cc │ ├── shregmap.cc │ ├── simplemap.cc │ ├── simplemap.h │ ├── techmap.cc │ ├── tribuf.cc │ └── zinit.cc └── tests │ ├── Makefile.inc │ ├── flowmap │ ├── flow.v │ ├── flowp.v │ ├── pack1.v │ ├── pack1p.v │ ├── pack2.v │ ├── pack2p.v │ ├── pack3.v │ └── pack3p.v │ ├── test_abcloop.cc │ ├── test_autotb.cc │ └── test_cell.cc ├── setup.py ├── techlibs ├── .gitignore ├── achronix │ ├── Makefile.inc │ ├── speedster22i │ │ ├── cells_arith.v │ │ ├── cells_map.v │ │ └── cells_sim.v │ └── synth_achronix.cc ├── anlogic │ ├── Makefile.inc │ ├── anlogic_eqn.cc │ ├── anlogic_fixcarry.cc │ ├── arith_map.v │ ├── brams.txt │ ├── brams_map.v │ ├── cells_map.v │ ├── cells_sim.v │ ├── eagle_bb.v │ ├── lutrams.txt │ ├── lutrams_map.v │ └── synth_anlogic.cc ├── common │ ├── .gitignore │ ├── Makefile.inc │ ├── abc9_map.v │ ├── abc9_model.v │ ├── abc9_unmap.v │ ├── adff2dff.v │ ├── cellhelp.py │ ├── cells.lib │ ├── choices │ │ ├── han-carlson.v │ │ ├── kogge-stone.v │ │ └── sklansky.v │ ├── cmp2lcu.v │ ├── cmp2lut.v │ ├── cmp2softlogic.v │ ├── dff2ff.v │ ├── gate2lut.v │ ├── gen_fine_ffs.py │ ├── mul2dsp.v │ ├── pmux2mux.v │ ├── prep.cc │ ├── simcells.v │ ├── simlib.v │ ├── smtmap.v │ ├── synth.cc │ └── techmap.v ├── coolrunner2 │ ├── Makefile.inc │ ├── cells_counter_map.v │ ├── cells_latch.v │ ├── cells_sim.v │ ├── coolrunner2_fixup.cc │ ├── coolrunner2_sop.cc │ ├── synth_coolrunner2.cc │ ├── tff_extract.v │ └── xc2_dff.lib ├── easic │ ├── Makefile.inc │ └── synth_easic.cc ├── ecp5 │ ├── Makefile.inc │ ├── arith_map.v │ ├── brams.txt │ ├── brams_map.v │ ├── cells_bb.v │ ├── cells_ff.vh │ ├── cells_io.vh │ ├── cells_map.v │ ├── cells_sim.v │ ├── dsp_map.v │ ├── latches_map.v │ ├── lutrams.txt │ ├── lutrams_map.v │ ├── synth_ecp5.cc │ └── tests │ │ ├── .gitignore │ │ └── test_diamond_ffs.py ├── efinix │ ├── Makefile.inc │ ├── arith_map.v │ ├── brams.txt │ ├── brams_map.v │ ├── cells_map.v │ ├── cells_sim.v │ ├── efinix_fixcarry.cc │ ├── gbuf_map.v │ └── synth_efinix.cc ├── fabulous │ ├── Makefile.inc │ ├── arith_map.v │ ├── cells_map.v │ ├── ff_map.v │ ├── io_map.v │ ├── latches_map.v │ ├── prims.v │ ├── ram_regfile.txt │ ├── regfile_map.v │ └── synth_fabulous.cc ├── gatemate │ ├── .gitignore │ ├── Makefile.inc │ ├── arith_map.v │ ├── brams.txt │ ├── brams_init_20.vh │ ├── brams_init_40.vh │ ├── brams_map.v │ ├── cells_bb.v │ ├── cells_sim.v │ ├── gatemate_foldinv.cc │ ├── inv_map.v │ ├── lut_map.v │ ├── make_lut_tree_lib.py │ ├── mul_map.v │ ├── mux_map.v │ ├── reg_map.v │ └── synth_gatemate.cc ├── gowin │ ├── Makefile.inc │ ├── arith_map.v │ ├── brams.txt │ ├── brams_map.v │ ├── cells_map.v │ ├── cells_sim.v │ ├── cells_xtra.py │ ├── cells_xtra_gw1n.v │ ├── cells_xtra_gw2a.v │ ├── cells_xtra_gw5a.v │ ├── lutrams.txt │ ├── lutrams_map.v │ └── synth_gowin.cc ├── greenpak4 │ ├── Makefile.inc │ ├── cells_blackbox.v │ ├── cells_latch.v │ ├── cells_map.v │ ├── cells_sim.v │ ├── cells_sim_ams.v │ ├── cells_sim_digital.v │ ├── cells_sim_wip.v │ ├── gp_dff.lib │ ├── greenpak4_dffinv.cc │ └── synth_greenpak4.cc ├── ice40 │ ├── Makefile.inc │ ├── abc9_model.v │ ├── arith_map.v │ ├── brams.txt │ ├── brams_map.v │ ├── cells_map.v │ ├── cells_sim.v │ ├── dsp_map.v │ ├── ff_map.v │ ├── ice40_braminit.cc │ ├── ice40_dsp.cc │ ├── ice40_dsp.pmg │ ├── ice40_opt.cc │ ├── ice40_wrapcarry.cc │ ├── ice40_wrapcarry.pmg │ ├── latches_map.v │ ├── spram.txt │ ├── spram_map.v │ ├── synth_ice40.cc │ └── tests │ │ ├── .gitignore │ │ ├── test_arith.v │ │ ├── test_arith.ys │ │ ├── test_bram.sh │ │ ├── test_bram.v │ │ ├── test_bram_tb.v │ │ ├── test_dsp_map.sh │ │ ├── test_dsp_model.sh │ │ ├── test_dsp_model.v │ │ ├── test_ffs.sh │ │ └── test_ffs.v ├── intel │ ├── Makefile.inc │ ├── common │ │ ├── altpll_bb.v │ │ ├── brams_m9k.txt │ │ ├── brams_map_m9k.v │ │ ├── ff_map.v │ │ └── m9k_bb.v │ ├── cyclone10lp │ │ ├── cells_arith.v │ │ ├── cells_map.v │ │ └── cells_sim.v │ ├── cycloneiv │ │ ├── cells_arith.v │ │ ├── cells_map.v │ │ └── cells_sim.v │ ├── cycloneive │ │ ├── arith_map.v │ │ ├── cells_map.v │ │ └── cells_sim.v │ ├── max10 │ │ ├── cells_arith.v │ │ ├── cells_map.v │ │ ├── cells_sim.v │ │ └── dsp_map.v │ └── synth_intel.cc ├── intel_alm │ ├── Makefile.inc │ ├── common │ │ ├── abc9_map.v │ │ ├── abc9_model.v │ │ ├── abc9_unmap.v │ │ ├── alm_map.v │ │ ├── alm_sim.v │ │ ├── arith_alm_map.v │ │ ├── bram_m10k.txt │ │ ├── bram_m10k_map.v │ │ ├── dff_map.v │ │ ├── dff_sim.v │ │ ├── dsp_map.v │ │ ├── dsp_sim.v │ │ ├── lutram_mlab.txt │ │ ├── megafunction_bb.v │ │ ├── mem_sim.v │ │ └── misc_sim.v │ ├── cyclonev │ │ └── cells_sim.v │ └── synth_intel_alm.cc ├── lattice │ ├── Makefile.inc │ ├── arith_map_ccu2c.v │ ├── arith_map_ccu2d.v │ ├── brams_16kd.txt │ ├── brams_8kc.txt │ ├── brams_map_16kd.v │ ├── brams_map_8kc.v │ ├── ccu2c_sim.vh │ ├── ccu2d_sim.vh │ ├── cells_bb_ecp5.v │ ├── cells_bb_xo2.v │ ├── cells_bb_xo3.v │ ├── cells_bb_xo3d.v │ ├── cells_ff.vh │ ├── cells_io.vh │ ├── cells_map.v │ ├── cells_sim_ecp5.v │ ├── cells_sim_xo2.v │ ├── cells_sim_xo3.v │ ├── cells_sim_xo3d.v │ ├── cells_xtra.py │ ├── common_sim.vh │ ├── dsp_map_18x18.v │ ├── latches_map.v │ ├── lattice_gsr.cc │ ├── lutrams.txt │ ├── lutrams_map.v │ └── synth_lattice.cc ├── microchip │ ├── LSRAM.txt │ ├── LSRAM_map.v │ ├── Makefile.inc │ ├── arith_map.v │ ├── brams_defs.vh │ ├── cells_map.v │ ├── cells_sim.v │ ├── microchip_dffopt.cc │ ├── microchip_dsp.cc │ ├── microchip_dsp.pmg │ ├── microchip_dsp_CREG.pmg │ ├── microchip_dsp_cascade.pmg │ ├── polarfire_dsp_map.v │ ├── synth_microchip.cc │ ├── uSRAM.txt │ └── uSRAM_map.v ├── nanoxplore │ ├── Makefile.inc │ ├── arith_map.v │ ├── brams.txt │ ├── brams_init.vh │ ├── brams_map.v │ ├── cells_bb.v │ ├── cells_bb_l.v │ ├── cells_bb_m.v │ ├── cells_bb_u.v │ ├── cells_map.v │ ├── cells_sim.v │ ├── cells_sim_l.v │ ├── cells_sim_m.v │ ├── cells_sim_u.v │ ├── cells_wrap.v │ ├── cells_wrap_l.v │ ├── cells_wrap_m.v │ ├── cells_wrap_u.v │ ├── io_map.v │ ├── latches_map.v │ ├── nx_carry.cc │ ├── rf_init.vh │ ├── rf_rams_l.txt │ ├── rf_rams_m.txt │ ├── rf_rams_map_l.v │ ├── rf_rams_map_m.v │ ├── rf_rams_map_u.v │ ├── rf_rams_u.txt │ └── synth_nanoxplore.cc ├── nexus │ ├── Makefile.inc │ ├── arith_map.v │ ├── brams.txt │ ├── brams_map.v │ ├── cells_map.v │ ├── cells_sim.v │ ├── cells_xtra.py │ ├── cells_xtra.v │ ├── dsp_map.v │ ├── latches_map.v │ ├── lrams.txt │ ├── lrams_map.v │ ├── lutrams.txt │ ├── lutrams_map.v │ ├── parse_init.vh │ └── synth_nexus.cc ├── quicklogic │ ├── .gitignore │ ├── Makefile.inc │ ├── common │ │ └── cells_sim.v │ ├── pp3 │ │ ├── abc9_map.v │ │ ├── abc9_model.v │ │ ├── abc9_unmap.v │ │ ├── cells_map.v │ │ ├── cells_sim.v │ │ ├── ffs_map.v │ │ ├── latches_map.v │ │ └── lut_map.v │ ├── ql_bram_merge.cc │ ├── ql_bram_types.cc │ ├── ql_dsp_io_regs.cc │ ├── ql_dsp_macc.cc │ ├── ql_dsp_macc.pmg │ ├── ql_dsp_simd.cc │ ├── ql_ioff.cc │ ├── qlf_k6n10f │ │ ├── .gitignore │ │ ├── TDP18K_FIFO.v │ │ ├── arith_map.v │ │ ├── brams_map.v │ │ ├── brams_sim.v │ │ ├── cells_sim.v │ │ ├── dsp_final_map.v │ │ ├── dsp_map.v │ │ ├── dsp_sim.v │ │ ├── ffs_map.v │ │ ├── generate_bram_types_sim.py │ │ ├── libmap_brams.txt │ │ ├── libmap_brams_map.v │ │ ├── sram1024x18_mem.v │ │ └── ufifo_ctl.v │ └── synth_quicklogic.cc ├── sf2 │ ├── Makefile.inc │ ├── NOTES.txt │ ├── arith_map.v │ ├── cells_map.v │ ├── cells_sim.v │ ├── synth_sf2.cc │ └── tests │ │ └── test_arith.ys └── xilinx │ ├── Makefile.inc │ ├── abc9_model.v │ ├── arith_map.v │ ├── brams_defs.vh │ ├── brams_xc2v.txt │ ├── brams_xc2v_map.v │ ├── brams_xc3sda.txt │ ├── brams_xc3sda_map.v │ ├── brams_xc4v.txt │ ├── brams_xc4v_map.v │ ├── brams_xc5v_map.v │ ├── brams_xc6v_map.v │ ├── brams_xcu_map.v │ ├── brams_xcv.txt │ ├── brams_xcv_map.v │ ├── cells_map.v │ ├── cells_sim.v │ ├── cells_xtra.py │ ├── cells_xtra.v │ ├── ff_map.v │ ├── lut_map.v │ ├── lutrams_xc5v.txt │ ├── lutrams_xc5v_map.v │ ├── lutrams_xcu.txt │ ├── lutrams_xcv.txt │ ├── lutrams_xcv_map.v │ ├── mux_map.v │ ├── synth_xilinx.cc │ ├── tests │ ├── .gitignore │ ├── bram1.sh │ ├── bram1.v │ ├── bram1_tb.v │ ├── bram2.sh │ ├── bram2.v │ ├── bram2_tb.v │ ├── test_dsp48_model.sh │ ├── test_dsp48_model.v │ ├── test_dsp48a1_model.sh │ ├── test_dsp48a1_model.v │ ├── test_dsp_model.sh │ └── test_dsp_model.v │ ├── urams.txt │ ├── urams_map.v │ ├── xc3s_mult_map.v │ ├── xc3sda_dsp_map.v │ ├── xc4v_dsp_map.v │ ├── xc5v_dsp_map.v │ ├── xc6s_dsp_map.v │ ├── xc7_dsp_map.v │ ├── xcu_dsp_map.v │ ├── xilinx_dffopt.cc │ ├── xilinx_dsp.cc │ ├── xilinx_dsp.pmg │ ├── xilinx_dsp48a.pmg │ ├── xilinx_dsp_CREG.pmg │ ├── xilinx_dsp_cascade.pmg │ ├── xilinx_srl.cc │ └── xilinx_srl.pmg └── tests ├── aiger ├── .gitignore ├── and_.aag ├── and_.aig ├── and_to_bad_out.aag ├── and_to_bad_out.aig ├── buffer.aag ├── buffer.aig ├── cnt1.aag ├── cnt1.aig ├── cnt1e.aag ├── cnt1e.aig ├── empty.aag ├── empty.aig ├── false.aag ├── false.aig ├── halfadder.aag ├── halfadder.aig ├── inverter.aag ├── inverter.aig ├── io.ys ├── neg.ys ├── notcnt1.aag ├── notcnt1.aig ├── notcnt1e.aag ├── notcnt1e.aig ├── or_.aag ├── or_.aig ├── run-test.sh ├── symbols.aag ├── symbols.aig ├── toggle-re.aag ├── toggle-re.aig ├── toggle.aag ├── toggle.aig ├── true.aag └── true.aig ├── alumacc ├── basic.ys ├── macc_b_port_compat.ys ├── macc_infer_n_unmap.ys └── run-test.sh ├── arch ├── anlogic │ ├── .gitignore │ ├── add_sub.ys │ ├── blockram.ys │ ├── counter.ys │ ├── dffs.ys │ ├── fsm.ys │ ├── latches.ys │ ├── logic.ys │ ├── lutram.ys │ ├── mux.ys │ ├── run-test.sh │ ├── shifter.ys │ └── tribuf.ys ├── common │ ├── add_sub.v │ ├── adffs.v │ ├── blockram.v │ ├── blockrom.v │ ├── counter.v │ ├── dffs.v │ ├── fsm.v │ ├── latches.v │ ├── logic.v │ ├── lutram.v │ ├── memory_attributes │ │ └── attributes_test.v │ ├── mul.v │ ├── mux.v │ ├── shifter.v │ └── tribuf.v ├── ecp5 │ ├── .gitignore │ ├── add_sub.py │ ├── add_sub.ys │ ├── adffs.ys │ ├── bug1459.ys │ ├── bug1598.ys │ ├── bug1630.il.gz │ ├── bug1630.ys │ ├── bug1836.mem │ ├── bug1836.ys │ ├── bug2409.ys │ ├── bug2731.ys │ ├── counter.ys │ ├── dffs.ys │ ├── dpram.v │ ├── dpram.ys │ ├── fsm.ys │ ├── latches.ys │ ├── latches_abc9.ys │ ├── logic.ys │ ├── lutram.ys │ ├── macc.v │ ├── macc.ys │ ├── memories.ys │ ├── mul.ys │ ├── mux.ys │ ├── opt_lut_ins.ys │ ├── rom.v │ ├── rom.ys │ ├── run-test.sh │ ├── shifter.ys │ └── tribuf.ys ├── efinix │ ├── .gitignore │ ├── add_sub.ys │ ├── adffs.ys │ ├── counter.ys │ ├── dffs.ys │ ├── fsm.ys │ ├── latches.ys │ ├── logic.ys │ ├── lutram.ys │ ├── mux.ys │ ├── run-test.sh │ ├── shifter.ys │ └── tribuf.ys ├── fabulous │ ├── .gitignore │ ├── carry.ys │ ├── complexflop.ys │ ├── counter.ys │ ├── custom_map.v │ ├── custom_prims.v │ ├── customisation.ys │ ├── fsm.ys │ ├── logic.ys │ ├── regfile.ys │ └── tribuf.ys ├── gatemate │ ├── .gitignore │ ├── add_sub.ys │ ├── adffs.ys │ ├── counter.ys │ ├── dffs.ys │ ├── fsm.ys │ ├── gen_luttrees.py │ ├── latches.ys │ ├── logic.ys │ ├── luttrees.v │ ├── luttrees.ys │ ├── memory.ys │ ├── mul.v │ ├── mul.ys │ ├── mux.ys │ ├── run-test.sh │ ├── shifter.ys │ └── tribuf.ys ├── gowin │ ├── .gitignore │ ├── add_sub.ys │ ├── adffs.ys │ ├── compare.v │ ├── compare.ys │ ├── counter.ys │ ├── dffs.ys │ ├── fsm.ys │ ├── init-error.ys │ ├── init.v │ ├── init.ys │ ├── logic.ys │ ├── lutram.ys │ ├── mux.ys │ ├── run-test.sh │ ├── shifter.ys │ └── tribuf.ys ├── ice40 │ ├── .gitignore │ ├── add_sub.ys │ ├── adffs.ys │ ├── bug1597.ys │ ├── bug1598.ys │ ├── bug1626.ys │ ├── bug1644.il.gz │ ├── bug1644.ys │ ├── bug2061.ys │ ├── counter.ys │ ├── dffs.ys │ ├── dpram.v │ ├── dpram.ys │ ├── fsm.ys │ ├── ice40_dsp.ys │ ├── ice40_dsp_const.ys │ ├── ice40_opt.ys │ ├── ice40_wrapcarry.ys │ ├── latches.ys │ ├── logic.ys │ ├── macc.v │ ├── macc.ys │ ├── memories.ys │ ├── mul.ys │ ├── mux.ys │ ├── rom.v │ ├── rom.ys │ ├── run-test.sh │ ├── shifter.ys │ ├── spram.v │ ├── spram.ys │ └── tribuf.ys ├── intel_alm │ ├── .gitignore │ ├── add_sub.ys │ ├── adffs.ys │ ├── blockram.ys │ ├── counter.ys │ ├── dffs.ys │ ├── fsm.ys │ ├── logic.ys │ ├── lutram.ys │ ├── mul.ys │ ├── mux.ys │ ├── run-test.sh │ ├── shifter.ys │ └── tribuf.ys ├── machxo2 │ ├── .gitignore │ ├── add_sub.ys │ ├── adffs.ys │ ├── counter.ys │ ├── dffs.ys │ ├── fsm.ys │ ├── logic.ys │ ├── lutram.ys │ ├── mux.ys │ ├── run-test.sh │ ├── shifter.ys │ └── tribuf.ys ├── microchip │ ├── .gitignore │ ├── dff.ys │ ├── dff_opt.ys │ ├── dsp.ys │ ├── mult.ys │ ├── ram_SDP.ys │ ├── ram_TDP.ys │ ├── reduce.ys │ ├── run-test.sh │ ├── simple_ram.ys │ ├── uram_ar.ys │ ├── uram_sr.ys │ └── widemux.ys ├── nanoxplore │ ├── .gitignore │ ├── add_sub.ys │ ├── adffs.ys │ ├── dffs.ys │ ├── fsm.ys │ ├── latches.ys │ ├── logic.ys │ ├── lutram.ys │ ├── meminit.v │ ├── meminit.ys │ ├── mux.ys │ ├── run-test.sh │ ├── shifter.ys │ └── tribuf.ys ├── nexus │ ├── .gitignore │ ├── add_sub.ys │ ├── adffs.ys │ ├── blockram.ys │ ├── blockram_dc.v │ ├── counter.ys │ ├── dffs.ys │ ├── fsm.ys │ ├── logic.ys │ ├── lutram.ys │ ├── mul.ys │ ├── mux.ys │ ├── run-test.sh │ ├── shifter.ys │ └── tribuf.ys ├── quicklogic │ ├── .gitignore │ ├── pp3 │ │ ├── add_sub.ys │ │ ├── adffs.ys │ │ ├── counter.ys │ │ ├── dffs.ys │ │ ├── fsm.ys │ │ ├── latches.ys │ │ ├── logic.ys │ │ ├── mux.ys │ │ ├── run-test.sh │ │ └── tribuf.ys │ └── qlf_k6n10f │ │ ├── .gitignore │ │ ├── add_sub.ys │ │ ├── adffs.ys │ │ ├── counter.ys │ │ ├── dffs.ys │ │ ├── div.ys │ │ ├── dsp.ys │ │ ├── fsm.ys │ │ ├── ioff.ys │ │ ├── latches.ys │ │ ├── logic.ys │ │ ├── mem_gen.py │ │ ├── mem_tb.v │ │ ├── meminit.v │ │ ├── meminit.ys │ │ ├── mux.ys │ │ └── run-test.sh ├── run-test.sh └── xilinx │ ├── .gitignore │ ├── abc9_dff.ys │ ├── add_sub.ys │ ├── adffs.ys │ ├── asym_ram_sdp.ys │ ├── asym_ram_sdp_read_wider.v │ ├── asym_ram_sdp_write_wider.v │ ├── attributes_test.ys │ ├── blockram.ys │ ├── bug1460.ys │ ├── bug1462.ys │ ├── bug1480.ys │ ├── bug1598.ys │ ├── bug1605.ys │ ├── bug3670.v │ ├── bug3670.ys │ ├── counter.ys │ ├── dffs.ys │ ├── dsp_abc9.ys │ ├── dsp_cascade.ys │ ├── dsp_fastfir.ys │ ├── dsp_simd.ys │ ├── fsm.ys │ ├── latches.ys │ ├── logic.ys │ ├── lutram.ys │ ├── macc.sh │ ├── macc.v │ ├── macc.ys │ ├── macc_tb.v │ ├── mul.ys │ ├── mul_unsigned.v │ ├── mul_unsigned.ys │ ├── mux.ys │ ├── mux_lut4.ys │ ├── nosrl.ys │ ├── opt_lut_ins.ys │ ├── pmgen_xilinx_srl.ys │ ├── priority_memory.v │ ├── priority_memory.ys │ ├── run-test.sh │ ├── shifter.ys │ ├── tribuf.sh │ ├── tribuf.ys │ ├── xilinx_dffopt.ys │ ├── xilinx_dffopt_blacklist.txt │ ├── xilinx_dsp.ys │ ├── xilinx_srl.v │ └── xilinx_srl.ys ├── asicworld ├── .gitignore ├── README ├── code_hdl_models_GrayCounter.v ├── code_hdl_models_arbiter.v ├── code_hdl_models_arbiter_tb.v ├── code_hdl_models_cam.v ├── code_hdl_models_clk_div.v ├── code_hdl_models_clk_div_45.v ├── code_hdl_models_d_ff_gates.v ├── code_hdl_models_d_latch_gates.v ├── code_hdl_models_decoder_2to4_gates.v ├── code_hdl_models_decoder_using_assign.v ├── code_hdl_models_decoder_using_case.v ├── code_hdl_models_dff_async_reset.v ├── code_hdl_models_dff_sync_reset.v ├── code_hdl_models_encoder_4to2_gates.v ├── code_hdl_models_encoder_using_case.v ├── code_hdl_models_encoder_using_if.v ├── code_hdl_models_full_adder_gates.v ├── code_hdl_models_full_subtracter_gates.v ├── code_hdl_models_gray_counter.v ├── code_hdl_models_half_adder_gates.v ├── code_hdl_models_lfsr.v ├── code_hdl_models_lfsr_updown.v ├── code_hdl_models_mux_2to1_gates.v ├── code_hdl_models_mux_using_assign.v ├── code_hdl_models_mux_using_case.v ├── code_hdl_models_mux_using_if.v ├── code_hdl_models_one_hot_cnt.v ├── code_hdl_models_parallel_crc.v ├── code_hdl_models_parity_using_assign.v ├── code_hdl_models_parity_using_bitwise.v ├── code_hdl_models_parity_using_function.v ├── code_hdl_models_pri_encoder_using_assign.v ├── code_hdl_models_rom_using_case.v ├── code_hdl_models_serial_crc.v ├── code_hdl_models_tff_async_reset.v ├── code_hdl_models_tff_sync_reset.v ├── code_hdl_models_uart.v ├── code_hdl_models_up_counter.v ├── code_hdl_models_up_counter_load.v ├── code_hdl_models_up_down_counter.v ├── code_specman_switch_fabric.v ├── code_tidbits_asyn_reset.v ├── code_tidbits_blocking.v ├── code_tidbits_fsm_using_always.v ├── code_tidbits_fsm_using_function.v ├── code_tidbits_fsm_using_single_always.v ├── code_tidbits_nonblocking.v ├── code_tidbits_reg_combo_example.v ├── code_tidbits_reg_seq_example.v ├── code_tidbits_syn_reset.v ├── code_tidbits_wire_example.v ├── code_verilog_tutorial_addbit.v ├── code_verilog_tutorial_always_example.v ├── code_verilog_tutorial_bus_con.v ├── code_verilog_tutorial_comment.v ├── code_verilog_tutorial_counter.v ├── code_verilog_tutorial_counter_tb.v ├── code_verilog_tutorial_d_ff.v ├── code_verilog_tutorial_decoder.v ├── code_verilog_tutorial_decoder_always.v ├── code_verilog_tutorial_escape_id.v ├── code_verilog_tutorial_explicit.v ├── code_verilog_tutorial_first_counter.v ├── code_verilog_tutorial_first_counter_tb.v ├── code_verilog_tutorial_flip_flop.v ├── code_verilog_tutorial_fsm_full.v ├── code_verilog_tutorial_fsm_full_tb.v ├── code_verilog_tutorial_good_code.v ├── code_verilog_tutorial_if_else.v ├── code_verilog_tutorial_multiply.v ├── code_verilog_tutorial_mux_21.v ├── code_verilog_tutorial_n_out_primitive.v ├── code_verilog_tutorial_parallel_if.v ├── code_verilog_tutorial_parity.v ├── code_verilog_tutorial_simple_function.v ├── code_verilog_tutorial_simple_if.v ├── code_verilog_tutorial_task_global.v ├── code_verilog_tutorial_tri_buf.v ├── code_verilog_tutorial_v2k_reg.v ├── code_verilog_tutorial_which_clock.v ├── run-test.sh └── xfirrtl ├── bind ├── .gitignore ├── basic.sv ├── basic.ys ├── cell_list.sv ├── cell_list.ys ├── hier.sv ├── hier.ys ├── inst_list.sv ├── inst_list.ys ├── param.sv ├── param.ys ├── run-test.sh ├── toplevel.sv └── toplevel.ys ├── blif ├── .gitignore ├── bug2729.ys ├── bug3374.ys ├── bug3385.ys └── run-test.sh ├── bram ├── .gitignore ├── generate.py ├── run-single.sh └── run-test.sh ├── cxxrtl ├── .gitignore ├── run-test.sh ├── test_unconnected_output.v ├── test_value.cc └── test_value_fuzz.cc ├── errors ├── syntax_err01.v ├── syntax_err02.v ├── syntax_err03.v ├── syntax_err04.v ├── syntax_err05.v ├── syntax_err06.v ├── syntax_err07.v ├── syntax_err08.v ├── syntax_err09.v ├── syntax_err10.v ├── syntax_err11.v ├── syntax_err12.v └── syntax_err13.v ├── fmt ├── .gitignore ├── always_comb.v ├── always_comb_tb.cc ├── always_comb_tb.v ├── always_display.v ├── always_full.v ├── always_full_tb.cc ├── always_full_tb.v ├── display_lm.v ├── display_lm_tb.cc ├── fuzz │ ├── .gitignore │ ├── CMakeLists.txt │ └── x_test.cc ├── initial_display.v ├── roundtrip.v ├── roundtrip_tb.v └── run-test.sh ├── fsm ├── .gitignore ├── generate.py └── run-test.sh ├── functional ├── .gitignore ├── README.md ├── conftest.py ├── picorv32.v ├── picorv32_tb.v ├── rkt_vcd.py ├── rtlil_cells.py ├── run-test.sh ├── smt_vcd.py ├── smtio.py ├── test_functional.py └── vcd_harness.cc ├── gen-tests-makefile.sh ├── hana ├── .gitignore ├── README ├── hana_vlib.v ├── run-test.sh ├── test_intermout.v ├── test_parse2synthtrans.v ├── test_parser.v ├── test_simulation_always.v ├── test_simulation_and.v ├── test_simulation_buffer.v ├── test_simulation_decoder.v ├── test_simulation_inc.v ├── test_simulation_mux.v ├── test_simulation_nand.v ├── test_simulation_nor.v ├── test_simulation_or.v ├── test_simulation_seq.v ├── test_simulation_shifter.v ├── test_simulation_sop.v ├── test_simulation_techmap.v ├── test_simulation_techmap_tech.v ├── test_simulation_vlib.v ├── test_simulation_xnor.v └── test_simulation_xor.v ├── liberty ├── .gitignore ├── XNOR2X1.lib ├── XNOR2X1.lib.filtered.ok ├── XNOR2X1.lib.verilogsim.ok ├── busdef.lib ├── busdef.lib.filtered.ok ├── busdef.lib.verilogsim.ok ├── dff.lib ├── dff.lib.filtered.ok ├── dff.lib.verilogsim.ok ├── dff.log.ok ├── foundry_data │ ├── .gitignore │ ├── RM_IHPSG13_1P_64x64_c2_bm_bist_typ_1p20V_25C.lib.filtered.gz │ ├── rules.txt │ └── sg13g2_stdcell_typ_1p20V_25C.lib.filtered.gz ├── idranges.lib ├── idranges.lib.filtered.ok ├── idranges.lib.verilogsim.ok ├── issue3498_bad.lib ├── issue3498_bad.lib.filtered.ok ├── issue3498_bad.lib.verilogsim.ok ├── libcache.ys ├── non-ascii.lib ├── non-ascii.lib.filtered.ok ├── non-ascii.lib.verilogsim.ok ├── normal.lib ├── normal.lib.filtered.ok ├── normal.lib.verilogsim.ok ├── normal.verilogsim.ok ├── options_test.ys ├── processdefs.lib ├── processdefs.lib.filtered.ok ├── processdefs.lib.verilogsim.ok ├── run-test.sh ├── semicolextra.lib ├── semicolextra.lib.filtered.ok ├── semicolextra.lib.verilogsim.ok ├── semicolmissing.lib ├── semicolmissing.lib.filtered.ok ├── semicolmissing.lib.verilogsim.ok └── small.v ├── lut ├── .gitignore ├── check_map.ys ├── check_map_lut6.ys ├── map_and.v ├── map_cmp.v ├── map_mux.v ├── map_not.v ├── map_or.v ├── map_xor.v └── run-test.sh ├── memfile ├── .gitignore ├── content1.dat ├── memory.v └── run-test.sh ├── memlib ├── .gitignore ├── generate.py ├── memlib_9b1B.txt ├── memlib_9b1B.v ├── memlib_block_sdp.txt ├── memlib_block_sdp.v ├── memlib_block_sdp_1clk.txt ├── memlib_block_sdp_1clk.v ├── memlib_block_sp.txt ├── memlib_block_sp.v ├── memlib_block_sp_full.txt ├── memlib_block_sp_full.v ├── memlib_block_tdp.txt ├── memlib_block_tdp.v ├── memlib_clock_sdp.txt ├── memlib_clock_sdp.v ├── memlib_lut.txt ├── memlib_lut.v ├── memlib_multilut.txt ├── memlib_multilut.v ├── memlib_wide_read.txt ├── memlib_wide_read.v ├── memlib_wide_sdp.txt ├── memlib_wide_sdp.v ├── memlib_wide_sp.txt ├── memlib_wide_sp.v ├── memlib_wide_write.txt ├── memlib_wide_write.v ├── memlib_wren.txt ├── memlib_wren.v └── run-test.sh ├── memories ├── .gitignore ├── amber23_sram_byte_en.v ├── firrtl_938.v ├── implicit_en.v ├── issue00335.v ├── issue00710.v ├── no_implicit_en.v ├── nordports.ys ├── read_arst.v ├── read_two_mux.v ├── run-test.sh ├── shared_ports.v ├── simple_sram_byte_en.v ├── trans_addr_enable.v ├── trans_sdp.v ├── trans_sp.v ├── wide_all.v ├── wide_read_async.v ├── wide_read_mixed.v ├── wide_read_sync.v ├── wide_read_trans.v ├── wide_thru_priority.v └── wide_write.v ├── opt ├── .gitignore ├── bug1525.ys ├── bug1758.ys ├── bug1854.ys ├── bug2010.ys ├── bug2221.ys ├── bug2311.ys ├── bug2318.ys ├── bug2623.ys ├── bug2765.ys ├── bug2766.ys ├── bug2824.ys ├── bug2920.ys ├── bug3047.ys ├── bug3117.ys ├── bug3848.ys ├── bug3867.ys ├── bug4413.ys ├── bug4610.ys ├── memory_bmux2rom.ys ├── memory_dff_trans.ys ├── memory_map_offset.ys ├── opt_clean_init.ys ├── opt_clean_mem.ys ├── opt_dff_arst.ys ├── opt_dff_clk.ys ├── opt_dff_const.ys ├── opt_dff_dffmux.ys ├── opt_dff_en.ys ├── opt_dff_mux.ys ├── opt_dff_qd.ys ├── opt_dff_sr.ys ├── opt_dff_srst.ys ├── opt_expr.ys ├── opt_expr_alu.ys ├── opt_expr_and.ys ├── opt_expr_cmp.v ├── opt_expr_cmp.ys ├── opt_expr_combined_assign.ys ├── opt_expr_constconn.v ├── opt_expr_constconn.ys ├── opt_expr_consumex.ys ├── opt_expr_more.ys ├── opt_expr_mux_undef.ys ├── opt_expr_or.ys ├── opt_expr_shift.ys ├── opt_expr_shr_int_max.ys ├── opt_expr_xnor.ys ├── opt_expr_xor.ys ├── opt_lut.v ├── opt_lut.ys ├── opt_lut_elim.il ├── opt_lut_elim.ys ├── opt_lut_ins.ys ├── opt_lut_port.il ├── opt_lut_port.ys ├── opt_mem_feedback.ys ├── opt_mem_priority.ys ├── opt_merge_basic.ys ├── opt_merge_init.ys ├── opt_merge_keep.ys ├── opt_pow.ys ├── opt_reduce_andor.ys ├── opt_reduce_bmux.ys ├── opt_reduce_demux.ys ├── opt_rmdff.v ├── opt_rmdff.ys ├── opt_rmdff_sat.v ├── opt_rmdff_sat.ys ├── opt_share_add_sub.v ├── opt_share_add_sub.ys ├── opt_share_bug2334.ys ├── opt_share_bug2335.ys ├── opt_share_bug2336.ys ├── opt_share_bug2538.ys ├── opt_share_cat.v ├── opt_share_cat.ys ├── opt_share_cat_multiuser.v ├── opt_share_cat_multiuser.ys ├── opt_share_diff_port_widths.v ├── opt_share_diff_port_widths.ys ├── opt_share_extend.v ├── opt_share_extend.ys ├── opt_share_large_pmux_cat.v ├── opt_share_large_pmux_cat.ys ├── opt_share_large_pmux_cat_multipart.v ├── opt_share_large_pmux_cat_multipart.ys ├── opt_share_large_pmux_multipart.v ├── opt_share_large_pmux_multipart.ys ├── opt_share_large_pmux_part.v ├── opt_share_large_pmux_part.ys ├── opt_share_mux_tree.v ├── opt_share_mux_tree.ys └── run-test.sh ├── opt_share ├── .gitignore ├── generate.py └── run-test.sh ├── peepopt ├── .gitignore ├── muldiv_c.ys └── run-test.sh ├── proc ├── .gitignore ├── bug2619.ys ├── bug2656.ys ├── bug2962.ys ├── bug4712.ys ├── bug_1268.v ├── bug_1268.ys ├── clean_undef_case.ys ├── proc_dff.ys ├── proc_rom.ys ├── rmdead.v ├── rmdead.ys └── run-test.sh ├── realmath ├── .gitignore ├── generate.py └── run-test.sh ├── rpc ├── .gitignore ├── design.v ├── exec.ys ├── frontend.py └── run-test.sh ├── sat ├── .gitignore ├── alu.v ├── asserts.v ├── asserts.ys ├── asserts_seq.v ├── asserts_seq.ys ├── bug2595.ys ├── clk2fflogic.ys ├── counters-repeat.v ├── counters-repeat.ys ├── counters.v ├── counters.ys ├── dff.ys ├── expose_dff.v ├── expose_dff.ys ├── grom.ys ├── grom_computer.v ├── grom_cpu.v ├── initval.v ├── initval.ys ├── ram_memory.v ├── run-test.sh ├── share.v ├── share.ys ├── sim_counter.ys ├── sizebits.sv ├── sizebits.ys ├── splice.v └── splice.ys ├── select ├── .gitignore ├── boxes.v ├── boxes_equals_name.ys ├── boxes_equals_operators.ys ├── boxes_equals_pattern.ys ├── boxes_equals_wildcard.ys ├── boxes_import.ys ├── boxes_no_equals.ys ├── boxes_no_equals_clean.ys ├── boxes_setattr.ys ├── boxes_stack.ys ├── internal_selects.ys ├── list_mod.ys ├── mod-attribute.ys ├── no_warn_assert.ys ├── no_warn_prefixed_arg_memb.ys ├── no_warn_prefixed_empty_select_arg.ys ├── run-test.sh ├── unset.ys ├── unset2.ys └── warn_empty_select_arg.ys ├── share ├── .gitignore ├── generate.py └── run-test.sh ├── sim ├── .gitignore ├── adff.v ├── adffe.v ├── adlatch.v ├── aldff.v ├── aldffe.v ├── assume_x_first_step.ys ├── dff.v ├── dffe.v ├── dffsr.v ├── dlatch.v ├── dlatchsr.v ├── run-test.sh ├── sdff.v ├── sdffce.v ├── sdffe.v ├── sim_adff.ys ├── sim_adffe.ys ├── sim_adlatch.ys ├── sim_aldff.ys ├── sim_aldffe.ys ├── sim_cycles.ys ├── sim_dff.ys ├── sim_dffe.ys ├── sim_dffsr.ys ├── sim_dlatch.ys ├── sim_dlatchsr.ys ├── sim_sdff.ys ├── sim_sdffce.ys ├── sim_sdffe.ys ├── simple_assign.v ├── simple_assign.vcd ├── tb │ ├── tb_adff.v │ ├── tb_adffe.v │ ├── tb_adlatch.v │ ├── tb_aldff.v │ ├── tb_aldffe.v │ ├── tb_dff.v │ ├── tb_dffe.v │ ├── tb_dffsr.v │ ├── tb_dlatch.v │ ├── tb_dlatchsr.v │ ├── tb_sdff.v │ ├── tb_sdffce.v │ └── tb_sdffe.v ├── var_reference_with_whitespace.vcd ├── var_reference_without_whitespace.vcd ├── vcd_var_reference_whitespace.ys └── vector_assign.il ├── simple ├── .gitignore ├── aes_kexp128.v ├── always01.v ├── always02.v ├── always03.v ├── arraycells.v ├── arrays01.v ├── arrays02.sv ├── arrays03.sv ├── asgn_binop.sv ├── attrib01_module.v ├── attrib02_port_decl.v ├── attrib03_parameter.v ├── attrib04_net_var.v ├── attrib05_port_conn.v.DISABLED ├── attrib06_operator_suffix.v ├── attrib07_func_call.v.DISABLED ├── attrib08_mod_inst.v ├── attrib09_case.v ├── carryadd.v ├── case_expr_const.v ├── case_expr_extend.sv ├── case_expr_non_const.v ├── case_expr_query.sv ├── case_large.v ├── const_branch_finish.v ├── const_fold_func.v ├── const_func_shadow.v ├── constmuldivmod.v ├── constpower.v ├── defvalue.sv ├── dff_different_styles.v ├── dff_init.v ├── dynslice.v ├── fiedler-cooley.v ├── forgen01.v ├── forgen02.v ├── forloops.v ├── fsm.v ├── func_block.v ├── func_recurse.v ├── func_width_scope.v ├── genblk_collide.v ├── genblk_dive.v ├── genblk_order.v ├── genblk_port_shadow.v ├── generate.v ├── graphtest.v ├── hierarchy.v ├── hierdefparam.v ├── i2c_master_tests.v ├── ifdef_1.v ├── ifdef_2.v ├── implicit_ports.sv ├── lesser_size_cast.sv ├── local_loop_var.sv ├── localparam_attr.v ├── loop_prefix_case.v ├── loop_var_shadow.v ├── loops.v ├── macro_arg_spaces.sv ├── macro_arg_surrounding_spaces.v ├── macros.v ├── matching_end_labels.sv ├── mem2reg.v ├── mem2reg_bounds_tern.v ├── mem_arst.v ├── memory.v ├── memwr_port_connection.sv ├── module_scope.v ├── module_scope_case.v ├── module_scope_func.v ├── multiplier.v ├── muxtree.v ├── named_genblk.v ├── nested_genblk_resolve.v ├── omsp_dbg_uart.v ├── operators.v ├── param_attr.v ├── paramods.v ├── partsel.v ├── process.v ├── realexpr.v ├── repwhile.v ├── retime.v ├── rotate.v ├── run-test.sh ├── scopes.v ├── sign_part_assign.v ├── signed_full_slice.v ├── signedexpr.v ├── sincos.v ├── specify.v ├── string_format.v ├── subbytes.v ├── task_func.v ├── undef_eqx_nex.v ├── unnamed_block_decl.sv ├── usb_phy_tests.v ├── values.v ├── verilog_primitives.v ├── vloghammer.v ├── wandwor.v ├── wreduce.v └── xfirrtl ├── simple_abc9 ├── .gitignore ├── abc9.v └── run-test.sh ├── smv ├── .gitignore ├── run-single.sh └── run-test.sh ├── sva ├── .gitignore ├── Makefile ├── basic00.sv ├── basic01.sv ├── basic02.sv ├── basic03.sv ├── basic04.sv ├── basic04.vhd ├── basic05.sv ├── basic05.vhd ├── counter.sv ├── extnets.sv ├── nested_clk_else.sv ├── runtest.sh ├── sva_not.sv ├── sva_range.sv ├── sva_throughout.sv ├── sva_value_change_changed.sv ├── sva_value_change_changed_wide.sv ├── sva_value_change_rose.sv ├── sva_value_change_sim.sv └── sva_value_change_sim.ys ├── svinterfaces ├── .gitignore ├── load_and_derive.sv ├── load_and_derive.ys ├── ondemand.sv ├── resolve_types.sv ├── resolve_types.ys ├── run-test.sh ├── run_simple.sh ├── runone.sh ├── svinterface1.sv ├── svinterface1_ref.v ├── svinterface1_tb.v ├── svinterface_at_top.sv ├── svinterface_at_top_ref.v ├── svinterface_at_top_tb.v ├── svinterface_at_top_tb_wrapper.v └── svinterface_at_top_wrapper.v ├── svtypes ├── .gitignore ├── enum_simple.sv ├── enum_simple.ys ├── logic_rom.sv ├── logic_rom.ys ├── multirange_array.sv ├── multirange_subarray_access.ys ├── run-test.sh ├── static_cast_negative.ys ├── static_cast_nonconst.ys ├── static_cast_simple.sv ├── static_cast_verilog.ys ├── static_cast_zero.ys ├── struct_array.sv ├── struct_dynamic_range.sv ├── struct_dynamic_range.ys ├── struct_simple.sv ├── struct_sizebits.sv ├── typedef_initial_and_assign.sv ├── typedef_initial_and_assign.ys ├── typedef_memory.sv ├── typedef_memory.ys ├── typedef_memory_2.sv ├── typedef_memory_2.ys ├── typedef_package.sv ├── typedef_param.sv ├── typedef_scopes.sv ├── typedef_simple.sv ├── typedef_struct.sv ├── typedef_struct_global.ys ├── typedef_struct_port.sv ├── typedef_struct_port.ys └── union_simple.sv ├── techmap ├── .gitignore ├── abc9.ys ├── adff2dff.ys ├── aigmap.ys ├── autopurge.ys ├── bmuxmap_pmux.ys ├── booth.ys ├── booth_map_script.ys_ ├── buf.ys ├── bufnorm.ys ├── bug2183.ys ├── bug2321.ys ├── bug2332.ys ├── bug2759.ys ├── bug2972.ys ├── cellmatch.ys ├── cellname.ys ├── clkbufmap.ys ├── clockgate.lib ├── clockgate.ys ├── clockgate_neg.lib ├── clockgate_pos.lib ├── cmp2lcu.ys ├── constmap.ys ├── dff2ff.ys ├── dffinit.ys ├── dfflegalize_adff.ys ├── dfflegalize_adff_init.ys ├── dfflegalize_adlatch.ys ├── dfflegalize_adlatch_init.ys ├── dfflegalize_aldff.ys ├── dfflegalize_aldff_init.ys ├── dfflegalize_dff.ys ├── dfflegalize_dff_init.ys ├── dfflegalize_dffsr.ys ├── dfflegalize_dffsr_init.ys ├── dfflegalize_dlatch.ys ├── dfflegalize_dlatch_const.ys ├── dfflegalize_dlatch_init.ys ├── dfflegalize_dlatchsr.ys ├── dfflegalize_dlatchsr_init.ys ├── dfflegalize_inv.ys ├── dfflegalize_mince.ys ├── dfflegalize_minsrst.ys ├── dfflegalize_sr.ys ├── dfflegalize_sr_init.ys ├── dfflibmap-sim.v ├── dfflibmap.lib ├── dfflibmap.ys ├── dfflibmap_dffn_dffe.lib ├── dfflibmap_dffsr.lib ├── dffunmap.ys ├── extractinv.ys ├── han-carlson.tcl ├── iopadmap.ys ├── kogge-stone.tcl ├── lcu_refined.v ├── mem_simple_4x1_cells.v ├── mem_simple_4x1_map.v ├── mem_simple_4x1_runtest.sh ├── mem_simple_4x1_tb.v ├── mem_simple_4x1_uut.v ├── pmux2mux.ys ├── recursive.v ├── recursive_map.v ├── recursive_runtest.sh ├── run-test.sh ├── shiftx2mux.ys ├── sklansky.tcl ├── techmap_chtype.ys ├── techmap_replace.ys ├── wireinit.ys └── zinit.ys ├── tools ├── .gitignore ├── autotest.mk ├── autotest.sh ├── cmp_tbdata.c ├── profiler.pl ├── txt2tikztiming.py ├── vcd2txt.pl └── vcdcd.pl ├── unit ├── Makefile └── kernel │ ├── logTest.cc │ └── rtlilTest.cc ├── various ├── .gitignore ├── abc9.v ├── abc9.ys ├── abstract_init.ys ├── abstract_state.ys ├── abstract_value.ys ├── aiger2.ys ├── aiger_dff.ys ├── async.sh ├── async.v ├── attrib05_port_conn.v ├── attrib05_port_conn.ys ├── attrib07_func_call.v ├── attrib07_func_call.ys ├── autoname.ys ├── blackbox_wb.ys ├── box_derive.ys ├── bug1496.ys ├── bug1531.ys ├── bug1614.ys ├── bug1710.ys ├── bug1745.ys ├── bug1781.ys ├── bug1876.ys ├── bug2014.ys ├── bug3462.ys ├── bug3879.ys ├── bug4082.ys ├── bug4865.ys ├── bug4909.ys ├── cellarray_array_connections.ys ├── celledges_shift.ys ├── check.ys ├── check_2.ys ├── check_3.ys ├── check_4.ys ├── chformal_check.ys ├── chformal_coverenable.ys ├── chparam.sh ├── clk2fflogic_effects.sh ├── clk2fflogic_effects.sv ├── const_arg_loop.sv ├── const_arg_loop.ys ├── const_func.sv ├── const_func.ys ├── const_func_block_var.v ├── const_func_block_var.ys ├── constant_drive_conflict.ys ├── constcomment.ys ├── constmsk_test.v ├── constmsk_test.ys ├── constmsk_testmap.v ├── countbits.sv ├── countbits.ys ├── cutpoint_blackbox.ys ├── cutpoint_whole.ys ├── deminout_unused.ys ├── design.ys ├── design1.ys ├── design2.ys ├── dynamic_part_select.ys ├── dynamic_part_select │ ├── forloop_select.v │ ├── forloop_select_gate.v │ ├── forloop_select_nowrshmsk.v │ ├── latch_002.v │ ├── latch_002_gate.v │ ├── latch_002_gate_good.v │ ├── latch_1990.v │ ├── latch_1990_gate.v │ ├── multiple_blocking.v │ ├── multiple_blocking_gate.v │ ├── nonblocking.v │ ├── nonblocking_gate.v │ ├── original.v │ ├── original_gate.v │ ├── reset_test.v │ ├── reset_test_gate.v │ ├── reversed.v │ └── reversed_gate.v ├── elab_sys_tasks.sv ├── elab_sys_tasks.ys ├── equiv_make_make_assert.ys ├── equiv_opt_multiclock.ys ├── equiv_opt_undef.ys ├── exec.ys ├── fib.v ├── fib.ys ├── fib_tern.v ├── fib_tern.ys ├── formalff_declockgate.ys ├── func_port_implied_dir.sv ├── func_port_implied_dir.ys ├── gen_if_null.v ├── gen_if_null.ys ├── global_scope.ys ├── gzip_verilog.v.gz ├── gzip_verilog.ys ├── help.ys ├── hierarchy.sh ├── hierarchy_defer.ys ├── hierarchy_generate.ys ├── hierarchy_param.ys ├── ice40_mince_abc9.ys ├── integer_range_bad_syntax.ys ├── integer_real_bad_syntax.ys ├── json_escape_chars.ys ├── json_scopeinfo.ys ├── keep_hierarchy.ys ├── logger_cmd_error.sh ├── logger_error.ys ├── logger_fail.sh ├── logger_nowarning.ys ├── logger_warn.ys ├── logger_warning.ys ├── logic_param_simple.ys ├── mem2reg.ys ├── memory_word_as_index.data ├── memory_word_as_index.v ├── memory_word_as_index.ys ├── muxcover.ys ├── muxpack.v ├── muxpack.ys ├── param_struct.ys ├── peepopt.ys ├── peepopt_formal.ys ├── plugin.cc ├── plugin.sh ├── pmgen_reduce.ys ├── pmux2shiftx.v ├── pmux2shiftx.ys ├── port_sign_extend.v ├── port_sign_extend.ys ├── primitives.ys ├── printattr.ys ├── rand_const.sv ├── rand_const.ys ├── reg_wire_error.sv ├── reg_wire_error.ys ├── rename_scramble_name.ys ├── rtlil_signed_attribute.ys ├── rtlil_z_bits.ys ├── run-test.sh ├── scopeinfo.ys ├── scratchpad.ys ├── script.ys ├── setundef.sv ├── setundef.ys ├── sformatf.ys ├── shregmap.v ├── shregmap.ys ├── signed.ys ├── signext.ys ├── sim_const.ys ├── specify.v ├── specify.ys ├── src.ys ├── sta.ys ├── stat.ys ├── struct_access.sv ├── struct_access.ys ├── sub.v ├── submod.ys ├── submod_extract.ys ├── sv_defines.ys ├── sv_defines_dup.ys ├── sv_defines_mismatch.ys ├── sv_defines_too_few.ys ├── sv_implicit_ports.sh ├── svalways.sh ├── tcl_apis.tcl ├── tcl_apis.v ├── tcl_apis.ys ├── wrapcell.ys ├── wreduce.ys ├── wreduce2.ys ├── write_gzip.ys └── xaiger.ys ├── verific ├── .gitignore ├── blackbox.ys ├── blackbox_empty.ys ├── blackbox_ql.ys ├── bounds.sv ├── bounds.vhd ├── bounds.ys ├── case.sv ├── case.ys ├── clocking.ys ├── enum_values.sv ├── enum_values.ys ├── memory_semantics.ys ├── range_case.sv ├── range_case.ys ├── rom_case.ys ├── run-test.sh ├── setenv.flist └── setenv.ys ├── verilog ├── .gitignore ├── absurd_width.ys ├── absurd_width_const.ys ├── always_comb_latch_1.ys ├── always_comb_latch_2.ys ├── always_comb_latch_3.ys ├── always_comb_latch_4.ys ├── always_comb_nolatch_1.ys ├── always_comb_nolatch_2.ys ├── always_comb_nolatch_3.ys ├── always_comb_nolatch_4.ys ├── always_comb_nolatch_5.ys ├── always_comb_nolatch_6.ys ├── asgn_expr.sv ├── asgn_expr.ys ├── asgn_expr_not_proc_1.ys ├── asgn_expr_not_proc_2.ys ├── asgn_expr_not_proc_3.ys ├── asgn_expr_not_proc_4.ys ├── asgn_expr_not_proc_5.ys ├── asgn_expr_not_sv_1.ys ├── asgn_expr_not_sv_2.ys ├── asgn_expr_not_sv_3.ys ├── asgn_expr_not_sv_4.ys ├── assign_to_reg.ys ├── atom_type_signedness.ys ├── block_end_label_only.ys ├── block_end_label_wrong.ys ├── block_labels.ys ├── bug2037.ys ├── bug2042-sv.ys ├── bug2042.ys ├── bug2493.ys ├── bug656.v ├── bug656.ys ├── conflict_assert.ys ├── conflict_cell_memory.ys ├── conflict_interface_port.ys ├── conflict_memory_wire.ys ├── conflict_pwire.ys ├── conflict_wire_memory.ys ├── const_arst.ys ├── const_sr.ys ├── delay_mintypmax.ys ├── delay_risefall.ys ├── delay_time_scale.ys ├── doubleslash.ys ├── dynamic_range_lhs.sh ├── dynamic_range_lhs.v ├── for_decl_no_init.ys ├── for_decl_no_sv.ys ├── for_decl_shadow.sv ├── for_decl_shadow.ys ├── func_arg_mismatch_1.ys ├── func_arg_mismatch_2.ys ├── func_arg_mismatch_3.ys ├── func_arg_mismatch_4.ys ├── func_tern_hint.sv ├── func_tern_hint.ys ├── func_typename_ret.sv ├── func_typename_ret.ys ├── func_upto.sv ├── func_upto.ys ├── gen_block_end_label_only.ys ├── gen_block_end_label_wrong.ys ├── genblk_case.v ├── genblk_case.ys ├── genblk_port_decl.ys ├── genfor_decl_no_init.ys ├── genfor_decl_no_sv.ys ├── genvar_loop_decl_1.sv ├── genvar_loop_decl_1.ys ├── genvar_loop_decl_2.sv ├── genvar_loop_decl_2.ys ├── genvar_loop_decl_3.sv ├── genvar_loop_decl_3.ys ├── global_parameter.ys ├── hidden_decl.ys ├── ifdef_nest.ys ├── ifdef_unterminated.ys ├── include_self.v ├── include_self.ys ├── int_types.sv ├── int_types.ys ├── localparam_no_default_1.ys ├── localparam_no_default_2.ys ├── macro_arg_tromp.sv ├── macro_arg_tromp.ys ├── macro_unapplied.ys ├── macro_unapplied_newline.ys ├── mem_bounds.sv ├── mem_bounds.ys ├── module_end_label.ys ├── net_types.sv ├── net_types.ys ├── package_end_label.ys ├── package_task_func.sv ├── package_task_func.ys ├── param_default.ys ├── param_int_types.sv ├── param_int_types.ys ├── param_no_default.sv ├── param_no_default.ys ├── param_no_default_not_svmode.ys ├── param_no_default_unbound_1.ys ├── param_no_default_unbound_2.ys ├── param_no_default_unbound_3.ys ├── param_no_default_unbound_4.ys ├── param_no_default_unbound_5.ys ├── parameters_across_files.ys ├── past_signedness.ys ├── port_int_types.sv ├── port_int_types.ys ├── prefix.sv ├── prefix.ys ├── priority_if_enc.ys ├── roundtrip_proc.ys ├── run-test.sh ├── sbvector.ys ├── sign_array_query.ys ├── size_cast.sv ├── size_cast.ys ├── struct_access.sv ├── struct_access.ys ├── task_attr.ys ├── typedef_across_files.ys ├── typedef_const_shadow.sv ├── typedef_const_shadow.ys ├── typedef_legacy_conflict.ys ├── unbased_unsized.sv ├── unbased_unsized.ys ├── unbased_unsized_shift.sv ├── unbased_unsized_shift.ys ├── unbased_unsized_tern.sv ├── unbased_unsized_tern.ys ├── unique0_if_enc.ys ├── unique_if.ys ├── unique_if_else.ys ├── unique_if_else_begin.ys ├── unique_if_enc.ys ├── unmatched_else.ys ├── unmatched_elsif.ys ├── unmatched_endif.ys ├── unmatched_endif_2.ys ├── unnamed_block.ys ├── unnamed_genblk.sv ├── unnamed_genblk.ys ├── unreachable_case_sign.ys ├── upto.ys ├── void_func.ys ├── wire_and_var.sv └── wire_and_var.ys ├── vloghtb ├── .gitignore ├── common.sh ├── run-test.sh ├── test_febe.sh ├── test_makefile ├── test_mapopt.sh └── test_share.sh └── xprop ├── .gitignore ├── generate.py ├── run-test.sh └── test.py /.clang-format: -------------------------------------------------------------------------------- 1 | # Default Linux style 2 | BasedOnStyle: LLVM 3 | IndentWidth: 8 4 | UseTab: Always 5 | BreakBeforeBraces: Linux 6 | AllowShortIfStatementsOnASingleLine: false 7 | IndentCaseLabels: false 8 | 9 | # From guidelines/CodingStyle 10 | TabWidth: 8 11 | ContinuationIndentWidth: 2 12 | ColumnLimit: 150 13 | # BreakBeforeBraces: Linux 14 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .editorconfig 2 | .gitignore 3 | .gitmodules 4 | .github 5 | .git 6 | Dockerfile 7 | README.md 8 | manual 9 | guidelines 10 | CodeOfConduct 11 | .travis 12 | .travis.yml 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | indent_size = tab 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | [abc/**] 10 | indent_style = space 11 | indent_size = 2 12 | trim_trailing_whitespace = false 13 | 14 | [*.yml] 15 | indent_style = space 16 | indent_size = 2 17 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.v linguist-language=Verilog 2 | /.gitcommit export-subst 3 | -------------------------------------------------------------------------------- /.gitcommit: -------------------------------------------------------------------------------- 1 | c21cd300a07d3b00cb12eccc0fa3f66c31c89bf0 2 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | _What are the reasons/motivation for this change?_ 2 | 3 | _Explain how this is achieved._ 4 | 5 | _If applicable, please suggest to reviewers how they can test the change._ 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "abc"] 2 | path = abc 3 | url = https://github.com/YosysHQ/abc 4 | # Don't use paths as names to avoid git archive problems 5 | [submodule "cxxopts"] 6 | path = libs/cxxopts 7 | url = https://github.com/jarro2783/cxxopts 8 | -------------------------------------------------------------------------------- /Brewfile: -------------------------------------------------------------------------------- 1 | brew "bison" 2 | brew "flex" 3 | brew "gawk" 4 | brew "libffi" 5 | brew "git" 6 | brew "graphviz" 7 | brew "pkg-config" 8 | brew "python3" 9 | brew "tcl-tk" 10 | brew "xdot" 11 | brew "bash" 12 | brew "boost-python3" 13 | brew "llvm" 14 | brew "lld" 15 | -------------------------------------------------------------------------------- /backends/aiger/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/aiger/aiger.o 3 | OBJS += backends/aiger/xaiger.o 4 | 5 | -------------------------------------------------------------------------------- /backends/aiger2/Makefile.inc: -------------------------------------------------------------------------------- 1 | OBJS += backends/aiger2/aiger.o 2 | -------------------------------------------------------------------------------- /backends/blif/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/blif/blif.o 3 | 4 | -------------------------------------------------------------------------------- /backends/btor/.gitignore: -------------------------------------------------------------------------------- 1 | /test_cells.tmp/ 2 | -------------------------------------------------------------------------------- /backends/btor/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/btor/btor.o 3 | 4 | -------------------------------------------------------------------------------- /backends/edif/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/edif/edif.o 3 | 4 | -------------------------------------------------------------------------------- /backends/firrtl/.gitignore: -------------------------------------------------------------------------------- 1 | test.fir 2 | test_out.v 3 | -------------------------------------------------------------------------------- /backends/firrtl/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/firrtl/firrtl.o 3 | 4 | -------------------------------------------------------------------------------- /backends/functional/Makefile.inc: -------------------------------------------------------------------------------- 1 | OBJS += backends/functional/cxx.o 2 | OBJS += backends/functional/smtlib.o 3 | OBJS += backends/functional/smtlib_rosette.o 4 | OBJS += backends/functional/test_generic.o 5 | -------------------------------------------------------------------------------- /backends/intersynth/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/intersynth/intersynth.o 3 | 4 | -------------------------------------------------------------------------------- /backends/jny/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/jny/jny.o 3 | -------------------------------------------------------------------------------- /backends/json/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/json/json.o 3 | 4 | -------------------------------------------------------------------------------- /backends/rtlil/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/rtlil/rtlil_backend.o 3 | 4 | -------------------------------------------------------------------------------- /backends/simplec/.gitignore: -------------------------------------------------------------------------------- 1 | test00_tb 2 | test00_uut.c 3 | -------------------------------------------------------------------------------- /backends/simplec/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/simplec/simplec.o 3 | 4 | -------------------------------------------------------------------------------- /backends/simplec/test00.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | ../../yosys -p 'synth -top test; write_simplec -verbose -i8 test00_uut.c' test00_uut.v 4 | clang -o test00_tb test00_tb.c 5 | ./test00_tb 6 | -------------------------------------------------------------------------------- /backends/smt2/.gitignore: -------------------------------------------------------------------------------- 1 | test_cells 2 | -------------------------------------------------------------------------------- /backends/smt2/example.v: -------------------------------------------------------------------------------- 1 | module main(input clk); 2 | reg [3:0] counter = 0; 3 | always @(posedge clk) begin 4 | if (counter == 10) 5 | counter <= 0; 6 | else 7 | counter <= counter + 1; 8 | end 9 | assert property (counter != 15); 10 | // assert property (counter <= 10); 11 | endmodule 12 | -------------------------------------------------------------------------------- /backends/smt2/example.ys: -------------------------------------------------------------------------------- 1 | read_verilog -formal example.v 2 | hierarchy; proc; opt; memory -nordff -nomap; opt -fast 3 | write_smt2 -bv -mem -wires example.smt2 4 | -------------------------------------------------------------------------------- /backends/smv/.gitignore: -------------------------------------------------------------------------------- 1 | /test_cells.tmp/ 2 | -------------------------------------------------------------------------------- /backends/smv/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/smv/smv.o 3 | 4 | -------------------------------------------------------------------------------- /backends/spice/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/spice/spice.o 3 | 4 | -------------------------------------------------------------------------------- /backends/table/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/table/table.o 3 | 4 | -------------------------------------------------------------------------------- /backends/verilog/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += backends/verilog/verilog_backend.o 3 | 4 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /source/cmd 3 | /source/generated 4 | /source/_images/**/*.log 5 | /source/_images/**/*.aux 6 | /source/_images/**/*.pdf 7 | /source/_images/**/*.svg 8 | /source/_images/**/*.dot 9 | /source/_images/code_examples 10 | -------------------------------------------------------------------------------- /docs/source/_downloads/APPNOTE_010_Verilog_to_BLIF.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/yosys/c21cd300a07d3b00cb12eccc0fa3f66c31c89bf0/docs/source/_downloads/APPNOTE_010_Verilog_to_BLIF.pdf -------------------------------------------------------------------------------- /docs/source/_downloads/APPNOTE_012_Verilog_to_BTOR.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/yosys/c21cd300a07d3b00cb12eccc0fa3f66c31c89bf0/docs/source/_downloads/APPNOTE_012_Verilog_to_BTOR.pdf -------------------------------------------------------------------------------- /docs/source/_static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/yosys/c21cd300a07d3b00cb12eccc0fa3f66c31c89bf0/docs/source/_static/logo.png -------------------------------------------------------------------------------- /docs/source/bib.rst: -------------------------------------------------------------------------------- 1 | .. only:: html 2 | 3 | Literature references 4 | ===================== 5 | 6 | .. rubric:: Bibliography 7 | 8 | .. bibliography:: literature.bib 9 | 10 | .. todo:: see if we can get the two hanging appnotes as lit references 11 | -------------------------------------------------------------------------------- /docs/source/cell/gate_other.rst: -------------------------------------------------------------------------------- 1 | Other gate-level cells 2 | ---------------------- 3 | 4 | .. autocellgroup:: gate_other 5 | :caption: Other gate-level cells 6 | :members: 7 | :source: 8 | :linenos: 9 | -------------------------------------------------------------------------------- /docs/source/cell/word_fsm.rst: -------------------------------------------------------------------------------- 1 | Finite state machines 2 | --------------------- 3 | 4 | .. todo:: Describe `$fsm` cell 5 | 6 | .. autocellgroup:: fsm 7 | :members: 8 | :source: 9 | :linenos: 10 | -------------------------------------------------------------------------------- /docs/source/cell/word_spec.rst: -------------------------------------------------------------------------------- 1 | Specify rules 2 | ------------- 3 | 4 | .. todo:: `$specify2`, `$specify3`, and `$specrule` cells. 5 | 6 | .. autocellgroup:: spec 7 | :members: 8 | :source: 9 | :linenos: 10 | -------------------------------------------------------------------------------- /docs/source/cell/word_wire.rst: -------------------------------------------------------------------------------- 1 | Wire cells 2 | ------------------------- 3 | 4 | .. todo:: Add information about `$slice` and `$concat` cells. 5 | 6 | .. autocellgroup:: wire 7 | :members: 8 | :source: 9 | :linenos: 10 | -------------------------------------------------------------------------------- /docs/source/code_examples/.gitignore: -------------------------------------------------------------------------------- 1 | *.dot 2 | *.pdf 3 | *.out 4 | *.log 5 | *.stat 6 | -------------------------------------------------------------------------------- /docs/source/code_examples/axis/axis_test.ys: -------------------------------------------------------------------------------- 1 | read_verilog -sv axis_master.v axis_test.v 2 | hierarchy -top axis_test 3 | 4 | proc; flatten;; 5 | sat -seq 50 -prove-asserts 6 | -------------------------------------------------------------------------------- /docs/source/code_examples/extensions/.gitignore: -------------------------------------------------------------------------------- 1 | my_cmd.so 2 | my_cmd.d 3 | *.log 4 | -------------------------------------------------------------------------------- /docs/source/code_examples/extensions/absval_ref.v: -------------------------------------------------------------------------------- 1 | module absval_ref(input signed [3:0] a, output [3:0] y); 2 | assign y = a[3] ? -a : a; 3 | endmodule 4 | -------------------------------------------------------------------------------- /docs/source/code_examples/extensions/sigmap_test.v: -------------------------------------------------------------------------------- 1 | module test(input a, output x, y); 2 | assign x = a, y = a; 3 | endmodule 4 | -------------------------------------------------------------------------------- /docs/source/code_examples/fifo/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.stat 3 | -------------------------------------------------------------------------------- /docs/source/code_examples/intro/.gitignore: -------------------------------------------------------------------------------- 1 | synth.v 2 | -------------------------------------------------------------------------------- /docs/source/code_examples/intro/counter.v: -------------------------------------------------------------------------------- 1 | module counter (clk, rst, en, count); 2 | 3 | input clk, rst, en; 4 | output reg [1:0] count; 5 | 6 | always @(posedge clk) 7 | if (rst) 8 | count <= 2'd0; 9 | else if (en) 10 | count <= count + 2'd1; 11 | 12 | endmodule 13 | -------------------------------------------------------------------------------- /docs/source/code_examples/macc/macc_simple_test.v: -------------------------------------------------------------------------------- 1 | module test(a, b, c, d, y); 2 | input [15:0] a, b; 3 | input [31:0] c, d; 4 | output [31:0] y; 5 | assign y = a * b + c + d; 6 | endmodule 7 | -------------------------------------------------------------------------------- /docs/source/code_examples/macc/macc_simple_test_01.v: -------------------------------------------------------------------------------- 1 | module test(a, b, c, d, x, y); 2 | input [15:0] a, b, c, d; 3 | input [31:0] x; 4 | output [31:0] y; 5 | assign y = a*b + c*d + x; 6 | endmodule 7 | -------------------------------------------------------------------------------- /docs/source/code_examples/macc/macc_simple_test_02.v: -------------------------------------------------------------------------------- 1 | module test(a, b, c, d, x, y); 2 | input [15:0] a, b, c, d; 3 | input [31:0] x; 4 | output [31:0] y; 5 | assign y = a*b + (c*d + x); 6 | endmodule 7 | -------------------------------------------------------------------------------- /docs/source/code_examples/macc/macc_simple_xmap.v: -------------------------------------------------------------------------------- 1 | module macc_16_16_32(a, b, c, y); 2 | input [15:0] a, b; 3 | input [31:0] c; 4 | output [31:0] y; 5 | assign y = a*b + c; 6 | endmodule 7 | -------------------------------------------------------------------------------- /docs/source/code_examples/macc/macc_xilinx_xmap.v: -------------------------------------------------------------------------------- 1 | module DSP48_MACC (a, b, c, y); 2 | 3 | input [17:0] a; 4 | input [24:0] b; 5 | input [47:0] c; 6 | output [47:0] y; 7 | 8 | assign y = a*b + c; 9 | 10 | endmodule 11 | -------------------------------------------------------------------------------- /docs/source/code_examples/opt/opt_expr.ys: -------------------------------------------------------------------------------- 1 | read_verilog <> 4); 7 | 8 | endmodule 9 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/memory_01.v: -------------------------------------------------------------------------------- 1 | module test(input CLK, ADDR, 2 | input [7:0] DIN, 3 | output reg [7:0] DOUT); 4 | reg [7:0] mem [0:1]; 5 | always @(posedge CLK) begin 6 | mem[ADDR] <= DIN; 7 | DOUT <= mem[ADDR]; 8 | end 9 | endmodule 10 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/memory_01.ys: -------------------------------------------------------------------------------- 1 | read_verilog memory_01.v 2 | hierarchy -check -top test 3 | proc;; memory; opt 4 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/memory_02.ys: -------------------------------------------------------------------------------- 1 | read_verilog memory_02.v 2 | hierarchy -check -top test 3 | proc;; memory -nomap 4 | opt -mux_undef -mux_bool 5 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/proc_01.v: -------------------------------------------------------------------------------- 1 | module test(input D, C, R, output reg Q); 2 | always @(posedge C, posedge R) 3 | if (R) 4 | Q <= 0; 5 | else 6 | Q <= D; 7 | endmodule 8 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/proc_01.ys: -------------------------------------------------------------------------------- 1 | read_verilog proc_01.v 2 | hierarchy -check -top test 3 | proc;; 4 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/proc_02.v: -------------------------------------------------------------------------------- 1 | module test(input D, C, R, RV, 2 | output reg Q); 3 | always @(posedge C, posedge R) 4 | if (R) 5 | Q <= RV; 6 | else 7 | Q <= D; 8 | endmodule 9 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/proc_02.ys: -------------------------------------------------------------------------------- 1 | read_verilog proc_02.v 2 | hierarchy -check -top test 3 | proc;; 4 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/proc_03.v: -------------------------------------------------------------------------------- 1 | module test(input A, B, C, D, E, 2 | output reg Y); 3 | always @* begin 4 | Y <= A; 5 | if (B) 6 | Y <= C; 7 | if (D) 8 | Y <= E; 9 | end 10 | endmodule 11 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/proc_03.ys: -------------------------------------------------------------------------------- 1 | read_verilog proc_03.v 2 | hierarchy -check -top test 3 | proc;; 4 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/techmap_01.v: -------------------------------------------------------------------------------- 1 | module test(input [31:0] a, b, 2 | output [31:0] y); 3 | assign y = a + b; 4 | endmodule 5 | -------------------------------------------------------------------------------- /docs/source/code_examples/synth_flow/techmap_01.ys: -------------------------------------------------------------------------------- 1 | read_verilog techmap_01.v 2 | hierarchy -check -top test 3 | techmap -map techmap_01_map.v;; 4 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/addshift_test.v: -------------------------------------------------------------------------------- 1 | module test (A, B, X, Y); 2 | input [7:0] A, B; 3 | output [7:0] X = A + B; 4 | output [7:0] Y = A + A; 5 | endmodule 6 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/addshift_test.ys: -------------------------------------------------------------------------------- 1 | read_verilog addshift_test.v 2 | hierarchy -check -top test 3 | 4 | techmap -map addshift_map.v;; 5 | 6 | show -prefix addshift -format dot -notitle 7 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/mulshift_test.v: -------------------------------------------------------------------------------- 1 | module test (A, X, Y); 2 | input [7:0] A; 3 | output [7:0] X = A * 8'd 6; 4 | output [7:0] Y = A * 8'd 8; 5 | endmodule 6 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/mulshift_test.ys: -------------------------------------------------------------------------------- 1 | read_verilog mulshift_test.v 2 | hierarchy -check -top test 3 | 4 | techmap -map sym_mul_map.v \ 5 | -map mulshift_map.v;; 6 | 7 | show -prefix mulshift -format dot -notitle -lib sym_mul_cells.v 8 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/mymul_test.v: -------------------------------------------------------------------------------- 1 | module test(A, B, Y); 2 | input [1:0] A, B; 3 | output [1:0] Y = A * B; 4 | endmodule 5 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/red_or3x1_cells.v: -------------------------------------------------------------------------------- 1 | module OR3X1(A, B, C, Y); 2 | input A, B, C; 3 | output Y; 4 | assign Y = A | B | C; 5 | endmodule 6 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/red_or3x1_test.v: -------------------------------------------------------------------------------- 1 | module test (A, Y); 2 | input [6:0] A; 3 | output Y; 4 | assign Y = |A; 5 | endmodule 6 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/red_or3x1_test.ys: -------------------------------------------------------------------------------- 1 | read_verilog red_or3x1_test.v 2 | hierarchy -check -top test 3 | 4 | techmap -map red_or3x1_map.v;; 5 | 6 | splitnets -ports 7 | show -prefix red_or3x1 -format dot -notitle -lib red_or3x1_cells.v 8 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/sym_mul_cells.v: -------------------------------------------------------------------------------- 1 | module MYMUL(A, B, Y); 2 | parameter WIDTH = 1; 3 | input [WIDTH-1:0] A, B; 4 | output [WIDTH-1:0] Y; 5 | assign Y = A * B; 6 | endmodule 7 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/sym_mul_test.v: -------------------------------------------------------------------------------- 1 | module test(A, B, C, Y1, Y2); 2 | input [7:0] A, B, C; 3 | output [7:0] Y1 = A * B; 4 | output [15:0] Y2 = A * C; 5 | endmodule 6 | -------------------------------------------------------------------------------- /docs/source/code_examples/techmap/sym_mul_test.ys: -------------------------------------------------------------------------------- 1 | read_verilog sym_mul_test.v 2 | hierarchy -check -top test 3 | 4 | techmap -map sym_mul_map.v;; 5 | 6 | show -prefix sym_mul -format dot -notitle -lib sym_mul_cells.v 7 | -------------------------------------------------------------------------------- /docs/source/requirements.txt: -------------------------------------------------------------------------------- 1 | furo-ys @ git+https://github.com/YosysHQ/furo-ys 2 | sphinxcontrib-bibtex 3 | rtds-action 4 | -------------------------------------------------------------------------------- /docs/util/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/yosys/c21cd300a07d3b00cb12eccc0fa3f66c31c89bf0/docs/util/__init__.py -------------------------------------------------------------------------------- /examples/aiger/.gitignore: -------------------------------------------------------------------------------- 1 | demo.aig 2 | demo.aim 3 | demo.aiw 4 | demo.smt2 5 | demo.vcd 6 | -------------------------------------------------------------------------------- /examples/anlogic/.gitignore: -------------------------------------------------------------------------------- 1 | demo.bit 2 | demo_phy.area 3 | full.v 4 | *.log 5 | *.h 6 | *.tde 7 | *.svf 8 | -------------------------------------------------------------------------------- /examples/anlogic/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | yosys demo.ys 4 | $TD_HOME/bin/td build.tcl 5 | -------------------------------------------------------------------------------- /examples/anlogic/build.tcl: -------------------------------------------------------------------------------- 1 | import_device eagle_s20.db -package BG256 2 | read_verilog full.v -top demo 3 | read_adc demo.adc 4 | optimize_rtl 5 | map_macro 6 | map 7 | pack 8 | place 9 | route 10 | report_area -io_info -file demo_phy.area 11 | bitgen -bit demo.bit -version 0X0000 -svf demo.svf -svf_comment_on -g ucode:00000000000000000000000000000000 12 | -------------------------------------------------------------------------------- /examples/anlogic/demo.adc: -------------------------------------------------------------------------------- 1 | set_pin_assignment {CLK_IN} { LOCATION = K14; } ##24MHZ 2 | set_pin_assignment {R_LED} { LOCATION = R3; } ##R_LED 3 | -------------------------------------------------------------------------------- /examples/anlogic/demo.ys: -------------------------------------------------------------------------------- 1 | read_verilog demo.v 2 | synth_anlogic -top demo 3 | write_verilog full.v 4 | -------------------------------------------------------------------------------- /examples/basys3/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | yosys run_yosys.ys 3 | vivado -nolog -nojournal -mode batch -source run_vivado.tcl 4 | vivado -nolog -nojournal -mode batch -source run_prog.tcl 5 | -------------------------------------------------------------------------------- /examples/basys3/run_prog.tcl: -------------------------------------------------------------------------------- 1 | open_hw 2 | connect_hw_server 3 | open_hw_target [lindex [get_hw_targets] 0] 4 | set_property PROGRAM.FILE example.bit [lindex [get_hw_devices] 0] 5 | program_hw_devices [lindex [get_hw_devices] 0] 6 | -------------------------------------------------------------------------------- /examples/basys3/run_vivado.tcl: -------------------------------------------------------------------------------- 1 | read_xdc example.xdc 2 | read_edif example.edif 3 | link_design -part xc7a35tcpg236-1 -top example 4 | opt_design 5 | place_design 6 | route_design 7 | report_utilization 8 | report_timing 9 | write_bitstream -force example.bit 10 | -------------------------------------------------------------------------------- /examples/basys3/run_yosys.ys: -------------------------------------------------------------------------------- 1 | read_verilog example.v 2 | synth_xilinx -edif example.edif -top example 3 | -------------------------------------------------------------------------------- /examples/cmos/.gitignore: -------------------------------------------------------------------------------- 1 | counter_tb 2 | counter_tb.vcd 3 | synth.sp 4 | synth.v 5 | -------------------------------------------------------------------------------- /examples/cmos/counter.v: -------------------------------------------------------------------------------- 1 | module counter (clk, rst, en, count); 2 | 3 | input clk, rst, en; 4 | output reg [2:0] count; 5 | 6 | always @(posedge clk) 7 | if (rst) 8 | count <= 3'd0; 9 | else if (en) 10 | count <= count + 3'd1; 11 | 12 | endmodule 13 | -------------------------------------------------------------------------------- /examples/cmos/counter_tb.gtkw: -------------------------------------------------------------------------------- 1 | [dumpfile] "counter_tb.vcd" 2 | counter_tb.clk 3 | counter_tb.count[2:0] 4 | counter_tb.en 5 | counter_tb.reset 6 | -------------------------------------------------------------------------------- /examples/cmos/testbench.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | ../../yosys counter.ys 6 | ngspice testbench.sp 7 | 8 | -------------------------------------------------------------------------------- /examples/gowin/.gitignore: -------------------------------------------------------------------------------- 1 | demo.bit 2 | demo.out 3 | demo.rpt 4 | demo_syn.v 5 | demo_out.v 6 | demo_tr.html 7 | testbench 8 | testbench.vcd 9 | -------------------------------------------------------------------------------- /examples/gowin/demo.cst: -------------------------------------------------------------------------------- 1 | IO_LOC "clk" 35; 2 | //IO_LOC "rst_n" 77; 3 | IO_LOC "leds[0]" 79; 4 | IO_LOC "leds[1]" 80; 5 | IO_LOC "leds[2]" 81; 6 | IO_LOC "leds[3]" 82; 7 | IO_LOC "leds[4]" 83; 8 | IO_LOC "leds[5]" 84; 9 | IO_LOC "leds[6]" 85; 10 | IO_LOC "leds[7]" 86; -------------------------------------------------------------------------------- /examples/gowin/demo.sdc: -------------------------------------------------------------------------------- 1 | create_clock -name clk -period 20 -waveform {0 10} [get_ports {clk}] 2 | -------------------------------------------------------------------------------- /examples/gowin/demo.v: -------------------------------------------------------------------------------- 1 | module demo ( 2 | input clk, 3 | output [15:0] leds, 4 | output unused 5 | ); 6 | localparam PRESCALE = 20; 7 | reg [PRESCALE+3:0] counter = 0; 8 | always @(posedge clk) counter <= counter + 1; 9 | assign leds = 1 << counter[PRESCALE +: 4]; 10 | endmodule 11 | -------------------------------------------------------------------------------- /examples/gowin/pnr.cfg: -------------------------------------------------------------------------------- 1 | -sdf 2 | -oc 3 | -ibs 4 | -posp 5 | -o 6 | -warning_all 7 | -tt 8 | -timing 9 | -------------------------------------------------------------------------------- /examples/gowin/run.tcl: -------------------------------------------------------------------------------- 1 | # gw_sh run.tcl 2 | exec yosys -p "synth_gowin -top demo -vout demo_syn.v" demo.v 3 | add_file -cst demo.cst 4 | add_file -sdc demo.sdc 5 | add_file -vm demo_syn.v 6 | add_file -cfg device.cfg 7 | set_option -device GW1NR-9-QFN88-6 8 | set_option -pn GW1NR-LV9QN88C6/I5 9 | run_pnr -opt pnr.cfg 10 | -------------------------------------------------------------------------------- /examples/igloo2/.gitignore: -------------------------------------------------------------------------------- 1 | /netlist.edn 2 | /netlist.vm 3 | /example.stp 4 | /proj 5 | -------------------------------------------------------------------------------- /examples/igloo2/example.sdc: -------------------------------------------------------------------------------- 1 | # Add timing constraints here 2 | create_clock -period 10.000 -waveform {0.000 5.000} [get_ports {clk}] 3 | -------------------------------------------------------------------------------- /examples/igloo2/runme.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ex 3 | yosys -p 'synth_sf2 -top example -edif netlist.edn -vlog netlist.vm' example.v 4 | export LM_LICENSE_FILE=${LM_LICENSE_FILE:-1702@localhost} 5 | /opt/microsemi/Libero_SoC_v12.0/Libero/bin/libero SCRIPT:libero.tcl 6 | cp proj/designer/example/export/example.stp . 7 | -------------------------------------------------------------------------------- /examples/intel/DE2i-150/quartus_compile/de2i.qpf: -------------------------------------------------------------------------------- 1 | QUARTUS_VERSION = "16.1" 2 | # Revisions 3 | 4 | PROJECT_REVISION = "de2i" 5 | -------------------------------------------------------------------------------- /examples/intel/DE2i-150/quartus_compile/runme_quartus: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export REV="de2i" 4 | 5 | quartus_map -c $REV top && \ 6 | quartus_fit -c $REV top && \ 7 | quartus_asm -c $REV top 8 | -------------------------------------------------------------------------------- /examples/intel/DE2i-150/run_cycloneiv: -------------------------------------------------------------------------------- 1 | #/bin/env bash 2 | yosys -p "synth_intel -family cycloneiv -top top -vqm top.vqm" top.v sevenseg.v 3 | -------------------------------------------------------------------------------- /examples/intel/MAX10/run_max10: -------------------------------------------------------------------------------- 1 | yosys -p "synth_intel -family max10 -top top -vqm top.vqm" top.v sevenseg.v 2 | -------------------------------------------------------------------------------- /examples/intel/MAX10/runme_postsynth: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | iverilog -D POST_IMPL -o verif_post -s tb_top tb_top.v top.vqm $(yosys-config --datdir/altera_intel/max10/cells_comb_max10.v) 4 | vvp -N verif_post 5 | 6 | -------------------------------------------------------------------------------- /examples/intel/asicworld_lfsr/README: -------------------------------------------------------------------------------- 1 | Source of the files: 2 | http://www.asic-world.com/examples/verilog/lfsr.html 3 | 4 | Run first: runme_presynth 5 | Generate output netlist with run_max10 or run_cycloneiv 6 | Then, check with: runme_postsynth 7 | -------------------------------------------------------------------------------- /examples/intel/asicworld_lfsr/run_cycloneiv: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | yosys -p "synth_intel -family cycloneiv -top lfsr_updown -vqm top.vqm" lfsr_updown.v 3 | -------------------------------------------------------------------------------- /examples/intel/asicworld_lfsr/run_max10: -------------------------------------------------------------------------------- 1 | #!/bin/env bash 2 | yosys -p "synth_intel -family max10 -top lfsr_updown -vqm top.vqm" lfsr_updown.v 3 | -------------------------------------------------------------------------------- /examples/intel/asicworld_lfsr/runme_postsynth: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | iverilog -D POST_IMPL -o verif_post -s tb lfsr_updown_tb.v top.vqm $(yosys-config --datdir/altera_intel/max10/cells_comb_max10.v) 4 | vvp -N verif_post 5 | 6 | -------------------------------------------------------------------------------- /examples/intel/asicworld_lfsr/runme_presynth: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | iverilog -o presynth lfsr_updown_tb.v lfsr_updown.v &&\ 4 | 5 | vvp -N presynth -------------------------------------------------------------------------------- /examples/mimas2/README: -------------------------------------------------------------------------------- 1 | A simple example design, based on the Numato Labs Mimas V2 board 2 | ================================================================ 3 | 4 | This example uses Yosys for synthesis and Xilinx ISE 5 | for place&route and bit-stream creation. 6 | 7 | To synthesize: 8 | bash run.sh 9 | -------------------------------------------------------------------------------- /examples/mimas2/example.v: -------------------------------------------------------------------------------- 1 | module example( 2 | input wire CLK, 3 | output wire [7:0] LED 4 | ); 5 | 6 | reg [27:0] ctr; 7 | initial ctr = 0; 8 | 9 | always @(posedge CLK) 10 | ctr <= ctr + 1; 11 | 12 | assign LED = ctr[27:20]; 13 | 14 | endmodule 15 | -------------------------------------------------------------------------------- /examples/mimas2/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | yosys run_yosys.ys 4 | edif2ngd example.edif 5 | ngdbuild example -uc example.ucf -p xc6slx9csg324-3 6 | map -w example 7 | par -w example.ncd example_par.ncd 8 | bitgen -w example_par.ncd -g StartupClk:JTAGClk 9 | -------------------------------------------------------------------------------- /examples/mimas2/run_yosys.ys: -------------------------------------------------------------------------------- 1 | read_verilog example.v 2 | synth_xilinx -top example -family xc6s -ise 3 | write_edif -pvector bra example.edif 4 | -------------------------------------------------------------------------------- /examples/osu035/.gitignore: -------------------------------------------------------------------------------- 1 | osu035_stdcells.lib 2 | example.yslog 3 | example.edif 4 | -------------------------------------------------------------------------------- /examples/osu035/example.constr: -------------------------------------------------------------------------------- 1 | set_driving_cell INVX1 2 | set_load 0.015 3 | -------------------------------------------------------------------------------- /examples/osu035/example.v: -------------------------------------------------------------------------------- 1 | module top (input clk, input [7:0] a, b, output reg [15:0] c); 2 | always @(posedge clk) c <= a * b; 3 | endmodule 4 | -------------------------------------------------------------------------------- /examples/osu035/example.ys: -------------------------------------------------------------------------------- 1 | read_verilog example.v 2 | read_liberty -lib osu035_stdcells.lib 3 | 4 | synth -top top 5 | 6 | dfflibmap -liberty osu035_stdcells.lib 7 | abc -D 10000 -constr example.constr -liberty osu035_stdcells.lib 8 | opt_clean 9 | 10 | stat -liberty osu035_stdcells.lib 11 | write_edif example.edif 12 | -------------------------------------------------------------------------------- /examples/python-api/.gitignore: -------------------------------------------------------------------------------- 1 | out/** 2 | -------------------------------------------------------------------------------- /examples/smtbmc/demo3.smtc: -------------------------------------------------------------------------------- 1 | initial 2 | assume [rst] 3 | 4 | always -1 5 | assert (= [-1:mem] [mem]) 6 | -------------------------------------------------------------------------------- /examples/smtbmc/demo4.smtc: -------------------------------------------------------------------------------- 1 | initial 2 | assume [rst] 3 | 4 | always -1 5 | assume (not [rst]) 6 | assume (=> [-1:inv2] [inv2]) 7 | 8 | final -2 9 | assume [-1:inv2] 10 | assume (not [-2:inv2]) 11 | assert (= [r1] [r2]) 12 | -------------------------------------------------------------------------------- /examples/smtbmc/demo6.v: -------------------------------------------------------------------------------- 1 | // Demo for assertpmux 2 | 3 | module demo6 (input A, B, C, D, E, output reg Y); 4 | always @* begin 5 | Y = 0; 6 | if (A != B) begin 7 | (* parallel_case *) 8 | case (C) 9 | A: Y = D; 10 | B: Y = E; 11 | endcase 12 | end 13 | end 14 | endmodule 15 | -------------------------------------------------------------------------------- /examples/smtbmc/demo8.v: -------------------------------------------------------------------------------- 1 | // Simple exists-forall demo 2 | 3 | module demo8; 4 | wire [7:0] prime = $anyconst; 5 | wire [3:0] factor = $allconst; 6 | 7 | always @* begin 8 | if (1 < factor && factor < prime) 9 | assume((prime % factor) != 0); 10 | assume(prime > 1); 11 | end 12 | endmodule 13 | -------------------------------------------------------------------------------- /examples/smtbmc/demo9.v: -------------------------------------------------------------------------------- 1 | module demo9; 2 | (* maximize *) wire[7:0] h = $anyconst; 3 | wire [7:0] i = $allconst; 4 | 5 | wire [7:0] t0 = ((i << 8'b00000010) + 8'b00000011); 6 | wire trigger = (t0 > h) && (h < 8'b00000100); 7 | 8 | always @* begin 9 | assume(trigger == 1'b1); 10 | cover(1); 11 | end 12 | endmodule 13 | 14 | -------------------------------------------------------------------------------- /frontends/aiger/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += frontends/aiger/aigerparse.o 3 | 4 | -------------------------------------------------------------------------------- /frontends/aiger2/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += frontends/aiger2/xaiger.o 3 | -------------------------------------------------------------------------------- /frontends/ast/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += frontends/ast/ast.o 3 | OBJS += frontends/ast/simplify.o 4 | OBJS += frontends/ast/genrtlil.o 5 | OBJS += frontends/ast/dpicall.o 6 | OBJS += frontends/ast/ast_binding.o 7 | 8 | -------------------------------------------------------------------------------- /frontends/blif/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += frontends/blif/blifparse.o 3 | 4 | -------------------------------------------------------------------------------- /frontends/json/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += frontends/json/jsonparse.o 3 | 4 | -------------------------------------------------------------------------------- /frontends/liberty/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += frontends/liberty/liberty.o 3 | 4 | -------------------------------------------------------------------------------- /frontends/rpc/Makefile.inc: -------------------------------------------------------------------------------- 1 | ifeq ($(DISABLE_SPAWN),0) 2 | OBJS += frontends/rpc/rpc_frontend.o 3 | endif 4 | -------------------------------------------------------------------------------- /frontends/rtlil/.gitignore: -------------------------------------------------------------------------------- 1 | rtlil_lexer.cc 2 | rtlil_parser.output 3 | rtlil_parser.tab.cc 4 | rtlil_parser.tab.hh 5 | -------------------------------------------------------------------------------- /frontends/verific/example.sby: -------------------------------------------------------------------------------- 1 | # Simple SymbiYosys example job utilizing Verific 2 | 3 | [options] 4 | mode prove 5 | depth 10 6 | 7 | [engines] 8 | smtbmc yices 9 | 10 | [script] 11 | verific -sv example.sv 12 | verific -import top 13 | prep -top top 14 | 15 | [files] 16 | example.sv 17 | -------------------------------------------------------------------------------- /frontends/verilog/.gitignore: -------------------------------------------------------------------------------- 1 | verilog_lexer.cc 2 | verilog_parser.output 3 | verilog_parser.tab.cc 4 | verilog_parser.tab.hh 5 | -------------------------------------------------------------------------------- /libs/bigint/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | sample 3 | testsuite 4 | testsuite.expected 5 | testsuite.out 6 | testsuite.err 7 | -------------------------------------------------------------------------------- /libs/bigint/BigIntegerLibrary.hh: -------------------------------------------------------------------------------- 1 | // This header file includes all of the library header files. 2 | 3 | #include "NumberlikeArray.hh" 4 | #include "BigUnsigned.hh" 5 | #include "BigInteger.hh" 6 | #include "BigIntegerAlgorithms.hh" 7 | #include "BigUnsignedInABase.hh" 8 | #include "BigIntegerUtils.hh" 9 | -------------------------------------------------------------------------------- /libs/ezsat/.gitignore: -------------------------------------------------------------------------------- 1 | demo_bit 2 | demo_cmp 3 | demo_vec 4 | puzzle3d 5 | testbench 6 | -------------------------------------------------------------------------------- /libs/subcircuit/.gitignore: -------------------------------------------------------------------------------- 1 | demo 2 | scshell 3 | -------------------------------------------------------------------------------- /passes/fsm/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += passes/fsm/fsm.o 3 | OBJS += passes/fsm/fsm_detect.o 4 | OBJS += passes/fsm/fsm_extract.o 5 | OBJS += passes/fsm/fsm_opt.o 6 | OBJS += passes/fsm/fsm_expand.o 7 | OBJS += passes/fsm/fsm_recode.o 8 | OBJS += passes/fsm/fsm_info.o 9 | OBJS += passes/fsm/fsm_export.o 10 | OBJS += passes/fsm/fsm_map.o 11 | 12 | -------------------------------------------------------------------------------- /passes/hierarchy/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += passes/hierarchy/hierarchy.o 3 | OBJS += passes/hierarchy/uniquify.o 4 | OBJS += passes/hierarchy/submod.o 5 | OBJS += passes/hierarchy/keep_hierarchy.o 6 | 7 | -------------------------------------------------------------------------------- /passes/opt/.gitignore: -------------------------------------------------------------------------------- 1 | /peepopt*_pm.h -------------------------------------------------------------------------------- /passes/pmgen/.gitignore: -------------------------------------------------------------------------------- 1 | /*_pm.h 2 | -------------------------------------------------------------------------------- /passes/techmap/filterlib.cc: -------------------------------------------------------------------------------- 1 | 2 | #define FILTERLIB 3 | #include "libparse.cc" 4 | 5 | -------------------------------------------------------------------------------- /passes/tests/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += passes/tests/test_autotb.o 3 | OBJS += passes/tests/test_cell.o 4 | OBJS += passes/tests/test_abcloop.o 5 | 6 | -------------------------------------------------------------------------------- /passes/tests/flowmap/pack1.v: -------------------------------------------------------------------------------- 1 | // Exact reproduction of Figure 3(a) from 10.1109/92.285741. 2 | module top(...); 3 | input a,b,c,d,e,f,g,h; 4 | wire x = !(c|d); 5 | wire y = !(e&f); 6 | wire u = !(a&b); 7 | wire v = !(x|y); 8 | wire w = !(g&h); 9 | output s = !(u|v); 10 | output t = !(v|w); 11 | endmodule 12 | -------------------------------------------------------------------------------- /passes/tests/flowmap/pack1p.v: -------------------------------------------------------------------------------- 1 | // Like pack1.v, but results in a simpler network. 2 | module top(...); 3 | input a,b,c,d,e,f,g,h; 4 | wire x = c|d; 5 | wire y = e&f; 6 | wire u = a&b; 7 | wire v = x|y; 8 | wire w = g&h; 9 | output s = u|v; 10 | output t = v|w; 11 | endmodule 12 | -------------------------------------------------------------------------------- /techlibs/.gitignore: -------------------------------------------------------------------------------- 1 | blackbox.v 2 | *_pm.h 3 | -------------------------------------------------------------------------------- /techlibs/achronix/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += techlibs/achronix/synth_achronix.o 3 | 4 | $(eval $(call add_share_file,share/achronix/speedster22i/,techlibs/achronix/speedster22i/cells_sim.v)) 5 | $(eval $(call add_share_file,share/achronix/speedster22i/,techlibs/achronix/speedster22i/cells_map.v)) 6 | 7 | -------------------------------------------------------------------------------- /techlibs/anlogic/lutrams.txt: -------------------------------------------------------------------------------- 1 | ram distributed $__ANLOGIC_DRAM16X4_ { 2 | abits 4; 3 | width 4; 4 | cost 4; 5 | init no_undef; 6 | prune_rom; 7 | port sw "W" { 8 | clock posedge; 9 | } 10 | port ar "R" { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /techlibs/common/.gitignore: -------------------------------------------------------------------------------- 1 | simlib_help.inc 2 | simcells_help.inc 3 | -------------------------------------------------------------------------------- /techlibs/easic/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += techlibs/easic/synth_easic.o 3 | 4 | -------------------------------------------------------------------------------- /techlibs/ecp5/latches_map.v: -------------------------------------------------------------------------------- 1 | module \$_DLATCH_N_ (E, D, Q); 2 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 3 | input E, D; 4 | output Q = !E ? D : Q; 5 | endmodule 6 | 7 | module \$_DLATCH_P_ (E, D, Q); 8 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 9 | input E, D; 10 | output Q = E ? D : Q; 11 | endmodule 12 | -------------------------------------------------------------------------------- /techlibs/ecp5/lutrams.txt: -------------------------------------------------------------------------------- 1 | ram distributed $__TRELLIS_DPR16X4_ { 2 | abits 4; 3 | width 4; 4 | cost 4; 5 | init any; 6 | prune_rom; 7 | port sw "W" { 8 | clock anyedge; 9 | } 10 | port ar "R" { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /techlibs/ecp5/tests/.gitignore: -------------------------------------------------------------------------------- 1 | work_* 2 | -------------------------------------------------------------------------------- /techlibs/efinix/gbuf_map.v: -------------------------------------------------------------------------------- 1 | module \$__EFX_GBUF (input I, output O); 2 | EFX_GBUFCE #(.CE_POLARITY(1'b1)) _TECHMAP_REPLACE_ (.I(I), .O(O), .CE(1'b1)); 3 | endmodule 4 | -------------------------------------------------------------------------------- /techlibs/fabulous/io_map.v: -------------------------------------------------------------------------------- 1 | module \$__FABULOUS_IBUF (input PAD, output O); 2 | IO_1_bidirectional_frame_config_pass _TECHMAP_REPLACE_ (.PAD(PAD), .O(O), .T(1'b1)); 3 | endmodule 4 | 5 | module \$__FABULOUS_OBUF (output PAD, input I); 6 | IO_1_bidirectional_frame_config_pass _TECHMAP_REPLACE_ (.PAD(PAD), .I(I), .T(1'b0)); 7 | endmodule 8 | 9 | -------------------------------------------------------------------------------- /techlibs/fabulous/latches_map.v: -------------------------------------------------------------------------------- 1 | module \$_DLATCH_N_ (E, D, Q); 2 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 3 | input E, D; 4 | output Q = !E ? D : Q; 5 | endmodule 6 | 7 | module \$_DLATCH_P_ (E, D, Q); 8 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 9 | input E, D; 10 | output Q = E ? D : Q; 11 | endmodule 12 | -------------------------------------------------------------------------------- /techlibs/gatemate/.gitignore: -------------------------------------------------------------------------------- 1 | lut_tree_cells.genlib 2 | lut_tree_map.v 3 | lut_tree_lib.mk 4 | 5 | -------------------------------------------------------------------------------- /techlibs/gatemate/inv_map.v: -------------------------------------------------------------------------------- 1 | // Any inverters not folded into LUTs are mapped to a LUT of their own 2 | module \$__CC_NOT (input A, output Y); 3 | CC_LUT1 #(.INIT(2'b01)) _TECHMAP_REPLACE_ (.I0(A), .O(Y)); 4 | endmodule 5 | -------------------------------------------------------------------------------- /techlibs/gowin/lutrams.txt: -------------------------------------------------------------------------------- 1 | ram distributed $__GOWIN_LUTRAM_ { 2 | abits 4; 3 | width 4; 4 | cost 4; 5 | widthscale; 6 | init no_undef; 7 | prune_rom; 8 | port sw "W" { 9 | clock posedge; 10 | } 11 | port ar "R" { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /techlibs/greenpak4/cells_latch.v: -------------------------------------------------------------------------------- 1 | module $_DLATCH_P_(input E, input D, output Q); 2 | GP_DLATCH _TECHMAP_REPLACE_ ( 3 | .D(D), 4 | .nCLK(!E), 5 | .Q(Q) 6 | ); 7 | endmodule 8 | 9 | module $_DLATCH_N_(input E, input D, output Q); 10 | GP_DLATCH _TECHMAP_REPLACE_ ( 11 | .D(D), 12 | .nCLK(E), 13 | .Q(Q) 14 | ); 15 | endmodule 16 | -------------------------------------------------------------------------------- /techlibs/greenpak4/cells_sim.v: -------------------------------------------------------------------------------- 1 | `timescale 1ns/1ps 2 | 3 | `include "cells_sim_ams.v" 4 | `include "cells_sim_digital.v" 5 | `include "cells_sim_wip.v" 6 | -------------------------------------------------------------------------------- /techlibs/ice40/latches_map.v: -------------------------------------------------------------------------------- 1 | module \$_DLATCH_N_ (E, D, Q); 2 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 3 | input E, D; 4 | output Q = !E ? D : Q; 5 | endmodule 6 | 7 | module \$_DLATCH_P_ (E, D, Q); 8 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 9 | input E, D; 10 | output Q = E ? D : Q; 11 | endmodule 12 | -------------------------------------------------------------------------------- /techlibs/ice40/spram.txt: -------------------------------------------------------------------------------- 1 | ram huge $__ICE40_SPRAM_ { 2 | abits 14; 3 | width 16; 4 | cost 2048; 5 | byte 4; 6 | port srsw "A" { 7 | clock posedge; 8 | clken; 9 | wrbe_separate; 10 | rdwr no_change; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /techlibs/ice40/tests/.gitignore: -------------------------------------------------------------------------------- 1 | /test_ffs_[01][01][01][01][01]_* 2 | /test_bram_[0-9]* 3 | /test_dsp_model 4 | /test_dsp_model.vcd 5 | /test_dsp_model_ref.v 6 | /test_dsp_model_uut.v 7 | /test_dsp_map 8 | /test_dsp_map.vcd 9 | /test_dsp_map_tb.v 10 | /test_dsp_map_top.v 11 | /test_dsp_map_syn.v 12 | -------------------------------------------------------------------------------- /techlibs/ice40/tests/test_arith.v: -------------------------------------------------------------------------------- 1 | module test(input [4:0] a, b, c, output [4:0] y); 2 | assign y = ((a+b) ^ (a-c)) - ((a*b) + (a*c) - (b*c)); 3 | endmodule 4 | -------------------------------------------------------------------------------- /techlibs/lattice/cells_sim_ecp5.v: -------------------------------------------------------------------------------- 1 | `include "common_sim.vh" 2 | `include "ccu2c_sim.vh" 3 | 4 | `ifndef NO_INCLUDES 5 | 6 | `include "cells_ff.vh" 7 | `include "cells_io.vh" 8 | 9 | `endif 10 | -------------------------------------------------------------------------------- /techlibs/lattice/cells_sim_xo2.v: -------------------------------------------------------------------------------- 1 | `include "common_sim.vh" 2 | `include "ccu2d_sim.vh" 3 | 4 | `ifndef NO_INCLUDES 5 | 6 | `include "cells_ff.vh" 7 | `include "cells_io.vh" 8 | 9 | `endif 10 | -------------------------------------------------------------------------------- /techlibs/lattice/cells_sim_xo3.v: -------------------------------------------------------------------------------- 1 | `include "common_sim.vh" 2 | `include "ccu2d_sim.vh" 3 | 4 | `ifndef NO_INCLUDES 5 | 6 | `include "cells_ff.vh" 7 | `include "cells_io.vh" 8 | 9 | `endif 10 | -------------------------------------------------------------------------------- /techlibs/lattice/cells_sim_xo3d.v: -------------------------------------------------------------------------------- 1 | `include "common_sim.vh" 2 | `include "ccu2d_sim.vh" 3 | 4 | `ifndef NO_INCLUDES 5 | 6 | `include "cells_ff.vh" 7 | `include "cells_io.vh" 8 | 9 | `endif 10 | -------------------------------------------------------------------------------- /techlibs/lattice/latches_map.v: -------------------------------------------------------------------------------- 1 | module \$_DLATCH_N_ (E, D, Q); 2 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 3 | input E, D; 4 | output Q = !E ? D : Q; 5 | endmodule 6 | 7 | module \$_DLATCH_P_ (E, D, Q); 8 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 9 | input E, D; 10 | output Q = E ? D : Q; 11 | endmodule 12 | -------------------------------------------------------------------------------- /techlibs/lattice/lutrams.txt: -------------------------------------------------------------------------------- 1 | ram distributed $__TRELLIS_DPR16X4_ { 2 | abits 4; 3 | width 4; 4 | cost 4; 5 | init any; 6 | prune_rom; 7 | port sw "W" { 8 | clock anyedge; 9 | } 10 | port ar "R" { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /techlibs/nanoxplore/cells_sim_l.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/yosys/c21cd300a07d3b00cb12eccc0fa3f66c31c89bf0/techlibs/nanoxplore/cells_sim_l.v -------------------------------------------------------------------------------- /techlibs/nanoxplore/cells_sim_m.v: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YosysHQ/yosys/c21cd300a07d3b00cb12eccc0fa3f66c31c89bf0/techlibs/nanoxplore/cells_sim_m.v -------------------------------------------------------------------------------- /techlibs/nanoxplore/latches_map.v: -------------------------------------------------------------------------------- 1 | module \$_DLATCH_N_ (E, D, Q); 2 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 3 | input E, D; 4 | output Q = !E ? D : Q; 5 | endmodule 6 | 7 | module \$_DLATCH_P_ (E, D, Q); 8 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 9 | input E, D; 10 | output Q = E ? D : Q; 11 | endmodule 12 | -------------------------------------------------------------------------------- /techlibs/nanoxplore/rf_rams_l.txt: -------------------------------------------------------------------------------- 1 | ram distributed $__NX_RFB_L_ { 2 | abits 6; 3 | width 16; 4 | cost 10; 5 | init no_undef; 6 | prune_rom; 7 | 8 | port sw "W" { 9 | clock anyedge; 10 | } 11 | port sr "R" { 12 | clock anyedge; 13 | rden; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /techlibs/nanoxplore/rf_rams_m.txt: -------------------------------------------------------------------------------- 1 | ram distributed $__NX_RFB_M_ { 2 | abits 6; 3 | width 16; 4 | cost 10; 5 | init no_undef; 6 | prune_rom; 7 | 8 | port sw "W" { 9 | clock anyedge; 10 | } 11 | port sr "R" { 12 | clock anyedge; 13 | rden; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /techlibs/nexus/latches_map.v: -------------------------------------------------------------------------------- 1 | module \$_DLATCH_N_ (E, D, Q); 2 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 3 | input E, D; 4 | output Q = !E ? D : Q; 5 | endmodule 6 | 7 | module \$_DLATCH_P_ (E, D, Q); 8 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 9 | input E, D; 10 | output Q = E ? D : Q; 11 | endmodule 12 | -------------------------------------------------------------------------------- /techlibs/nexus/lutrams.txt: -------------------------------------------------------------------------------- 1 | ram distributed $__NEXUS_DPR16X4_ { 2 | abits 4; 3 | width 4; 4 | cost 4; 5 | init no_undef; 6 | prune_rom; 7 | port sw "W" { 8 | clock posedge; 9 | } 10 | port ar "R" { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /techlibs/quicklogic/.gitignore: -------------------------------------------------------------------------------- 1 | /*_pm.h 2 | -------------------------------------------------------------------------------- /techlibs/quicklogic/pp3/abc9_model.v: -------------------------------------------------------------------------------- 1 | (* abc9_flop, lib_whitebox *) 2 | module $__PP3_DFFEPC_SYNCONLY ( 3 | output Q, 4 | input D, 5 | input CLK, 6 | input EN, 7 | ); 8 | 9 | dffepc ff (.Q(Q), .D(D), .CLK(CLK), .EN(EN), .PRE(1'b0), .CLR(1'b0)); 10 | 11 | endmodule 12 | -------------------------------------------------------------------------------- /techlibs/quicklogic/pp3/ffs_map.v: -------------------------------------------------------------------------------- 1 | module \$_DFFSRE_PPPP_ (input C, S, R, E, D, output Q); 2 | wire _TECHMAP_REMOVEINIT_Q_ = 1; 3 | dffepc #(.INIT(1'b0)) _TECHMAP_REPLACE_ (.CLK(C), .PRE(S), .CLR(R), .EN(E), .D(D), .Q(Q)); 4 | endmodule 5 | -------------------------------------------------------------------------------- /techlibs/quicklogic/pp3/latches_map.v: -------------------------------------------------------------------------------- 1 | module \$_DLATCH_P_ (E, D, Q); 2 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 3 | input E, D; 4 | output Q = E ? D : Q; 5 | endmodule 6 | 7 | module \$_DLATCH_N_ (E, D, Q); 8 | wire [1023:0] _TECHMAP_DO_ = "simplemap; opt"; 9 | input E, D; 10 | output Q = !E ? D : Q; 11 | endmodule 12 | -------------------------------------------------------------------------------- /techlibs/quicklogic/qlf_k6n10f/.gitignore: -------------------------------------------------------------------------------- 1 | /bram_types_sim.v 2 | -------------------------------------------------------------------------------- /techlibs/sf2/Makefile.inc: -------------------------------------------------------------------------------- 1 | 2 | OBJS += techlibs/sf2/synth_sf2.o 3 | 4 | $(eval $(call add_share_file,share/sf2,techlibs/sf2/arith_map.v)) 5 | $(eval $(call add_share_file,share/sf2,techlibs/sf2/cells_map.v)) 6 | $(eval $(call add_share_file,share/sf2,techlibs/sf2/cells_sim.v)) 7 | 8 | -------------------------------------------------------------------------------- /techlibs/xilinx/tests/bram2.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ex 4 | unisims=/opt/Xilinx/Vivado/2014.4/data/verilog/src/unisims 5 | ../../../yosys -v2 -l bram2.log -p synth_xilinx -o bram2_syn.v bram2.v 6 | iverilog -T typ -o bram2_tb bram2_tb.v bram2_syn.v -y $unisims $unisims/../glbl.v 7 | vvp -N bram2_tb 8 | 9 | -------------------------------------------------------------------------------- /techlibs/xilinx/xc3s_mult_map.v: -------------------------------------------------------------------------------- 1 | module \$__MUL18X18 (input [17:0] A, input [17:0] B, output [35:0] Y); 2 | parameter A_SIGNED = 0; 3 | parameter B_SIGNED = 0; 4 | parameter A_WIDTH = 0; 5 | parameter B_WIDTH = 0; 6 | parameter Y_WIDTH = 0; 7 | 8 | MULT18X18 _TECHMAP_REPLACE_ ( 9 | .A(A), 10 | .B(B), 11 | .P(Y) 12 | ); 13 | endmodule 14 | 15 | -------------------------------------------------------------------------------- /tests/aiger/.gitignore: -------------------------------------------------------------------------------- 1 | /*_ref.v 2 | /*.log 3 | /neg.out/ 4 | -------------------------------------------------------------------------------- /tests/aiger/and_.aag: -------------------------------------------------------------------------------- 1 | aag 3 2 0 1 1 2 | 2 3 | 4 4 | 6 5 | 6 2 4 6 | i0 pi0 7 | i1 pi1 8 | o0 po0 9 | -------------------------------------------------------------------------------- /tests/aiger/and_.aig: -------------------------------------------------------------------------------- 1 | aig 3 2 0 1 1 2 | 6 3 | i0 pi0 4 | i1 pi1 5 | o0 po0 6 | -------------------------------------------------------------------------------- /tests/aiger/and_to_bad_out.aag: -------------------------------------------------------------------------------- 1 | aag 3 2 0 0 1 1 0 0 0 2 | 2 3 | 4 4 | 6 5 | 6 2 4 6 | i0 pi0 7 | i1 pi1 8 | b0 b0 9 | -------------------------------------------------------------------------------- /tests/aiger/and_to_bad_out.aig: -------------------------------------------------------------------------------- 1 | aig 3 2 0 0 1 1 2 | 6 3 | i0 pi0 4 | i1 pi1 5 | b0 b0 6 | -------------------------------------------------------------------------------- /tests/aiger/buffer.aag: -------------------------------------------------------------------------------- 1 | aag 1 1 0 1 0 2 | 2 3 | 2 4 | i0 pi0 5 | o0 po0 6 | -------------------------------------------------------------------------------- /tests/aiger/buffer.aig: -------------------------------------------------------------------------------- 1 | aig 1 1 0 1 0 2 | 2 3 | i0 pi0 4 | o0 po0 5 | -------------------------------------------------------------------------------- /tests/aiger/cnt1.aag: -------------------------------------------------------------------------------- 1 | aag 1 0 1 0 0 1 2 | 2 3 3 | 2 4 | b0 po0 5 | -------------------------------------------------------------------------------- /tests/aiger/cnt1.aig: -------------------------------------------------------------------------------- 1 | aig 1 0 1 0 0 1 2 | 3 3 | 2 4 | b0 po0 5 | -------------------------------------------------------------------------------- /tests/aiger/cnt1e.aag: -------------------------------------------------------------------------------- 1 | aag 5 1 1 0 3 1 2 | 2 3 | 4 10 4 | 4 5 | 6 5 3 6 | 8 4 2 7 | 10 9 7 8 | b0 AIGER_NEVER 9 | i0 po0 10 | -------------------------------------------------------------------------------- /tests/aiger/cnt1e.aig: -------------------------------------------------------------------------------- 1 | aig 5 1 1 0 3 1 2 | 10 3 | 4 4 | i0 po0 5 | b0 AIGER_NEVER 6 | -------------------------------------------------------------------------------- /tests/aiger/empty.aag: -------------------------------------------------------------------------------- 1 | aag 0 0 0 0 0 2 | -------------------------------------------------------------------------------- /tests/aiger/empty.aig: -------------------------------------------------------------------------------- 1 | aig 0 0 0 0 0 2 | -------------------------------------------------------------------------------- /tests/aiger/false.aag: -------------------------------------------------------------------------------- 1 | aag 0 0 0 1 0 2 | 0 3 | o0 po0 4 | -------------------------------------------------------------------------------- /tests/aiger/false.aig: -------------------------------------------------------------------------------- 1 | aig 0 0 0 1 0 2 | 0 3 | o0 po0 4 | -------------------------------------------------------------------------------- /tests/aiger/halfadder.aag: -------------------------------------------------------------------------------- 1 | aag 7 2 0 2 3 2 | 2 3 | 4 4 | 6 5 | 12 6 | 6 13 15 7 | 12 2 4 8 | 14 3 5 9 | i0 x 10 | i1 y 11 | o0 s 12 | o1 c 13 | c 14 | half adder 15 | -------------------------------------------------------------------------------- /tests/aiger/halfadder.aig: -------------------------------------------------------------------------------- 1 | aig 5 2 0 2 3 2 | 10 3 | 6 4 | i0 x 5 | i1 y 6 | o0 s 7 | o1 c 8 | c 9 | half adder 10 | -------------------------------------------------------------------------------- /tests/aiger/inverter.aag: -------------------------------------------------------------------------------- 1 | aag 1 1 0 1 0 2 | 2 3 | 3 4 | i0 pi0 5 | o0 po0 6 | -------------------------------------------------------------------------------- /tests/aiger/inverter.aig: -------------------------------------------------------------------------------- 1 | aig 1 1 0 1 0 2 | 3 3 | i0 pi0 4 | o0 po0 5 | -------------------------------------------------------------------------------- /tests/aiger/io.ys: -------------------------------------------------------------------------------- 1 | read_verilog <= 0); 4 | endmodule 5 | EOF 6 | 7 | equiv_opt -assert opt_expr -fine 8 | -------------------------------------------------------------------------------- /tests/opt/bug4413.ys: -------------------------------------------------------------------------------- 1 | read_verilog <> shift2; 11 | endmodule 12 | 13 | EOT 14 | 15 | equiv_opt -assert peepopt 16 | -------------------------------------------------------------------------------- /tests/opt/bug4610.ys: -------------------------------------------------------------------------------- 1 | read_rtlil <> ~31'b0; // shift by INT_MAX 5 | endmodule 6 | EOF 7 | 8 | # This should succeed, even with UBSAN halt_on_error 9 | opt_expr 10 | -------------------------------------------------------------------------------- /tests/opt/opt_lut.ys: -------------------------------------------------------------------------------- 1 | read_verilog opt_lut.v 2 | equiv_opt -map +/ice40/cells_sim.v -assert synth_ice40 3 | -------------------------------------------------------------------------------- /tests/opt/opt_lut_elim.ys: -------------------------------------------------------------------------------- 1 | read_rtlil opt_lut_elim.il 2 | opt_lut 3 | select -assert-count 0 t:$lut 4 | -------------------------------------------------------------------------------- /tests/opt/opt_lut_port.ys: -------------------------------------------------------------------------------- 1 | read_rtlil opt_lut_port.il 2 | opt_lut 3 | select -assert-count 2 t:$lut 4 | -------------------------------------------------------------------------------- /tests/opt/opt_rmdff_sat.v: -------------------------------------------------------------------------------- 1 | module top ( 2 | input clk, 3 | output reg [7:0] cnt 4 | ); 5 | initial cnt = 0; 6 | always @(posedge clk) begin 7 | if (cnt < 20) 8 | cnt <= cnt + 1; 9 | else 10 | cnt <= 0; 11 | end 12 | endmodule 13 | -------------------------------------------------------------------------------- /tests/opt/opt_rmdff_sat.ys: -------------------------------------------------------------------------------- 1 | read_verilog opt_rmdff_sat.v 2 | prep -flatten 3 | opt_dff -sat -nosdff 4 | simplemap 5 | select -assert-count 5 t:$_DFF_P_ 6 | -------------------------------------------------------------------------------- /tests/opt/opt_share_add_sub.v: -------------------------------------------------------------------------------- 1 | module opt_share_test( 2 | input [15:0] a, 3 | input [15:0] b, 4 | input sel, 5 | output [15:0] res, 6 | ); 7 | 8 | assign res = {sel ? a + b : a - b}; 9 | 10 | endmodule 11 | -------------------------------------------------------------------------------- /tests/opt/opt_share_bug2334.ys: -------------------------------------------------------------------------------- 1 | read_verilog < o) = 1; 10 | endspecify 11 | endmodule 12 | 13 | (* whitebox *) 14 | module wb(input a, b, output o); 15 | assign o = a ^ b; 16 | endmodule 17 | -------------------------------------------------------------------------------- /tests/select/boxes_equals_name.ys: -------------------------------------------------------------------------------- 1 | read_verilog -specify boxes.v 2 | clean 3 | 4 | select -set top top 5 | select -assert-count 4 @top 6 | select -set boxes =?b 7 | select -assert-count 9 @boxes 8 | -------------------------------------------------------------------------------- /tests/select/boxes_equals_pattern.ys: -------------------------------------------------------------------------------- 1 | read_verilog -specify boxes.v 2 | clean 3 | 4 | select -assert-none ?b 5 | select -assert-count 4 =bb 6 | select -assert-count 5 =wb 7 | select -assert-count 9 =?b 8 | -------------------------------------------------------------------------------- /tests/select/boxes_equals_wildcard.ys: -------------------------------------------------------------------------------- 1 | read_verilog -specify boxes.v 2 | clean 3 | 4 | select -assert-count 3 =c:* 5 | select -assert-count 10 =w:* 6 | select -assert-count 13 =* 7 | -------------------------------------------------------------------------------- /tests/select/boxes_no_equals.ys: -------------------------------------------------------------------------------- 1 | read_verilog -specify boxes.v 2 | clean 3 | 4 | select -assert-count 1 c:* 5 | select -assert-none t:* t:$and %d 6 | select -assert-count 3 w:* 7 | select -assert-count 4 * 8 | -------------------------------------------------------------------------------- /tests/select/list_mod.ys: -------------------------------------------------------------------------------- 1 | read_verilog <> t; 6 | 7 | endmodule 8 | EOT 9 | 10 | wreduce 11 | equiv_opt -assert peepopt 12 | -------------------------------------------------------------------------------- /tests/techmap/bug2759.ys: -------------------------------------------------------------------------------- 1 | read_verilog -specify < o) = 1; 6 | endspecify 7 | assign o = ^i; 8 | endmodule 9 | 10 | module top(input [1:0] i, output o); 11 | box i1(i, o); 12 | endmodule 13 | EOT 14 | abc9 -lut 4 15 | -------------------------------------------------------------------------------- /tests/techmap/dff2ff.ys: -------------------------------------------------------------------------------- 1 | read_verilog -icells << EOT 2 | module top(...); 3 | 4 | input [1:0] D; 5 | input C; 6 | output [1:0] Q; 7 | 8 | always @(posedge C) 9 | Q <= D; 10 | 11 | endmodule 12 | EOT 13 | 14 | proc 15 | 16 | equiv_opt -assert techmap -map +/dff2ff.v 17 | -------------------------------------------------------------------------------- /tests/techmap/lcu_refined.v: -------------------------------------------------------------------------------- 1 | module lcu (P, G, CI, CO); 2 | parameter WIDTH = 2; 3 | 4 | input [WIDTH-1:0] P, G; 5 | input CI; 6 | 7 | output [WIDTH-1:0] CO; 8 | 9 | reg [WIDTH-1:0] p, g; 10 | 11 | \$lcu #(.WIDTH(WIDTH)) impl (.P(P), .G(G), .CI(CI), .CO(CO)); 12 | 13 | endmodule 14 | -------------------------------------------------------------------------------- /tests/techmap/mem_simple_4x1_runtest.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exec ../tools/autotest.sh -G -j $@ -p 'proc; opt; memory -nomap; techmap -map ../mem_simple_4x1_map.v;; techmap; opt; abc;; stat' mem_simple_4x1_uut.v 4 | -------------------------------------------------------------------------------- /tests/techmap/pmux2mux.ys: -------------------------------------------------------------------------------- 1 | read_verilog -icells << EOT 2 | module top(...); 3 | 4 | input [3:0] A; 5 | input [3:0] B0; 6 | input [3:0] B1; 7 | input [1:0] S; 8 | output [3:0] O; 9 | 10 | \$pmux #(.WIDTH(4), .S_WIDTH(2)) pm (.A(A), .B({B1, B0}), .S(S), .Y(O)); 11 | 12 | endmodule 13 | EOT 14 | 15 | equiv_opt -assert techmap -map +/pmux2mux.v 16 | -------------------------------------------------------------------------------- /tests/techmap/recursive.v: -------------------------------------------------------------------------------- 1 | module top; 2 | sub s0(); 3 | foo f0(); 4 | endmodule 5 | 6 | module foo; 7 | sub s0(); 8 | endmodule 9 | -------------------------------------------------------------------------------- /tests/techmap/recursive_map.v: -------------------------------------------------------------------------------- 1 | module sub; 2 | sub _TECHMAP_REPLACE_ (); 3 | bar f0(); 4 | endmodule 5 | -------------------------------------------------------------------------------- /tests/techmap/recursive_runtest.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | ../../yosys -p 'read_verilog recursive.v; hierarchy -top top; techmap -map recursive_map.v -max_iter 1; select -assert-count 2 t:sub; select -assert-count 2 t:bar' 4 | -------------------------------------------------------------------------------- /tests/techmap/run-test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eu 3 | source ../gen-tests-makefile.sh 4 | generate_mk --yosys-scripts --tcl-scripts --bash --yosys-args "-e 'select out of bounds'" 5 | -------------------------------------------------------------------------------- /tests/tools/.gitignore: -------------------------------------------------------------------------------- 1 | cmp_tbdata 2 | -------------------------------------------------------------------------------- /tests/unit/kernel/logTest.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "kernel/yosys.h" 4 | #include "kernel/log.h" 5 | 6 | YOSYS_NAMESPACE_BEGIN 7 | 8 | TEST(KernelLogTest, logvValidValues) 9 | { 10 | //TODO: Implement log test 11 | EXPECT_EQ(7, 7); 12 | } 13 | 14 | YOSYS_NAMESPACE_END 15 | -------------------------------------------------------------------------------- /tests/various/.gitignore: -------------------------------------------------------------------------------- 1 | /*.log 2 | /*.out 3 | /*.sel 4 | /write_gzip.v 5 | /write_gzip.v.gz 6 | /run-test.mk 7 | /plugin.so 8 | /plugin.so.dSYM 9 | /temp 10 | /smtlib2_module.smt2 11 | /smtlib2_module-filtered.smt2 12 | -------------------------------------------------------------------------------- /tests/various/aiger_dff.ys: -------------------------------------------------------------------------------- 1 | read_verilog -icells <&2; exit 1' ERR 4 | 5 | (../../yosys -v 3 -C <&1 | grep -F "ERROR: Module \`nonexistent' not found!" > /dev/null 10 | -------------------------------------------------------------------------------- /tests/various/logger_error.ys: -------------------------------------------------------------------------------- 1 | logger -werror "is implicitly declared." -expect error "is implicitly declared." 1 2 | read_verilog << EOF 3 | module top(...); 4 | assign b = w; 5 | endmodule 6 | EOF 7 | -------------------------------------------------------------------------------- /tests/various/logger_nowarning.ys: -------------------------------------------------------------------------------- 1 | logger -expect-no-warnings -nowarn "is implicitly declared." 2 | read_verilog << EOF 3 | module top(...); 4 | assign b = w; 5 | endmodule 6 | EOF 7 | -------------------------------------------------------------------------------- /tests/various/logger_warn.ys: -------------------------------------------------------------------------------- 1 | logger -warn "Successfully finished Verilog frontend." -expect warning "Successfully finished Verilog frontend." 1 2 | read_verilog << EOF 3 | module top(...); 4 | assign b = w; 5 | endmodule 6 | EOF 7 | -------------------------------------------------------------------------------- /tests/various/logger_warning.ys: -------------------------------------------------------------------------------- 1 | logger -expect warning "is implicitly declared." 2 2 | read_verilog << EOF 3 | module top(...); 4 | assign b = w; 5 | endmodule 6 | EOF 7 | -------------------------------------------------------------------------------- /tests/various/logic_param_simple.ys: -------------------------------------------------------------------------------- 1 | read_verilog -sv <