projects
/
ieee754fpu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
51fd121
)
split out data creation to new_data function
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Mon, 29 Apr 2019 02:21:25 +0000
(
03:21
+0100)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Mon, 29 Apr 2019 02:21:25 +0000
(
03:21
+0100)
src/add/iocontrol.py
patch
|
blob
|
history
diff --git
a/src/add/iocontrol.py
b/src/add/iocontrol.py
index a6a94bc4031bb02dacb8079c54fc18dee873a474..ea5bc43e4f24950b45e49f7d737e5cae25488e32 100644
(file)
--- a/
src/add/iocontrol.py
+++ b/
src/add/iocontrol.py
@@
-459,8
+459,13
@@
class ControlBase(Elaboratable):
# set up the input and output data
if stage is not None:
# set up the input and output data
if stage is not None:
- self.p.data_i = _spec(stage.ispec, "data_i") # input type
- self.n.data_o = _spec(stage.ospec, "data_o") # output type
+ self._new_data(self, self, "data")
+
+ def _new_data(self, p, n, name):
+ """ allocates new data_i and data_o
+ """
+ self.p.data_i = _spec(p.stage.ispec, "%s_i" % name)
+ self.n.data_o = _spec(n.stage.ospec, "%s_o" % name)
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.
@@
-528,14
+533,11
@@
class ControlBase(Elaboratable):
pipe2 = pipechain[i+1]
eqs += pipe1.connect_to_next(pipe2)
pipe2 = pipechain[i+1]
eqs += pipe1.connect_to_next(pipe2)
- # connect front of chain to ourselves
+ # connect front
and back
of chain to ourselves
front = pipechain[0]
front = pipechain[0]
- self.p.data_i = _spec(front.stage.ispec, "chainin")
- eqs += front._connect_in(self)
-
- # connect end of chain to ourselves
end = pipechain[-1]
end = pipechain[-1]
- self.n.data_o = _spec(end.stage.ospec, "chainout")
+ self._new_data(front, end, "chain") # NOTE: REPLACES existing data
+ eqs += front._connect_in(self)
eqs += end._connect_out(self)
return eqs
eqs += end._connect_out(self)
return eqs