summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/DMASequencer.hh
blob: 2665549e3e32cecfada48d8dccfca310bb6a9c69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

#ifndef DMASEQUENCER_H
#define DMASEQUENCER_H

#include <ostream>
#include "mem/ruby/common/DataBlock.hh"
#include "mem/ruby/system/RubyPort.hh"

struct DMARequest {
  uint64_t start_paddr;
  int len;
  bool write;
  int bytes_completed;
  int bytes_issued;
  uint8* data;
  int64_t id;
};

class MessageBuffer;
class AbstractController;

class DMASequencer :public RubyPort {
public:
  DMASequencer(const string & name);
  void init(const vector<string> & argv);
  /* external interface */
  int64_t makeRequest(const RubyRequest & request);
  //  void issueRequest(uint64_t paddr, uint8* data, int len, bool rw);
  bool busy() { return m_is_busy;}

  /* SLICC callback */
  void dataCallback(const DataBlock & dblk);
  void ackCallback();

  void printConfig(std::ostream & out);

private:
  void issueNext();

private:
  int m_version;
  AbstractController* m_controller;
  bool m_is_busy;
  DMARequest active_request;
  int num_active_requests;
  MessageBuffer* m_mandatory_q_ptr;
};

#endif // DMACONTROLLER_H