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

    Modified by 2015.06.01

    Design

    ErosionDilationBin

    Version
    1.0


    Modified
    2015-05-24


    Source

    ErosionDilationBin


    IP-GUI

    ErosionDilationBin IP-GUI


    Function

    Erosion or Dilation for binary images.
    It will give the first output after pipe_stage cycles while in_enable enable.


    Files

    Name Function
    ErosionDilationBin.v Main module
    ErosionDilationBin_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.
    window_width unsigned 2 - 15 3 The width(and height) of window.
    pipe_stage unsigned Depend on width of window, log2(window_width^2) 3 Stage of pipe.


    Ports

    Name Port Type Range Default Description
    clk input unsigned None None Clock.
    rst_n input unsigned None None Reset, active low.
    mode input unsigned 0 for Erosion, 1 for Dilation. None Operation's mode.
    template input unsigned window_width * window_width - 1 : 0 None Template for operation.
    in_enable input unsigned None None Input data enable, in pipeline mode, it works as another rst_n, in req-ack mode, only it is high will in_data can be really changes.
    in_data input unsigned window_width * window_width - 1 : 0 None Input data, it must be synchronous with in_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
    Left is erosion, right is dilation

    Results
    Left is opening, right is closing

    PSNR

    1-Dilation-110110000 1-Dilation-111111000 1-Erosion-110110000 1-Erosion-111111000 2-Dilation-110110000 2-Dilation-111111000 2-Erosion-110110000 2-Erosion-111111000 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
    38 17


    Timing

    For 3x3 window.

    The max Data Path Delay is 2.529ns, so:

    FMax = 395.41MHz


    Thanks

    The sources of images for simulations:
    LM7-アイカツ
    ぜろきち-Blue star