summaryrefslogtreecommitdiff
path: root/python/openvino/demo/ip/intel_ai_ip/verilog/dla_aux_pool_if.sv
blob: 31e03eaee9b8dea5a73925225ab310bd556a5453 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Copyright 2021-2021 Intel Corporation.
//
// This software and the related documents are Intel copyrighted materials,
// and your use of them is governed by the express license under which they
// were provided to you ("License"). Unless the License provides otherwise,
// you may not use, modify, copy, publish, distribute, disclose or transmit
// this software or the related documents without Intel's prior written
// permission.
//
// This software and the related documents are provided as is, with no express
// or implied warranties, other than those that are expressly stated in the
// License.

// Port structure from config to control
interface pool_config_to_control_if #(
  dla_aux_pool_pkg::aux_special_params_t special_params,
  dla_interface_pkg::aux_data_pack_params_t data_pack_params,
  int DIM1 = 1,
  int DIM2 = 1
);
// ------------------------------ START EDITING ------------------------------
  localparam TILE_COUNT             = data_pack_params.GROUP_SIZE * data_pack_params.GROUP_NUM;
  localparam CONFIG_ID_BITS         = special_params.CONFIG_ID_WIDTH                  ;
  localparam WINDOW_BITS_VERTICAL   = $clog2(special_params.MAX_WINDOW_HEIGHT     + 1);
  localparam WINDOW_BITS_HORIZONTAL = $clog2(special_params.MAX_WINDOW_WIDTH      + 1);
  localparam STRIDE_BITS_VERTICAL   = $clog2(special_params.MAX_STRIDE_VERTICAL   + 1);
  localparam STRIDE_BITS_HORIZONTAL = $clog2(special_params.MAX_STRIDE_HORIZONTAL + 1);
  localparam TILE_BITS_VERTICAL     = $clog2(special_params.MAX_TILE_HEIGHT       + 1);
  localparam TILE_BITS_HORIZONTAL   = $clog2(special_params.MAX_TILE_WIDTH        + 1);
  localparam TILE_BITS_DEPTHWISE    = $clog2(special_params.MAX_TILE_CHANNELS     + 1);
  localparam ELEMENT_BITS           = data_pack_params.ELEMENT_BITS                   ;
// ------------------------------  END EDITING  ------------------------------

  typedef struct packed {
// ------------------------------ START EDITING ------------------------------
    logic                                               configured           ;
    //
    logic                                               padding_ignore       ;
    logic                  [                       1:0] padding_mode         ;
    logic                  [          ELEMENT_BITS-1:0] padding_constant     ;
    logic [TILE_COUNT-1:0] [  TILE_BITS_HORIZONTAL-1:0] tile_horizontal_end  ;
    logic [TILE_COUNT-1:0] [  TILE_BITS_HORIZONTAL-1:0] tile_horizontal_start;
    logic [TILE_COUNT-1:0] [    TILE_BITS_VERTICAL-1:0] tile_vertical_end    ;
    logic [TILE_COUNT-1:0] [    TILE_BITS_VERTICAL-1:0] tile_vertical_start  ;
    logic                  [   TILE_BITS_DEPTHWISE-1:0] tile_channels        ;
    logic                  [  TILE_BITS_HORIZONTAL-1:0] tile_width           ;
    logic                  [    TILE_BITS_VERTICAL-1:0] tile_height          ;
    logic                  [STRIDE_BITS_HORIZONTAL-1:0] stride_horizontal    ;
    logic                  [  STRIDE_BITS_VERTICAL-1:0] stride_vertical      ;
    logic                  [WINDOW_BITS_HORIZONTAL-1:0] window_width         ;
    logic                  [  WINDOW_BITS_VERTICAL-1:0] window_height        ;
    logic                  [        CONFIG_ID_BITS-1:0] config_id            ;
// ------------------------------  END EDITING  ------------------------------
  } Type;
  Type data [DIM1][DIM2];
  modport sender (output data);
  modport receiver (input data);
endinterface

// Port structure from control to lane(s)
interface pool_control_to_lane_if #(
  dla_aux_pool_pkg::aux_special_params_t special_params,
  dla_interface_pkg::aux_data_pack_params_t data_pack_params,
  int DIM1 = 1,
  int DIM2 = 1
);
  localparam TILE_COUNT = data_pack_params.GROUP_SIZE * data_pack_params.GROUP_NUM;
  typedef struct packed {
    // only the handshake signal 'ready' is fixed in this structure, which is used by control to
    // signal that the core is not stalled
    logic ready;
// ------------------------------ START EDITING ------------------------------
    logic line_buff_flush;
    logic line_buff_wait_fill;
    logic is_padding_zone_vert;
    logic is_padding_zone_horiz;
    logic [TILE_COUNT-1:0] [special_params.MAX_WINDOW_HEIGHT-1:0] en_pad_nan_vert  ;
    logic [TILE_COUNT-1:0] [special_params.MAX_WINDOW_HEIGHT-1:0] en_pad_zero_vert ;
    logic [TILE_COUNT-1:0] [special_params.MAX_WINDOW_WIDTH -1:0] en_pad_nan_horiz ;
    logic [TILE_COUNT-1:0] [special_params.MAX_WINDOW_WIDTH -1:0] en_pad_zero_horiz;
    logic stride_valid;
// ------------------------------  END EDITING  ------------------------------
  } Type;
  Type data [DIM1][DIM2];
  modport sender (output data);
  modport receiver (input data);
endinterface