DMASequencer.hh revision 6368
14158SN/A
24158SN/A#ifndef DMASEQUENCER_H
34158SN/A#define DMASEQUENCER_H
47087Snate@binkert.org
57087Snate@binkert.org#include <ostream>
67087Snate@binkert.org#include "mem/ruby/common/DataBlock.hh"
77087Snate@binkert.org#include "mem/ruby/system/RubyPort.hh"
87087Snate@binkert.org
97087Snate@binkert.orgstruct DMARequest {
107087Snate@binkert.org  uint64_t start_paddr;
117087Snate@binkert.org  int len;
124158SN/A  bool write;
137087Snate@binkert.org  int bytes_completed;
147087Snate@binkert.org  int bytes_issued;
157087Snate@binkert.org  uint8* data;
167087Snate@binkert.org  int64_t id;
177087Snate@binkert.org};
187087Snate@binkert.org
197087Snate@binkert.orgclass MessageBuffer;
207087Snate@binkert.orgclass AbstractController;
214158SN/A
227087Snate@binkert.orgclass DMASequencer :public RubyPort {
234158SN/Apublic:
244158SN/A  DMASequencer(const string & name);
254158SN/A  void init(const vector<string> & argv);
264158SN/A  /* external interface */
274158SN/A  int64_t makeRequest(const RubyRequest & request);
284158SN/A  //  void issueRequest(uint64_t paddr, uint8* data, int len, bool rw);
294158SN/A  bool busy() { return m_is_busy;}
304158SN/A
314158SN/A  /* SLICC callback */
324158SN/A  void dataCallback(const DataBlock & dblk);
334158SN/A  void ackCallback();
344158SN/A
354158SN/A  void printConfig(std::ostream & out);
364158SN/A
374158SN/Aprivate:
384158SN/A  void issueNext();
394158SN/A
404158SN/Aprivate:
414158SN/A  int m_version;
424158SN/A  AbstractController* m_controller;
436098Sgblack@eecs.umich.edu  bool m_is_busy;
444158SN/A  uint64_t m_data_block_mask;
456098Sgblack@eecs.umich.edu  DMARequest active_request;
466098Sgblack@eecs.umich.edu  int num_active_requests;
476098Sgblack@eecs.umich.edu  MessageBuffer* m_mandatory_q_ptr;
486098Sgblack@eecs.umich.edu};
496098Sgblack@eecs.umich.edu
506098Sgblack@eecs.umich.edu#endif // DMACONTROLLER_H
516098Sgblack@eecs.umich.edu