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