projects
/
soc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3d81a2
)
Present the ALU result only when valid_o is active
author
Cesar Strauss
<cestrauss@gmail.com>
Thu, 2 Jul 2020 08:55:59 +0000
(
05:55
-0300)
committer
Cesar Strauss
<cestrauss@gmail.com>
Thu, 2 Jul 2020 08:59:43 +0000
(
05:59
-0300)
This should help to catch latching of invalid data.
Also, better demonstrates the valid / ready protocol.
src/soc/experiment/alu_hier.py
patch
|
blob
|
history
diff --git
a/src/soc/experiment/alu_hier.py
b/src/soc/experiment/alu_hier.py
index 581fd11324d50a0fccf7814c0895a22ad53d5bbc..5dcf958ce320e05051b92fd6a0d9baf55d1d097c 100644
(file)
--- a/
src/soc/experiment/alu_hier.py
+++ b/
src/soc/experiment/alu_hier.py
@@
-268,7
+268,8
@@
class ALU(Elaboratable):
# choose between zero-delay output, or registered
with m.If(go_now):
m.d.comb += self.o.eq(sub.o)
- with m.Else():
+ # only present the result at the last computation cycle
+ with m.Elif(alu_done):
m.d.comb += self.o.eq(alu_r)
return m