diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-02-15 12:09:30 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-02-15 12:09:30 +0100 |
commit | 3216f9420e2f5aed0aa3e38ff89ab616db9b0849 (patch) | |
tree | 7a697285a7ff3038a2c51282fe360d6f1d060d68 /kernel | |
parent | 86819cc9f827b02da8cc44cc14bce7bc81ab5e9b (diff) | |
download | yosys-3216f9420e2f5aed0aa3e38ff89ab616db9b0849.tar.gz yosys-3216f9420e2f5aed0aa3e38ff89ab616db9b0849.tar.bz2 yosys-3216f9420e2f5aed0aa3e38ff89ab616db9b0849.zip |
More emscripten stuff, Added example app
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/driver.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc index 116df542c..6df7cf2e8 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -72,6 +72,32 @@ int getopt(int argc, char **argv, const char *optstring) USING_YOSYS_NAMESPACE +#ifdef EMSCRIPTEN + +extern "C" int main(int, char**); +extern "C" void run(const char*); +extern "C" const char *prompt(); + +int main(int, char**) +{ + log_files.push_back(stdout); + log_error_stderr = true; + yosys_banner(); + yosys_setup(); +} + +void run(const char *command) +{ + run_pass(command); +} + +const char *prompt() +{ + return create_prompt(yosys_get_design(), 0); +} + +#else /* EMSCRIPTEN */ + int main(int argc, char **argv) { std::string frontend_command = "auto"; @@ -440,3 +466,5 @@ int main(int argc, char **argv) return 0; } +#endif /* EMSCRIPTEN */ + |