dol: initial dol commit
[jump.git] / dol / src / dol / datamodel / architecture / WritePath.java
diff --git a/dol/src/dol/datamodel/architecture/WritePath.java b/dol/src/dol/datamodel/architecture/WritePath.java
new file mode 100644 (file)
index 0000000..80244a7
--- /dev/null
@@ -0,0 +1,113 @@
+/* $Id: WritePath.java 1 2010-02-24 13:03:05Z haidw $ */
+package dol.datamodel.architecture;
+
+import java.util.Vector;
+
+import dol.visitor.ArchiVisitor;
+
+/**
+ * This class defines a write path. A write path contains one processor,
+ * one txbuf, one channel buf, and one or more hw channels.
+ */
+public class WritePath extends ArchiResource {
+    /**
+     * Constructor to create an architecture connection with a name.
+     */
+    public WritePath(String name) {
+        super(name);
+        _hwChannelList = new Vector<HWChannel>();
+    }
+
+    /**
+     * Accept a Visitor.
+     *
+     * @param x visitor object
+     */
+    public void accept(ArchiVisitor x) {
+        x.visitComponent(this);
+    }
+
+    /**
+     * Clone this architectural connection.
+     *
+     * @return  a new instance of the architectural connection.
+     */
+    /*
+    @SuppressWarnings("unchecked")
+    public Object clone() {
+        WritePath newObj = (WritePath) super.clone();
+        newObj.setProcessor(_processor);
+        newObj.setTXBuf(_txBuf);
+        newObj.setCHBuf(_chBuf);
+        newObj.setHWChannelNameList((Vector)_hwChannelNameList.clone());
+        return (newObj);
+    }
+    */
+
+    /**
+     * Return a string representation of the architectural connection.
+     *
+     * @return string representation of the architectural connection
+     */
+    public String toString() {
+        return "WritePath: " + getName();
+    }
+
+    /**
+     * Return the memory where the transmit buffer is located.
+     *
+     * @return name of memory
+     */
+    public Memory getTXBuf() { return _txBuf; }
+
+    /**
+     * Set the transmit buffer location.
+     *
+     * @param txbuf txbuf location
+     */
+    public void setTXBuf(Memory txbuf) { _txBuf = txbuf; }
+
+    /**
+     * Return the memory where the channel buffer is located.
+     *
+     * @return channel buffer location
+     */
+    public Memory getCHBuf() { return _chBuf; }
+
+    /**
+     * Set the channel buffer location
+     *
+     * @param chbuf memory where channel buffer is located.
+     */
+    public void setCHBuf(Memory chbuf) { _chBuf = chbuf; }
+
+    /**
+     * Return the list of the HW channels.
+     *
+     * @return list of HW channels
+     */
+    public Vector<HWChannel> getHWChannelList() { return _hwChannelList; }
+
+    /**
+     * Return the processor to which this path is associated.
+     *
+     * @return processor
+     */
+    public Processor getProcessor() {
+        return _processor;
+    }
+
+    /**
+     * Set the processor to which this path is associated.
+     *
+     * @param processor processor
+     */
+    public void setProcessor(Processor processor) {
+        _processor = processor;
+    }
+
+    protected Processor _processor;
+    protected Memory _txBuf;
+    protected Memory _chBuf;
+    protected Vector<HWChannel> _hwChannelList;
+}