framebuffer/vtg: fix dataflow control (inc. WA for Migen bug - FIXME)

This commit is contained in:
Sebastien Bourdeauducq 2012-07-01 21:45:52 +02:00
parent 7bf5461ac0
commit fc458a51c9
1 changed files with 5 additions and 7 deletions

View File

@ -119,15 +119,14 @@ class VTG(Actor):
self.token("dac").b.eq(self.token("pixels").b[skip:]) self.token("dac").b.eq(self.token("pixels").b[skip:])
), ),
generate_en.eq(self.endpoints["timing"].stb & self.endpoints["dac"].ack \ generate_en.eq(self.endpoints["timing"].stb & (~active | self.endpoints["pixels"].stb)),
& (~active | self.endpoints["pixels"].stb)),
self.endpoints["pixels"].ack.eq(self.endpoints["dac"].ack & active), self.endpoints["pixels"].ack.eq(self.endpoints["dac"].ack & active),
self.endpoints["dac"].stb.eq(generate_en) self.endpoints["dac"].stb.eq(generate_en)
] ]
tp = self.token("timing") tp = self.token("timing")
sync = [ sync = [
self.endpoints["timing"].ack.eq(0), self.endpoints["timing"].ack.eq(0),
If(generate_en, If(generate_en & self.endpoints["dac"].ack,
hcounter.eq(hcounter + 1), hcounter.eq(hcounter + 1),
If(hcounter == 0, hactive.eq(1)), If(hcounter == 0, hactive.eq(1)),
@ -138,6 +137,8 @@ class VTG(Actor):
hcounter.eq(0), hcounter.eq(0),
If(vcounter == tp.vscan, If(vcounter == tp.vscan,
vcounter.eq(0) vcounter.eq(0)
# FIXME: work around Flow bug
#self.endpoints["timing"].ack.eq(1)
).Else( ).Else(
vcounter.eq(vcounter + 1) vcounter.eq(vcounter + 1)
) )
@ -146,10 +147,7 @@ class VTG(Actor):
If(vcounter == 0, vactive.eq(1)), If(vcounter == 0, vactive.eq(1)),
If(vcounter == tp.vres, vactive.eq(0)), If(vcounter == tp.vres, vactive.eq(0)),
If(vcounter == tp.vsync_start, self.token("dac").vsync.eq(1)), If(vcounter == tp.vsync_start, self.token("dac").vsync.eq(1)),
If(vcounter == tp.vsync_end, If(vcounter == tp.vsync_end, self.token("dac").vsync.eq(0))
self.token("dac").vsync.eq(0),
self.endpoints["timing"].ack.eq(1)
)
) )
] ]