From 2192873daa7915aa034e9afd1fe82efbc61320d1 Mon Sep 17 00:00:00 2001 From: Johann Glaser Date: Mon, 18 Mar 2013 19:26:35 +0100 Subject: [PATCH 1/5] added description of Makefile include files for build configuration --- README | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/README b/README index cbd77bb17..5da189473 100644 --- a/README +++ b/README @@ -40,14 +40,25 @@ or the 2-clause BSD license). Getting Started =============== -To build Yosys simply type 'make' in this directory. You need -a C++ compiler with C++11 support (up-to-date CLANG or GCC is -recommended) and some standard tools such as GNU Flex, GNU Bison, -and GNU Make. It might be necessary to make some changes to -the config section of the Makefile. The extensive tests require -Icarus Verilog. +You need a C++ compiler with C++11 support (up-to-date CLANG or GCC is +recommended) and some standard tools such as GNU Flex, GNU Bison, and +GNU Make. The extensive tests require Icarus Verilog. + +To configure the build system to use a specific set of compiler and +build configuration, use one of + + $ make config-clang-debug + $ make config-gcc-debug + $ make config-release + +For other compilers and build configurations it might be +necessary to make some changes to the config section of the +Makefile. $ vi Makefile + +To build Yosys simply type 'make' in this directory. + $ make $ make test $ sudo make install From 15ad2db8fc4e608d05e87d4d447cb0a5f1081c95 Mon Sep 17 00:00:00 2001 From: Johann Glaser Date: Mon, 18 Mar 2013 20:58:47 +0100 Subject: [PATCH 2/5] fixed a crash when lines start with whitespace --- kernel/register.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/register.cc b/kernel/register.cc index ebb834c8f..a61548b64 100644 --- a/kernel/register.cc +++ b/kernel/register.cc @@ -132,7 +132,7 @@ void Pass::extra_args(std::vector args, size_t argidx, RTLIL::Desig void Pass::call(RTLIL::Design *design, std::string command) { std::vector args; - char *s = strdup(command.c_str()), *saveptr; + char *s = strdup(command.c_str()), *sstart = s, *saveptr; s += strspn(s, " \t\r\n"); if (*s == 0 || *s == '#') return; @@ -160,7 +160,7 @@ void Pass::call(RTLIL::Design *design, std::string command) } else args.push_back(str); } - free(s); + free(sstart); call(design, args); } From a4e2c887f12e6bf713ea77c7a2a687b3cd0b984a Mon Sep 17 00:00:00 2001 From: Johann Glaser Date: Mon, 18 Mar 2013 22:05:21 +0100 Subject: [PATCH 3/5] also optimize single-bit "$mux" cells in pass "opt_const", added suggestions for more optimizations --- passes/opt/opt_const.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/passes/opt/opt_const.cc b/passes/opt/opt_const.cc index 4d00807ab..909500967 100644 --- a/passes/opt/opt_const.cc +++ b/passes/opt/opt_const.cc @@ -113,7 +113,7 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module) if (input.match("0 ")) ACTION_DO("\\Y", input.extract(0, 1)); } - if (cell->type == "$_MUX_") { + if (cell->type == "$_MUX_" ||(cell->type == "$mux" && cell->parameters["\\WIDTH"].as_int() == 1)) { RTLIL::SigSpec input; input.append(cell->connections["\\S"]); input.append(cell->connections["\\B"]); @@ -125,6 +125,10 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module) if (input.match(" 1")) ACTION_DO("\\Y", input.extract(1, 1)); #ifdef MUX_UNDEF_SEL_TO_UNDEF_RESULTS if (input.match("01 ")) ACTION_DO("\\Y", input.extract(0, 1)); + // TODO: "0 " -> replace with "B AND S" gate + // TODO: " 1 " -> replace with "A OR S" gate + // TODO: "1 " -> replace with "B OR !S" gate + // TODO: " 0 " -> replace with "A AND !S" gate if (input.match(" *")) ACTION_DO_Y(x); #endif } From 69674652c5eafab7f96bcdab7618d57630ab0ae7 Mon Sep 17 00:00:00 2001 From: Johann Glaser Date: Mon, 18 Mar 2013 22:06:16 +0100 Subject: [PATCH 4/5] added one more suggestion to optimize MUXes in pass "opt_const" --- passes/opt/opt_const.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/passes/opt/opt_const.cc b/passes/opt/opt_const.cc index 909500967..5b87aeaa2 100644 --- a/passes/opt/opt_const.cc +++ b/passes/opt/opt_const.cc @@ -125,6 +125,7 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module) if (input.match(" 1")) ACTION_DO("\\Y", input.extract(1, 1)); #ifdef MUX_UNDEF_SEL_TO_UNDEF_RESULTS if (input.match("01 ")) ACTION_DO("\\Y", input.extract(0, 1)); + // TODO: "10 " -> replace with "!S" gate // TODO: "0 " -> replace with "B AND S" gate // TODO: " 1 " -> replace with "A OR S" gate // TODO: "1 " -> replace with "B OR !S" gate From 1d30c66a7f97cd522a87893c64ebe3a933f6b0ba Mon Sep 17 00:00:00 2001 From: Johann Glaser Date: Mon, 18 Mar 2013 22:06:53 +0100 Subject: [PATCH 5/5] added a TODO --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index 5da189473..97f2ba9b1 100644 --- a/README +++ b/README @@ -248,3 +248,5 @@ TODOs / Open Bugs - Better FSM state encoding +- For pass' "fsm_detect" help: add notes what criteria lets it detect an FSM +