• F-I-L
  • Wiki
  • Source
  • Contact
  • ThresholdLocal

    Modified by 2015.06.01

    Design

    ThresholdLocal

    Version
    1.0


    Modified
    2015-05-22


    Source

    ThresholdLocal


    IP-GUI

    ThresholdLocal IP-GUI


    Function

    Local thresholding by Threshold from filters.
    It will give the first output after 1 cycle while the tow input both enable.
    ref_enable must enable after in_enable !


    Files

    Name Function
    ThresholdLocal.v Main module
    ThresholdLocal_TB.sv Test bench


    Parameters

    Name Type Range Default Description
    work_mode unsigned 0 for Pipeline, 1 for Req-ack 0 This module's working mode.
    in_window_width unsigned 1 - 15 1 The width(and height) of input window, if input is not a window, set it to 1.
    color_width unsigned 1 - 12 8 Color's bit width.
    max_delay unsigned None 8 The possible max cycles from in_enable to ref_enable.
    max_delay_bits unsigned Depend on max delay 4 Width bits of max delay.


    Ports

    Name Port Type Range Default Description
    clk input unsigned None None Clock.
    rst_n input unsigned None None Reset, active low.
    in_enable input unsigned None None Filter's rank, if half of full size of window, this module working as median filter, etc.
    in_data input unsigned color_width * in_window_width * in_window_width - 1 : 0 None Input data, it must be synchronous with in_enable.
    ref_enable input unsigned None None Threshold enable.
    ref_data input unsigned color_width - 1 : 0 None Threshold, used as threshold for thresholding, it must be synchronous with ref_enable.
    out_ready output unsigned None None Output data ready, in both two mode, it will be high while the out_data can be read.
    out_data output unsigned None None Output data, it will be synchronous with out_ready.


    Simulations

    Simulations for this module just support Gray-scale images !

    Waves

    Pipeline mode

    Pipeline mode

    ReqAck mode

    ReqAck mode

    Original

    Original

    Results

    Results
    HDL functional simulation for pipeline mode is on the left, for req-ack mode is on the middle, and which on the right is the soft simulation

    Results
    Source from MeanFilter, left for 3x3 window, right for 5x5 window

    Results
    Source from MidFilter, left for 3x3 window, right for 5x5 window

    Results
    For 11x11 window, left from MeanFilter, right from MidFilter

    PSNR

    1-3-mean 1-3-mid 1-5-mean 1-5-mid 2-3-mean 2-3-mid 2-5-mean 2-5-mid Total
    1000000.00 1000000.00 1000000.00 1000000.00 1000000.00 1000000.00 1000000.00 1000000.00 1000000.00


    Utilization

    For 3x3 window.

    Slice LUTs* Slice Registers
    39 70


    Timing

    For 3x3 window.

    The max Data Path Delay is 3.187ns, so:

    FMax = 313.77MHz


    Thanks

    The sources of images for simulations:
    H2SO4-蝶
    パセリ-Favour