DMASequencer.hh revision 6876
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
96876Ssteve.reinhardt@amd.com#include "params/DMASequencer.hh"
106876Ssteve.reinhardt@amd.com
116285Snate@binkert.orgstruct DMARequest {
126285Snate@binkert.org  uint64_t start_paddr;
136285Snate@binkert.org  int len;
146285Snate@binkert.org  bool write;
156285Snate@binkert.org  int bytes_completed;
166285Snate@binkert.org  int bytes_issued;
176285Snate@binkert.org  uint8* data;
186285Snate@binkert.org  int64_t id;
196285Snate@binkert.org};
206285Snate@binkert.org
216285Snate@binkert.orgclass DMASequencer :public RubyPort {
226285Snate@binkert.orgpublic:
236876Ssteve.reinhardt@amd.com    typedef DMASequencerParams Params;
246876Ssteve.reinhardt@amd.com  DMASequencer(const Params *);
256876Ssteve.reinhardt@amd.com  void init();
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  bool m_is_busy;
436368Sdrh5@cs.wisc.edu  uint64_t m_data_block_mask;
446285Snate@binkert.org  DMARequest active_request;
456285Snate@binkert.org  int num_active_requests;
466285Snate@binkert.org};
476285Snate@binkert.org
486285Snate@binkert.org#endif // DMACONTROLLER_H
49