forked from M-Labs/artiq-zynq
frameline GW: update docs
This commit is contained in:
parent
144dfd89de
commit
e6654a2dff
@ -432,13 +432,17 @@ class Pixel_Gearbox(Module):
|
|||||||
# sink_dw * i > size * j > source_dw * k
|
# sink_dw * i > size * j > source_dw * k
|
||||||
# where i,k are postive integers and source_dw * k - sink_dw * (i-1) > 0
|
# where i,k are postive integers and source_dw * k - sink_dw * (i-1) > 0
|
||||||
#
|
#
|
||||||
# For example size == 10
|
|
||||||
# 32 * 2 > 10 * (5) > 40 * 1
|
|
||||||
# 32 * 2 > 10 * (6) > 40 * 1
|
|
||||||
# 32 * 3 > 10 * (9) > 40 * 2
|
|
||||||
stb_aligned = Signal()
|
stb_aligned = Signal()
|
||||||
match size:
|
match size:
|
||||||
case 10:
|
case 10:
|
||||||
|
# For example size == 10
|
||||||
|
# 32 * 2 > 10 * (5) > 40 * 1
|
||||||
|
# 32 * 2 > 10 * (6) > 40 * 1
|
||||||
|
# 32 * 3 > 10 * (9) > 40 * 2
|
||||||
|
# ...
|
||||||
|
#
|
||||||
|
# the packing pattern for size == 10 repeat every 16 pixels
|
||||||
|
# the remaining special case can be taken care off using modulo operation
|
||||||
stb_cases = {
|
stb_cases = {
|
||||||
5: stb_aligned.eq(1),
|
5: stb_aligned.eq(1),
|
||||||
6: stb_aligned.eq(1),
|
6: stb_aligned.eq(1),
|
||||||
@ -598,8 +602,8 @@ class ROI(Module):
|
|||||||
ROI Engine. For each frame, accumulates pixels values within a
|
ROI Engine. For each frame, accumulates pixels values within a
|
||||||
rectangular region of interest, and reports the total.
|
rectangular region of interest, and reports the total.
|
||||||
"""
|
"""
|
||||||
def __init__(self, pixel_4x, count_len):
|
def __init__(self, pixel_4x, count_width):
|
||||||
assert count_len <= 31
|
assert count_width <= 32
|
||||||
assert len(pixel_4x) == 4
|
assert len(pixel_4x) == 4
|
||||||
|
|
||||||
self.cfg = Record([
|
self.cfg = Record([
|
||||||
@ -611,7 +615,7 @@ class ROI(Module):
|
|||||||
|
|
||||||
self.out = Record([
|
self.out = Record([
|
||||||
("update", 1),
|
("update", 1),
|
||||||
("count", count_len),
|
("count", count_width),
|
||||||
])
|
])
|
||||||
|
|
||||||
# # #
|
# # #
|
||||||
@ -624,7 +628,7 @@ class ROI(Module):
|
|||||||
("y_good", 1),
|
("y_good", 1),
|
||||||
("gray", len(pixel_4x[0].gray)),
|
("gray", len(pixel_4x[0].gray)),
|
||||||
("stb", 1),
|
("stb", 1),
|
||||||
("count", count_len),
|
("count", count_width),
|
||||||
]))
|
]))
|
||||||
|
|
||||||
|
|
||||||
@ -737,7 +741,7 @@ class Frame_Deserializer(Module):
|
|||||||
|
|
||||||
class ROI_Pipeline(Module):
|
class ROI_Pipeline(Module):
|
||||||
# largest x/y pixel size supported by frame header are 24 bits
|
# largest x/y pixel size supported by frame header are 24 bits
|
||||||
def __init__(self, res_width=24):
|
def __init__(self, res_width, count_width):
|
||||||
|
|
||||||
# NOTE: csr need to stay outside since this module need to be cdr in the CXP_FRAME_Pipeline module
|
# NOTE: csr need to stay outside since this module need to be cdr in the CXP_FRAME_Pipeline module
|
||||||
# NOTE: TapGeo other than 1X-1Y are not supported
|
# NOTE: TapGeo other than 1X-1Y are not supported
|
||||||
@ -748,7 +752,7 @@ class ROI_Pipeline(Module):
|
|||||||
self.submodules.header_decoder = header_decoder = Frame_Header_Decoder()
|
self.submodules.header_decoder = header_decoder = Frame_Header_Decoder()
|
||||||
self.submodules.deserializer = deserializer = Frame_Deserializer(res_width)
|
self.submodules.deserializer = deserializer = Frame_Deserializer(res_width)
|
||||||
|
|
||||||
self.submodules.roi = ROI(deserializer.pixel4x, 31)
|
self.submodules.roi = ROI(deserializer.pixel4x, count_width)
|
||||||
|
|
||||||
self.comb += [
|
self.comb += [
|
||||||
deserializer.new_frame.eq(header_decoder.new_frame),
|
deserializer.new_frame.eq(header_decoder.new_frame),
|
||||||
|
Loading…
Reference in New Issue
Block a user