mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-08 12:11:24 +00:00
Added emscripten (emcc) support to build system and some build fixes
This commit is contained in:
parent
ba83a7bdc6
commit
98442e019d
11 changed files with 101 additions and 14 deletions
|
@ -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;
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue