serwb/scrambler: cleanup/fix potential bug

This commit is contained in:
Florent Kermarrec 2018-05-15 14:43:22 +02:00
parent 9347f6e00c
commit 520aade8fe
1 changed files with 11 additions and 10 deletions

View File

@ -98,16 +98,17 @@ class Descrambler(Module):
NextState("SYNC_DATA") NextState("SYNC_DATA")
) )
fsm.act("SYNC_DATA", fsm.act("SYNC_DATA",
If((sink.k[0] == 1) & If(sink.stb,
(sink.d[:8] == K(29,7)), If((sink.k == 1) & (sink.d == K(29,7)),
sink.ack.eq(1), sink.ack.eq(1),
descrambler.reset.eq(1) descrambler.reset.eq(1)
).Else( ).Else(
sink.ack.eq(source.ack), source.stb.eq(1),
source.stb.eq(sink.stb), source.data.eq(descrambler.o),
source.data.eq(descrambler.o), If(source.ack,
If(source.stb & source.ack, sink.ack.eq(1),
descrambler.ce.eq(1) descrambler.ce.eq(1)
)
) )
) )
) )