forked from M-Labs/artiq
1
0
Fork 0

gateware/amp/mailbox: simplify

This commit is contained in:
Sebastien Bourdeauducq 2015-04-29 12:56:21 +08:00
parent e5f7fcc339
commit 9ecbb4c88d
1 changed files with 4 additions and 6 deletions

View File

@ -12,12 +12,10 @@ class Mailbox(Module):
value = Signal(32)
for i in self.i1, self.i2:
self.sync += [
i.ack.eq(0),
If(i.cyc & i.stb & ~i.ack, i.ack.eq(1)),
i.dat_r.eq(value),
If(i.cyc & i.stb & i.we,
[If(i.sel[j], value[j*8:j*8+8].eq(i.dat_w[j*8:j*8+8]))
for j in range(4)]
i.ack.eq(0),
If(i.cyc & i.stb & ~i.ack,
i.ack.eq(1),
If(i.we, value.eq(i.dat_w))
)
]