SST/macro
memory_model.h
Go to the documentation of this file.
1 /*
2  * This file is part of SST/macroscale:
3  * The macroscale architecture simulator from the SST suite.
4  * Copyright (c) 2009 Sandia Corporation.
5  * This software is distributed under the BSD License.
6  * Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
7  * the U.S. Government retains certain rights in this software.
8  * For more information, see the LICENSE file in the top
9  * SST/macroscale directory.
10  */
11 
12 #ifndef MEMORYMODEL_H_
13 #define MEMORYMODEL_H_
14 
17 #include <sprockit/debug.h>
18 
21 
23 #define mem_debug(...) \
24  debug_printf(sprockit::dbg::memory, "Memory on Node %d: %s", int(nodeid_), sprockit::printf(__VA_ARGS__).c_str())
25 
26 namespace sstmac {
27 namespace hw {
28 
29 class memory_model :
30  public event_subscheduler,
32 {
33 
34  public:
35  memory_model(node* node);
36 
37  static void
38  delete_statics();
39 
40  virtual void
41  init_factory_params(sprockit::sim_parameters* params);
42 
43  virtual ~memory_model();
44 
45  virtual void
46  access(long bytes, double max_bw,
47  callback* cb) = 0;
48 
49  virtual std::string
50  to_string() const {
51  return "memory model";
52  }
53 
54  virtual double
55  max_single_bw() const = 0;
56 
57  node_id addr() const;
58 
59  protected:
60  memory_model();
61 
62  protected:
63  node_id nodeid_;
64  node* parent_node_;
65  event_handler* done_;
66 
67 };
68 
70 
71 }
72 } /* namespace sstmac */
73 #endif /* MEMORYMODEL_H_ */
74 
DeclareFactory1InitParam(nic, sprockit::factory_type *)
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
DeclareDebugSlot(memory) namespace sstmac
Definition: memory_model.h:22
endpoint_id node_id
Definition: node_address.h:20