diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-08-22 16:09:13 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-08-22 16:20:22 +0200 |
commit | 98442e019d745f1d61983c071decfa3ebc1ff0cf (patch) | |
tree | cb7776cfb0916f529042b4ffd2249404a3aaefdb /frontends | |
parent | ba83a7bdc641c68344b41f407323c76b8c62c674 (diff) | |
download | yosys-98442e019d745f1d61983c071decfa3ebc1ff0cf.tar.gz yosys-98442e019d745f1d61983c071decfa3ebc1ff0cf.tar.bz2 yosys-98442e019d745f1d61983c071decfa3ebc1ff0cf.zip |
Added emscripten (emcc) support to build system and some build fixes
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/ast.cc | 4 | ||||
-rw-r--r-- | frontends/ast/dpicall.cc | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 2fc8f9835..1e43875ae 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -844,7 +844,11 @@ RTLIL::Const AstNode::realAsConst(int width) { double v = round(realvalue); RTLIL::Const result; +#ifdef EMSCRIPTEN + if (!isfinite(v)) { +#else if (!std::isfinite(v)) { +#endif result.bits = std::vector<RTLIL::State>(width, RTLIL::State::Sx); } else { bool is_negative = v < 0; diff --git a/frontends/ast/dpicall.cc b/frontends/ast/dpicall.cc index b79bd59eb..2eb104fa0 100644 --- a/frontends/ast/dpicall.cc +++ b/frontends/ast/dpicall.cc @@ -17,9 +17,12 @@ * */ +#include "ast.h" + +#ifdef YOSYS_ENABLE_PLUGINS + #include <dlfcn.h> #include <ffi.h> -#include "ast.h" typedef void (*ffi_fptr) (); @@ -126,3 +129,12 @@ AST::AstNode *AST::dpi_call(const std::string &rtype, const std::string &fname, return newNode; } +#else /* YOSYS_ENABLE_PLUGINS */ + +AST::AstNode *AST::dpi_call(const std::string&, const std::string &fname, const std::vector<std::string>&, const std::vector<AstNode*>&) +{ + log_error("Can't call DPI function `%s': this version of yosys is built without plugin support\n", fname.c_str()); +} + +#endif /* YOSYS_ENABLE_PLUGINS */ + |