From b5da3a60e101a26dbcbd6a8565343c281ba464f8 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 18 Oct 2014 14:15:05 +0200 Subject: Moved yosys-config.in to misc/ --- misc/yosys-config.in | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 misc/yosys-config.in (limited to 'misc') diff --git a/misc/yosys-config.in b/misc/yosys-config.in new file mode 100644 index 000000000..8f8dd06c6 --- /dev/null +++ b/misc/yosys-config.in @@ -0,0 +1,97 @@ +#!/bin/bash + +help() { + { + echo "" + echo "Usage: $0 [-exec] [--prefix pf] args.." + echo "" + echo "Replecement args:" + echo " --cxx @CXX@" + echo " --cxxflags $( echo '@CXXFLAGS@' | fmt -w60 | sed ':a;N;$!ba;s/\n/ \\\n /g' )" + echo " --ldflags @LDFLAGS@" + echo " --ldlibs @LDLIBS@" + echo " --bindir @BINDIR@" + echo " --datdir @DATDIR@" + echo "" + echo "All other args are passed trhough as they are." + echo "" + echo "Use -exec to call a command instead of generating output. Example usage:" + echo "" + echo " yosys-config --exec --cxx --cxxflags --ldflags -o plugin.so -shared plugin.cc --ldlibs" + echo "" + echo "Use --prefix to change the prefix for the special args from '--' to" + echo "something else. Example:" + echo "" + echo " yosys-config --prefix @ bindir: @bindir" + echo "" + echo "The args --bindir and --datdir can be directly followed by a slash and" + echo "additional text. Example:" + echo "" + echo " yosys-config --datdir/simlib.v" + echo "" + } >&2 + exit 1 +} + +if [ $# -eq 0 ]; then + help +fi + +prefix="--" +get_prefix=false +exec_mode=false +declare -a tokens=() + +for opt; do + if $get_prefix; then + prefix="$opt" + get_prefix=false + continue + fi + case "$opt" in + "$prefix"cxx) + tokens=( "${tokens[@]}" @CXX@ ) ;; + "$prefix"cxxflags) + tokens=( "${tokens[@]}" @CXXFLAGS@ ) ;; + "$prefix"ldflags) + tokens=( "${tokens[@]}" @LDFLAGS@ ) ;; + "$prefix"ldlibs) + tokens=( "${tokens[@]}" @LDLIBS@ ) ;; + "$prefix"bindir) + tokens=( "${tokens[@]}" '@BINDIR@' ) ;; + "$prefix"datdir) + tokens=( "${tokens[@]}" '@DATDIR@' ) ;; + "$prefix"bindir/*) + tokens=( "${tokens[@]}" '@BINDIR@'"${opt#${prefix}bindir}" ) ;; + "$prefix"datdir/*) + tokens=( "${tokens[@]}" '@DATDIR@'"${opt#${prefix}datdir}" ) ;; + --help|-\?|-h) + if [ ${#tokens[@]} -eq 0 ]; then + help + else + tokens=( "${tokens[@]}" "$opt" ) + fi ;; + --exec) + if [ ${#tokens[@]} -eq 0 ]; then + exec_mode=true + else + tokens=( "${tokens[@]}" "$opt" ) + fi ;; + --prefix) + if [ ${#tokens[@]} -eq 0 ]; then + get_prefix=true + else + tokens=( "${tokens[@]}" "$opt" ) + fi ;; + *) + tokens=( "${tokens[@]}" "$opt" ) + esac +done + +if $exec_mode; then + exec "${tokens[@]}" +fi + +echo "${tokens[@]}" +exit 0 + -- cgit v1.2.3 From 85572b05e5359f28c1625b873dc14428f796a454 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 18 Oct 2014 15:17:33 +0200 Subject: Create vcxsrc in mxe build "make dist" --- misc/create_vcxsrc.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 misc/create_vcxsrc.sh (limited to 'misc') diff --git a/misc/create_vcxsrc.sh b/misc/create_vcxsrc.sh new file mode 100644 index 000000000..eb2239303 --- /dev/null +++ b/misc/create_vcxsrc.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +set -ex +vcxsrc="$1" + +rm -rf YosysVS-Tpl-v1.zip YosysVS +wget http://www.clifford.at/yosys/nogit/YosysVS-Tpl-v1.zip + +unzip YosysVS-Tpl-v1.zip +rm -f YosysVS-Tpl-v1.zip +mv YosysVS "$vcxsrc" + +{ + n=$(grep -B999 '' "$vcxsrc"/YosysVS/YosysVS.vcxproj | wc -l) + head -n$n "$vcxsrc"/YosysVS/YosysVS.vcxproj + egrep '\.(h|hh|hpp|inc)$' srcfiles.txt | sed 's,.*,,' + egrep -v '\.(h|hh|hpp|inc)$' srcfiles.txt | sed 's,.*,,' + tail -n +$((n+1)) "$vcxsrc"/YosysVS/YosysVS.vcxproj +} > "$vcxsrc"/YosysVS/YosysVS.vcxproj.new + +mv "$vcxsrc"/YosysVS/YosysVS.vcxproj.new "$vcxsrc"/YosysVS/YosysVS.vcxproj + +mkdir -p "$vcxsrc"/yosys +tar -cf - -T srcfiles.txt | tar -xf - -C "$vcxsrc"/yosys + +cat > "$vcxsrc"/readme-git.txt << EOT +Using a git working copy for the yosys source code: + +Open "Git Bash" in this directory and run: + + mv yosys yosys.bak + git clone https://github.com/cliffordwolf/yosys.git yosys + cd yosys + git checkout -B master $(git rev-parse HEAD | cut -c1-10) + unzip ../genfiles.zip +EOT + +sed -i 's/$/\r/; s/\r\r*/\r/g;' "$vcxsrc"/YosysVS/YosysVS.vcxproj "$vcxsrc"/readme-git.txt + -- cgit v1.2.3 From 0471d158d955804c011338c5c664dfa7a38aed1f Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 18 Oct 2014 19:00:52 +0200 Subject: Various improvements to version reporting on win32 --- misc/create_vcxsrc.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'misc') diff --git a/misc/create_vcxsrc.sh b/misc/create_vcxsrc.sh index eb2239303..215e27c53 100644 --- a/misc/create_vcxsrc.sh +++ b/misc/create_vcxsrc.sh @@ -1,7 +1,9 @@ #!/bin/bash set -ex -vcxsrc="$1" +vcxsrc="$1-$2" +yosysver="$2" +gitsha="$3" rm -rf YosysVS-Tpl-v1.zip YosysVS wget http://www.clifford.at/yosys/nogit/YosysVS-Tpl-v1.zip @@ -15,6 +17,7 @@ mv YosysVS "$vcxsrc" head -n$n "$vcxsrc"/YosysVS/YosysVS.vcxproj egrep '\.(h|hh|hpp|inc)$' srcfiles.txt | sed 's,.*,,' egrep -v '\.(h|hh|hpp|inc)$' srcfiles.txt | sed 's,.*,,' + echo '' tail -n +$((n+1)) "$vcxsrc"/YosysVS/YosysVS.vcxproj } > "$vcxsrc"/YosysVS/YosysVS.vcxproj.new @@ -22,10 +25,13 @@ mv "$vcxsrc"/YosysVS/YosysVS.vcxproj.new "$vcxsrc"/YosysVS/YosysVS.vcxproj mkdir -p "$vcxsrc"/yosys tar -cf - -T srcfiles.txt | tar -xf - -C "$vcxsrc"/yosys +cp -r share "$vcxsrc"/ -cat > "$vcxsrc"/readme-git.txt << EOT -Using a git working copy for the yosys source code: +echo "namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys" \ + "$yosysver (git sha1 $gitsha, Visual Studio)\"; }" > "$vcxsrc"/yosys/kernel/version.cc +cat > "$vcxsrc"/readme-git.txt << EOT +Want to use a git working copy for the yosys source code? Open "Git Bash" in this directory and run: mv yosys yosys.bak @@ -35,5 +41,14 @@ Open "Git Bash" in this directory and run: unzip ../genfiles.zip EOT -sed -i 's/$/\r/; s/\r\r*/\r/g;' "$vcxsrc"/YosysVS/YosysVS.vcxproj "$vcxsrc"/readme-git.txt +cat > "$vcxsrc"/readme-abc.txt << EOT +Yosys is using "ABC" for gate-level optimizations and technology +mapping. Download yosys-win32-mxebin-$yosysver.zip and copy the +following files from it into this directory: + + pthreadVC2.dll + yosys-abc.exe +EOT + +sed -i 's/$/\r/; s/\r\r*/\r/g;' "$vcxsrc"/YosysVS/YosysVS.vcxproj "$vcxsrc"/readme-git.txt "$vcxsrc"/readme-abc.txt -- cgit v1.2.3 From 1df81f92ce171ba63cf0e4d10e6f203ca5f7f64e Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 1 Feb 2015 13:38:46 +0100 Subject: Added "make mklibyosys", some minor API changes --- misc/example.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 misc/example.cc (limited to 'misc') diff --git a/misc/example.cc b/misc/example.cc new file mode 100644 index 000000000..a8244ac4e --- /dev/null +++ b/misc/example.cc @@ -0,0 +1,21 @@ +// clang -o example -std=c++11 -I/usr/include/tcl8.5 -I include/ example.cc objs/*.o -lstdc++ -lm -lrt -lreadline -lffi -ldl -ltcl8.5 + +#include + +int main() +{ + Yosys::log_streams.push_back(&std::cout); + Yosys::log_error_stderr = true; + + Yosys::yosys_setup(); + Yosys::yosys_banner(); + + Yosys::run_pass("read_verilog example.v"); + Yosys::run_pass("synth -noabc"); + Yosys::run_pass("clean -purge"); + Yosys::run_pass("write_blif example.blif"); + + Yosys::yosys_shutdown(); + return 0; +} + -- cgit v1.2.3 From bbfc1bd7cf8dfe345a9593fe120648374811b6d3 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 8 Feb 2015 00:14:07 +0100 Subject: Added "yosys-config --build modname.so cppsources.." --- misc/yosys-config.in | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'misc') diff --git a/misc/yosys-config.in b/misc/yosys-config.in index 8f8dd06c6..defb09ce7 100644 --- a/misc/yosys-config.in +++ b/misc/yosys-config.in @@ -3,7 +3,8 @@ help() { { echo "" - echo "Usage: $0 [-exec] [--prefix pf] args.." + echo "Usage: $0 [--exec] [--prefix pf] args.." + echo " $0 --build modname.so cppsources.." echo "" echo "Replecement args:" echo " --cxx @CXX@" @@ -15,10 +16,14 @@ help() { echo "" echo "All other args are passed trhough as they are." echo "" - echo "Use -exec to call a command instead of generating output. Example usage:" + echo "Use --exec to call a command instead of generating output. Example usage:" echo "" echo " yosys-config --exec --cxx --cxxflags --ldflags -o plugin.so -shared plugin.cc --ldlibs" echo "" + echo "The above command can be abbreviated as:" + echo "" + echo " yosys-config --build plugin.so plugin.cc" + echo "" echo "Use --prefix to change the prefix for the special args from '--' to" echo "something else. Example:" echo "" @@ -37,6 +42,11 @@ if [ $# -eq 0 ]; then help fi +if [ "$1" == "--build" ]; then + modname="$2"; shift 2 + set -- --exec --cxx --cxxflags --ldflags -o "$modname" -shared "$@" --ldlibs +fi + prefix="--" get_prefix=false exec_mode=false -- cgit v1.2.3 From fbb16712f1beeb0f25ddc5b2c56556fe70315597 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 8 Feb 2015 00:16:59 +0100 Subject: fixed typo --- misc/yosys-config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'misc') diff --git a/misc/yosys-config.in b/misc/yosys-config.in index defb09ce7..1473948cf 100644 --- a/misc/yosys-config.in +++ b/misc/yosys-config.in @@ -14,7 +14,7 @@ help() { echo " --bindir @BINDIR@" echo " --datdir @DATDIR@" echo "" - echo "All other args are passed trhough as they are." + echo "All other args are passed through as they are." echo "" echo "Use --exec to call a command instead of generating output. Example usage:" echo "" -- cgit v1.2.3 From 3216f9420e2f5aed0aa3e38ff89ab616db9b0849 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 15 Feb 2015 12:09:30 +0100 Subject: More emscripten stuff, Added example app --- misc/yosys.html | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 misc/yosys.html (limited to 'misc') diff --git a/misc/yosys.html b/misc/yosys.html new file mode 100644 index 000000000..c82bc1871 --- /dev/null +++ b/misc/yosys.html @@ -0,0 +1,60 @@ + + + yosys.js example application + + +

yosys.js example application

+
+

yosys>
+ + + + -- cgit v1.2.3 From c2cc342e1a3d223caf1059fd2f255b0985ded61c Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 15 Feb 2015 16:16:08 +0100 Subject: Improved yosys.js example --- misc/yosys.html | 132 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 72 insertions(+), 60 deletions(-) (limited to 'misc') diff --git a/misc/yosys.html b/misc/yosys.html index c82bc1871..929d0dd3b 100644 --- a/misc/yosys.html +++ b/misc/yosys.html @@ -1,60 +1,72 @@ - - - yosys.js example application - - -

yosys.js example application

-
-

yosys>
- - - - + + yosys.js example application + +

yosys.js example application

+
+

Loading...
+ + + + -- cgit v1.2.3 From 8d45f81046a159df38e20b00cf0d74b1bb02a073 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 15 Feb 2015 17:14:09 +0100 Subject: More emcc stuff --- misc/yosys.html | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'misc') diff --git a/misc/yosys.html b/misc/yosys.html index 929d0dd3b..29d89e6fe 100644 --- a/misc/yosys.html +++ b/misc/yosys.html @@ -4,18 +4,18 @@

yosys.js example application


Loading...
- + +

Loading...