aboutsummaryrefslogtreecommitdiff
path: root/riscv/sim.h
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2010-07-21 20:12:09 -0700
committerAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2010-07-21 20:12:09 -0700
commitd2c5b5c15930668588f88bd1186031dded771261 (patch)
tree1de56d755bd58cc91c7c54db6c2e94633991d36f /riscv/sim.h
parent7a38f874326755f131afe2bd336c0a261d58d4f2 (diff)
downloadriscv-isa-sim-d2c5b5c15930668588f88bd1186031dded771261.zip
riscv-isa-sim-d2c5b5c15930668588f88bd1186031dded771261.tar.gz
riscv-isa-sim-d2c5b5c15930668588f88bd1186031dded771261.tar.bz2
[pk,sim] first cut of appserver communication link
Diffstat (limited to 'riscv/sim.h')
-rw-r--r--riscv/sim.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/riscv/sim.h b/riscv/sim.h
index 6d2ac9b..59795d9 100644
--- a/riscv/sim.h
+++ b/riscv/sim.h
@@ -5,22 +5,31 @@
#include <string>
#include "processor.h"
-const int MEMSIZE = 0x7D000000;
+const long MEMSIZE = 0x100000000;
+
+class appserver_link_t;
class sim_t
{
public:
- sim_t(int _nprocs, size_t _memsz);
+ sim_t(int _nprocs, size_t _memsz, appserver_link_t* _applink);
~sim_t();
void load_elf(const char* fn);
void run(bool debug);
+ void set_tohost(reg_t val);
+ reg_t get_fromhost();
+
private:
- processor_t* procs;
- int nprocs;
+ // global architected state
+ reg_t tohost;
+ reg_t fromhost;
+
+ appserver_link_t* applink;
- char* mem;
size_t memsz;
+ char* mem;
+ std::vector<processor_t> procs;
void step_all(size_t n, size_t interleave, bool noisy);
@@ -41,6 +50,8 @@ private:
reg_t get_reg(const std::vector<std::string>& args);
reg_t get_mem(const std::vector<std::string>& args);
reg_t get_pc(const std::vector<std::string>& args);
+
+ friend class appserver_link_t;
};
#endif