diff options
author | Jerry Zhao <jerryz123@berkeley.edu> | 2022-12-11 10:56:56 -0800 |
---|---|---|
committer | Jerry Zhao <jerryz123@berkeley.edu> | 2022-12-13 12:21:11 -0800 |
commit | 68a3039598dc418b0fd25e971746bee31e28b3ea (patch) | |
tree | 71b301b7463dccf5dae0f037684f8700bd155eb8 /riscv/sim.h | |
parent | 572d5e44097d9e37c1233a8df4b6bba0c387363c (diff) | |
download | riscv-isa-sim-68a3039598dc418b0fd25e971746bee31e28b3ea.zip riscv-isa-sim-68a3039598dc418b0fd25e971746bee31e28b3ea.tar.gz riscv-isa-sim-68a3039598dc418b0fd25e971746bee31e28b3ea.tar.bz2 |
Move boost asio socket interface to socketif_t
This reduces dependencies on config.h in sim.h
Diffstat (limited to 'riscv/sim.h')
-rw-r--r-- | riscv/sim.h | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/riscv/sim.h b/riscv/sim.h index 8ca06fe..b3b5d40 100644 --- a/riscv/sim.h +++ b/riscv/sim.h @@ -4,13 +4,6 @@ #define _RISCV_SIM_H #include "config.h" - -#ifdef HAVE_BOOST_ASIO -#include <boost/algorithm/string.hpp> -#include <boost/regex.hpp> -#include <boost/asio.hpp> -#endif - #include "cfg.h" #include "debug_module.h" #include "devices.h" @@ -27,6 +20,7 @@ class mmu_t; class remote_bitbang_t; +class socketif_t; // this class encapsulates the processors and memory in a RISC-V machine. class sim_t : public htif_t, public simif_t @@ -38,9 +32,7 @@ public: const std::vector<std::string>& args, const debug_module_config_t &dm_config, const char *log_path, bool dtb_enabled, const char *dtb_file, -#ifdef HAVE_BOOST_ASIO - boost::asio::io_service *io_service_ptr_ctor, boost::asio::ip::tcp::acceptor *acceptor_ptr_ctor, // option -s -#endif + bool socket_enabled, FILE *cmd_file); // needed for command line option --cmd ~sim_t(); @@ -89,14 +81,7 @@ private: FILE *cmd_file; // pointer to debug command input file -#ifdef HAVE_BOOST_ASIO - // the following are needed for command socket interface - boost::asio::io_service *io_service_ptr; - boost::asio::ip::tcp::acceptor *acceptor_ptr; - std::unique_ptr<boost::asio::ip::tcp::socket> socket_ptr; - std::string rin(boost::asio::streambuf *bout_ptr); // read input command string - void wout(boost::asio::streambuf *bout_ptr); // write output to socket -#endif + socketif_t *socketif; std::ostream sout_; // used for socket and terminal interface processor_t* get_core(const std::string& i); |