DMASequencer.hh revision 6825
16285Snate@binkert.org
26285Snate@binkert.org#ifndef DMASEQUENCER_H
36285Snate@binkert.org#define DMASEQUENCER_H
46285Snate@binkert.org
56285Snate@binkert.org#include <ostream>
66285Snate@binkert.org#include "mem/ruby/common/DataBlock.hh"
76285Snate@binkert.org#include "mem/ruby/system/RubyPort.hh"
86285Snate@binkert.org
96285Snate@binkert.orgstruct DMARequest {
106285Snate@binkert.org  uint64_t start_paddr;
116285Snate@binkert.org  int len;
126285Snate@binkert.org  bool write;
136285Snate@binkert.org  int bytes_completed;
146285Snate@binkert.org  int bytes_issued;
156285Snate@binkert.org  uint8* data;
166285Snate@binkert.org  int64_t id;
176285Snate@binkert.org};
186285Snate@binkert.org
196285Snate@binkert.orgclass MessageBuffer;
206285Snate@binkert.orgclass AbstractController;
216285Snate@binkert.org
226285Snate@binkert.orgclass DMASequencer :public RubyPort {
236285Snate@binkert.orgpublic:
246285Snate@binkert.org  DMASequencer(const string & name);
256285Snate@binkert.org  void init(const vector<string> & argv);
266285Snate@binkert.org  /* external interface */
276285Snate@binkert.org  int64_t makeRequest(const RubyRequest & request);
286825Spdudnik@gmail.com  bool isReady(const RubyRequest & request, bool dont_set = false) { assert(0); return false;};
296285Snate@binkert.org  //  void issueRequest(uint64_t paddr, uint8* data, int len, bool rw);
306285Snate@binkert.org  bool busy() { return m_is_busy;}
316285Snate@binkert.org
326285Snate@binkert.org  /* SLICC callback */
336285Snate@binkert.org  void dataCallback(const DataBlock & dblk);
346285Snate@binkert.org  void ackCallback();
356285Snate@binkert.org
366285Snate@binkert.org  void printConfig(std::ostream & out);
376285Snate@binkert.org
386285Snate@binkert.orgprivate:
396285Snate@binkert.org  void issueNext();
406285Snate@binkert.org
416285Snate@binkert.orgprivate:
426285Snate@binkert.org  int m_version;
436285Snate@binkert.org  AbstractController* m_controller;
446285Snate@binkert.org  bool m_is_busy;
456368Sdrh5@cs.wisc.edu  uint64_t m_data_block_mask;
466285Snate@binkert.org  DMARequest active_request;
476285Snate@binkert.org  int num_active_requests;
486285Snate@binkert.org  MessageBuffer* m_mandatory_q_ptr;
496285Snate@binkert.org};
506285Snate@binkert.org
516285Snate@binkert.org#endif // DMACONTROLLER_H
52