dol: initial dol commit
[jump.git] / dol / src / dol / datamodel / architecture / ReadPath.java
1 /* $Id: ReadPath.java 1 2010-02-24 13:03:05Z haidw $ */
2 package dol.datamodel.architecture;
3
4 import java.util.Vector;
5
6 import dol.visitor.ArchiVisitor;
7
8 /**
9  * This class defines a read path. A read path contains one processor,
10  * one rxbuf, one channel buf, and one or more hw channels.
11  */
12 public class ReadPath extends ArchiResource {
13     /**
14      * Constructor to create an architecture connection with a name.
15      *
16      */
17     public ReadPath(String name) {
18         super(name);
19         _hwChannelList = new Vector<HWChannel>();
20     }
21
22     /**
23      * Accept a Visitor.
24      *
25      * @param x visitor object
26      */
27     public void accept(ArchiVisitor x) {
28         x.visitComponent(this);
29     }
30
31     /**
32      * Clone this architectural connection.
33      *
34      * @return  a new instance of the architectural connection.
35      */
36     /*
37     @SuppressWarnings("unchecked")
38     public Object clone() {
39         ReadPath newObj = (ReadPath) super.clone();
40         newObj.setProcessor(_processor);
41         newObj.setRXBuf(_rxBuf);
42         newObj.setCHBuf(_chBuf);
43         newObj.setHWChannelNameList((Vector)_hwChannelNameList.clone());
44         return (newObj);
45     }
46     */
47
48     /**
49      * Return a string representation of the architectural connection.
50      *
51      * @return string representation of the architectural connection
52      */
53     public String toString() {
54         return "ReadPath: " + getName();
55     }
56
57     /**
58      * Return the memory where the receive buffer is located.
59      *
60      * @return name of memory
61      */
62     public Memory getRXBuf() { return _rxBuf; }
63
64     /**
65      * Set the receive buffer location.
66      *
67      * @param rxbuf rxbuf location
68      */
69     public void setRXBuf(Memory rxbuf) { _rxBuf = rxbuf; }
70
71     /**
72      * Return the memory where the channel buffer is located.
73      *
74      * @return channel buffer location
75      */
76     public Memory getCHBuf() { return _chBuf; }
77
78     /**
79      * Set the channel buffer location
80      *
81      * @param chbuf memory where channel buffer is located.
82      */
83     public void setCHBuf(Memory chbuf) { _chBuf = chbuf; }
84
85     /**
86      * Return the list of the HW channels.
87      *
88      * @return list of HW channels
89      */
90     public Vector<HWChannel> getHWChannelList() { return _hwChannelList; }
91
92     /**
93      * Return the processor to which this path is associated.
94      *
95      * @return processor
96      */
97     public Processor getProcessor() {
98         return _processor;
99     }
100
101     /**
102      * Set the processor to which this path is associated
103      *
104      * @param processor processor
105      */
106     public void setProcessor(Processor processor) {
107         _processor = processor;
108     }
109
110
111     protected Processor _processor;
112     protected Memory _rxBuf;
113     protected Memory _chBuf;
114     protected Vector<HWChannel> _hwChannelList;
115 }