projects
/
ieee754fpu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move connect_out function to NextControl
[ieee754fpu.git]
/
src
/
add
/
example_buf_pipe.py
diff --git
a/src/add/example_buf_pipe.py
b/src/add/example_buf_pipe.py
index 411380016839dadf96ec9e5b390419236d7130df..568c7c692b901c69ef592708fa1d7f57bed2a052 100644
(file)
--- a/
src/add/example_buf_pipe.py
+++ b/
src/add/example_buf_pipe.py
@@
-88,6
+88,15
@@
class NextControl:
eq(nxt.data, self.data),
]
eq(nxt.data, self.data),
]
+ def connect_out(self, nxt):
+ """ helper function to connect stage to an output source. do not
+ use to connect stage-to-stage!
+ """
+ return [nxt.o_valid.eq(self.o_valid),
+ self.i_ready.eq(nxt.i_ready),
+ eq(nxt.data, self.data),
+ ]
+
def eq(o, i):
if not isinstance(o, Sequence):
def eq(o, i):
if not isinstance(o, Sequence):
@@
-151,7
+160,6
@@
class BufferedPipeline:
def connect_to_next(self, nxt):
""" helper function to connect to the next stage data/valid/ready.
def connect_to_next(self, nxt):
""" helper function to connect to the next stage data/valid/ready.
- data/valid is passed *TO* nxt, and ready comes *IN* from nxt.
"""
return self.n.connect_to_next(nxt.p)
"""
return self.n.connect_to_next(nxt.p)
@@
-165,10
+173,7
@@
class BufferedPipeline:
""" helper function to connect stage to an output source. do not
use to connect stage-to-stage!
"""
""" helper function to connect stage to an output source. do not
use to connect stage-to-stage!
"""
- return [nxt.n.o_valid.eq(self.n.o_valid),
- self.n.i_ready.eq(nxt.n.i_ready),
- eq(nxt.n.data, self.n.data),
- ]
+ return self.n.connect_out(nxt.n)
def set_input(self, i):
""" helper function to set the input data
def set_input(self, i):
""" helper function to set the input data