diff options
Diffstat (limited to 'src/mem/ruby/libruby.hh')
-rw-r--r-- | src/mem/ruby/libruby.hh | 86 |
1 files changed, 45 insertions, 41 deletions
diff --git a/src/mem/ruby/libruby.hh b/src/mem/ruby/libruby.hh index e22859818..6d83c3f08 100644 --- a/src/mem/ruby/libruby.hh +++ b/src/mem/ruby/libruby.hh @@ -26,11 +26,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LIBRUBY_H -#define LIBRUBY_H +#ifndef __MEM_RUBY_LIBRUBY_HH__ +#define __MEM_RUBY_LIBRUBY_HH__ -#include <stdint.h> #include <ostream> + +#include "base/types.hh" #include "mem/packet.hh" typedef void* RubyPortHandle; @@ -52,34 +53,35 @@ enum RubyAccessMode { RubyAccessMode_Device }; -struct RubyRequest { - uint64_t paddr; - uint8_t* data; - int len; - uint64_t pc; - RubyRequestType type; - RubyAccessMode access_mode; - PacketPtr pkt; - unsigned proc_id; - - RubyRequest() {} - RubyRequest(uint64_t _paddr, - uint8_t* _data, - int _len, - uint64_t _pc, - RubyRequestType _type, - RubyAccessMode _access_mode, - PacketPtr _pkt, - unsigned _proc_id = 100) - : paddr(_paddr), - data(_data), - len(_len), - pc(_pc), - type(_type), - access_mode(_access_mode), - pkt(_pkt), - proc_id(_proc_id) - {} +struct RubyRequest +{ + uint64_t paddr; + uint8_t* data; + int len; + uint64_t pc; + RubyRequestType type; + RubyAccessMode access_mode; + PacketPtr pkt; + unsigned proc_id; + + RubyRequest() {} + RubyRequest(uint64_t _paddr, + uint8_t* _data, + int _len, + uint64_t _pc, + RubyRequestType _type, + RubyAccessMode _access_mode, + PacketPtr _pkt, + unsigned _proc_id = 100) + : paddr(_paddr), + data(_data), + len(_len), + pc(_pc), + type(_type), + access_mode(_access_mode), + pkt(_pkt), + proc_id(_proc_id) + {} }; std::ostream& operator<<(std::ostream& out, const RubyRequest& obj); @@ -90,7 +92,8 @@ std::ostream& operator<<(std::ostream& out, const RubyRequest& obj); void libruby_init(const char* cfg_file); /** - * Tear down a configured system. Must be invoked after a call to libruby_init. + * Tear down a configured system. Must be invoked after a call to + * libruby_init. */ void libruby_destroy(); @@ -105,7 +108,8 @@ const char* libruby_last_error(); * this port to use when a request completes. Only one handle to a * port is allowed at a time. */ -RubyPortHandle libruby_get_port(const char* name, void (*hit_callback)(int64_t access_id)); +RubyPortHandle libruby_get_port(const char* name, + void (*hit_callback)(int64_t access_id)); /** * Retrieve a handle to a RubyPort object, identified by name in the @@ -113,7 +117,6 @@ RubyPortHandle libruby_get_port(const char* name, void (*hit_callback)(int64_t a */ RubyPortHandle libruby_get_port_by_name(const char* name); - /** * issue_request returns a unique access_id to identify the ruby * transaction. This access_id is later returned to the caller via @@ -126,14 +129,14 @@ int64_t libruby_issue_request(RubyPortHandle p, struct RubyRequest request); * ignores caches, and should be considered incoherent after * simulation starts. */ -void libruby_write_ram(uint64_t paddr, uint8_t * data, int len); +void libruby_write_ram(uint64_t paddr, uint8_t *data, int len); /** * reads data directory from Ruby's data array. Note that this * ignores caches, and should be considered incoherent after * simulation starts */ -void libruby_read_ram(uint64_t paddr, uint8_t * data, int len); +void libruby_read_ram(uint64_t paddr, uint8_t *data, int len); /** * tick the system n cycles. Eventually, will return the number of @@ -144,22 +147,22 @@ int libruby_tick(int n); /** * self explainitory */ -void libruby_print_config(std::ostream & out); +void libruby_print_config(std::ostream &out); /** * self explainitory */ -void libruby_print_stats(std::ostream & out); +void libruby_print_stats(std::ostream &out); /** * does not return until done */ -void libruby_playback_trace(char * trace_filename); +void libruby_playback_trace(char *trace_filename); /* * enables the tracer and opens the trace file */ -void libruby_start_tracing(char * record_filename); +void libruby_start_tracing(char *record_filename); /* * closes the trace file @@ -170,4 +173,5 @@ void libruby_stop_tracing(); * get time */ uint64_t libruby_get_time(); -#endif + +#endif // __MEM_RUBY_LIBRUBY_HH__ |