frameline GW: update docs

This commit is contained in:
morgan 2025-01-15 15:14:49 +08:00
parent 144dfd89de
commit e6654a2dff

View File

@ -432,13 +432,17 @@ class Pixel_Gearbox(Module):
# sink_dw * i > size * j > source_dw * k
# 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()
match size:
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 = {
5: 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
rectangular region of interest, and reports the total.
"""
def __init__(self, pixel_4x, count_len):
assert count_len <= 31
def __init__(self, pixel_4x, count_width):
assert count_width <= 32
assert len(pixel_4x) == 4
self.cfg = Record([
@ -611,7 +615,7 @@ class ROI(Module):
self.out = Record([
("update", 1),
("count", count_len),
("count", count_width),
])
# # #
@ -624,7 +628,7 @@ class ROI(Module):
("y_good", 1),
("gray", len(pixel_4x[0].gray)),
("stb", 1),
("count", count_len),
("count", count_width),
]))
@ -737,7 +741,7 @@ class Frame_Deserializer(Module):
class ROI_Pipeline(Module):
# 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: 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.deserializer = deserializer = Frame_Deserializer(res_width)
self.submodules.roi = ROI(deserializer.pixel4x, 31)
self.submodules.roi = ROI(deserializer.pixel4x, count_width)
self.comb += [
deserializer.new_frame.eq(header_decoder.new_frame),