OpenASIP  2.0
AvalonMMMasterInterface.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2010 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file AvalonMMMasterInterface.hh
26  *
27  * Declaration of AvalonMMMasterInterface class.
28  *
29  * @author Otto Esko 2010 (otto.esko-no.spam-tut.fi)
30  * @note rating: red
31  */
32 #ifndef TTA_AVALON_MM_MASTER_INTERFACE_HH
33 #define TTA_AVALON_MM_MASTER_INTERFACE_HH
34 
35 #include "SOPCInterface.hh"
36 #include "NetlistPort.hh"
37 #include "TCEString.hh"
38 
40 public:
41 
43  const TCEString& name,
44  const TCEString& declaration,
45  const TCEString& avalonPrefix,
46  const SOPCInterface& clock);
47 
48  virtual ~AvalonMMMasterInterface();
49 
50  bool isValidPort(const ProGe::NetlistPort& port) const;
51 
52  void addPort(const ProGe::NetlistPort& port);
53 
54  virtual void writeInterface(std::ostream& stream) const;
55 
57  static const TCEString AVALON_MM_WDATA;
58  static const TCEString AVALON_MM_RDATA;
59  static const TCEString AVALON_MM_READ;
60  static const TCEString AVALON_MM_WRITE;
64 
65 private:
66 
68  TCEString hdlName,
69  ProGe::Direction direction) const;
70 
71  void addIrqInterface(
72  const ProGe::NetlistPort& port,
73  const SOPCPort& avalonPort);
74 
76 
79 
81  std::vector<SOPCInterface*> childInterfaces_;
82 
83  static const int ADDRESS_DEF_WIDTH;
84  static const int WDATA_DEF_WIDTH;
85  static const int RDATA_DEF_WIDTH;
86  static const int READ_DEF_WIDTH;
87  static const int WRITE_DEF_WIDTH;
88  static const int BYTE_ENABLE_DEF_WIDTH;
89  static const int WAIT_REQ_DEF_WIDTH;
90  static const int IRQ_RECV_DEF_WIDTH;
91 };
92 
93 #endif
AvalonMMMasterInterface::AVALON_MM_WDATA
static const TCEString AVALON_MM_WDATA
Definition: AvalonMMMasterInterface.hh:57
AvalonMMMasterInterface::addIrqInterface
void addIrqInterface(const ProGe::NetlistPort &port, const SOPCPort &avalonPort)
Definition: AvalonMMMasterInterface.cc:151
AvalonMMMasterInterface::READ_DEF_WIDTH
static const int READ_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:86
AvalonMMMasterInterface::AVALON_MM_WRITE
static const TCEString AVALON_MM_WRITE
Definition: AvalonMMMasterInterface.hh:60
AvalonMMMasterInterface::addPort
void addPort(const ProGe::NetlistPort &port)
Definition: AvalonMMMasterInterface.cc:106
SOPCInterface::SOPCPort
Definition: SOPCInterface.hh:91
AvalonMMMasterInterface::BYTE_ENABLE_DEF_WIDTH
static const int BYTE_ENABLE_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:88
SOPCInterface::PortList
std::vector< SOPCPort > PortList
Definition: SOPCInterface.hh:99
AvalonMMMasterInterface::AVALON_MM_READ
static const TCEString AVALON_MM_READ
Definition: AvalonMMMasterInterface.hh:59
SOPCInterface
Definition: SOPCInterface.hh:41
AvalonMMMasterInterface::AVALON_MM_ADDRESS
static const TCEString AVALON_MM_ADDRESS
Definition: AvalonMMMasterInterface.hh:56
AvalonMMMasterInterface::avalonPrefix_
TCEString avalonPrefix_
Definition: AvalonMMMasterInterface.hh:75
AvalonMMMasterInterface::RDATA_DEF_WIDTH
static const int RDATA_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:85
SOPCInterface.hh
AvalonMMMasterInterface::findInterfacePort
const SOPCPort * findInterfacePort(TCEString hdlName, ProGe::Direction direction) const
Definition: AvalonMMMasterInterface.cc:133
AvalonMMMasterInterface::irqPort_
SOPCPort irqPort_
Definition: AvalonMMMasterInterface.hh:78
TCEString.hh
AvalonMMMasterInterface::AVALON_MM_BYTE_ENABLE
static const TCEString AVALON_MM_BYTE_ENABLE
Definition: AvalonMMMasterInterface.hh:61
AvalonMMMasterInterface::isValidPort
bool isValidPort(const ProGe::NetlistPort &port) const
Definition: AvalonMMMasterInterface.cc:100
AvalonMMMasterInterface::WDATA_DEF_WIDTH
static const int WDATA_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:84
AvalonMMMasterInterface::~AvalonMMMasterInterface
virtual ~AvalonMMMasterInterface()
Definition: AvalonMMMasterInterface.cc:90
NetlistPort.hh
AvalonMMMasterInterface::AVALON_MM_IRQ_RECV
static const TCEString AVALON_MM_IRQ_RECV
Definition: AvalonMMMasterInterface.hh:63
AvalonMMMasterInterface::writeInterface
virtual void writeInterface(std::ostream &stream) const
Definition: AvalonMMMasterInterface.cc:124
SOPCInterface::name
TCEString name() const
Definition: SOPCInterface.cc:98
AvalonMMMasterInterface::masterPorts_
PortList masterPorts_
Definition: AvalonMMMasterInterface.hh:77
AvalonMMMasterInterface::childInterfaces_
std::vector< SOPCInterface * > childInterfaces_
Definition: AvalonMMMasterInterface.hh:81
AvalonMMMasterInterface::AVALON_MM_RDATA
static const TCEString AVALON_MM_RDATA
Definition: AvalonMMMasterInterface.hh:58
AvalonMMMasterInterface::WRITE_DEF_WIDTH
static const int WRITE_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:87
AvalonMMMasterInterface
Definition: AvalonMMMasterInterface.hh:39
TCEString
Definition: TCEString.hh:53
AvalonMMMasterInterface::AvalonMMMasterInterface
AvalonMMMasterInterface(const TCEString &name, const TCEString &declaration, const TCEString &avalonPrefix, const SOPCInterface &clock)
Definition: AvalonMMMasterInterface.cc:54
ProGe::NetlistPort
Definition: NetlistPort.hh:70
AvalonMMMasterInterface::ADDRESS_DEF_WIDTH
static const int ADDRESS_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:83
AvalonMMMasterInterface::IRQ_RECV_DEF_WIDTH
static const int IRQ_RECV_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:90
AvalonMMMasterInterface::WAIT_REQ_DEF_WIDTH
static const int WAIT_REQ_DEF_WIDTH
Definition: AvalonMMMasterInterface.hh:89
AvalonMMMasterInterface::clock_
const SOPCInterface * clock_
Definition: AvalonMMMasterInterface.hh:80
ProGe::Direction
Direction
Direction of the port.
Definition: ProGeTypes.hh:52
AvalonMMMasterInterface::AVALON_MM_WAIT_REQ
static const TCEString AVALON_MM_WAIT_REQ
Definition: AvalonMMMasterInterface.hh:62