summaryrefslogtreecommitdiff
path: root/python/openvino/demo/ip/intel_ai_ip/verilog/dla_aux_activation_if.sv
blob: d77ac47a06642d9b3196fab87a8f85628782c269 (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
88
89
90
91
92
93
94
95
96
// 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.

`include "dla_aux_activation_constants.svh"

interface control_to_param_cache_if #(
  dla_aux_activation_pkg::aux_special_params_t special_params,
  dla_aux_activation_pkg::aux_data_pack_params_t data_pack_params
);
  localparam PARAM_CACHE_DEPTH    = special_params.PARAM_CACHE_DEPTH;
  localparam PARAM_CACHE_ADDR_RAW = $clog2(PARAM_CACHE_DEPTH);                              // number of address bits for m20k
  localparam PARAM_CACHE_ADDR     = (PARAM_CACHE_ADDR_RAW < 2) ? 2 : PARAM_CACHE_ADDR_RAW;  // minimum size of lfsr
  typedef struct packed {
      logic wr_valid;
      logic [PARAM_CACHE_ADDR-1:0] wr_addr;
      logic [data_pack_params.VECTOR_SIZE-1:0][PARAM_WIDTH-1:0]  wr_data;

      logic rd_ready;
      logic [PARAM_CACHE_ADDR-1:0] rd_addr;
  } Type;
  Type data;
  modport sender (output data);
  modport receiver (input data);
endinterface

interface param_cache_to_control_if #(
  dla_aux_activation_pkg::aux_special_params_t special_params,
  dla_aux_activation_pkg::aux_data_pack_params_t data_pack_params
);
  typedef struct packed {
    logic wr_ready;

    logic rd_valid;
    logic [data_pack_params.VECTOR_SIZE-1:0][PARAM_WIDTH-1:0]  rd_data;
  } Type;
  Type data;
  modport sender (output data);
  modport receiver (input data);
endinterface

// Port structure from config to control
interface activation_config_to_control_if #(
  dla_aux_activation_pkg::aux_special_params_t special_params,
  dla_interface_pkg::aux_data_pack_params_t data_pack_params,
  int DIM1 = 1,
  int DIM2 = 1
);
  typedef struct packed {
// ------------------------------ START EDITING ------------------------------
    logic [data_pack_params.VECTOR_SIZE-1:0][PARAM_WIDTH-1:0]  param;
    logic param_valid;

    logic cmd_valid;
    logic [$clog2(special_params.MAX_TILE_CHANNELS  +1)-1:0]  tile_channels;
    logic [$clog2(special_params.MAX_TILE_HEIGHT +1)-1:0]     tile_height;
    logic [$clog2(special_params.MAX_TILE_WIDTH  +1)-1:0]     tile_width;
    logic [OPERAND_WIDTH-1:0] operand;
// ------------------------------  END EDITING  ------------------------------
  } Type;
  Type data [DIM1][DIM2];
  modport sender (output data);
  modport receiver (input data);
endinterface

// Port structure from control to lane(s)
interface activation_control_to_lane_if #(
  dla_aux_activation_pkg::aux_special_params_t special_params,
  dla_interface_pkg::aux_data_pack_params_t data_pack_params,
  int DIM1 = 1,
  int DIM2 = 1
);
  typedef struct packed {
// ------------------------------ START EDITING ------------------------------
    logic [data_pack_params.VECTOR_SIZE-1:0][PARAM_WIDTH-1:0]  param;
    logic bypass_clamp;                    // bypass the CLAMP block if present
    logic bypass_round_clamp;              // bypass the ROUND_CLAMP block if present
    logic bypass_prelu;                    // bypass the PReLU block if present
    logic bypass_continuous_activations;   // bypass the ContinuousActivations block if present
    logic lrelu_mode;                      // use the PReLU hardware block in LReLU mode (duplicate single parameter)
    logic ready;                           // signal provided to the input buffer to stall
// ------------------------------  END EDITING  ------------------------------
  } Type;
  Type data [DIM1][DIM2];
  modport sender (output data);
  modport receiver (input data);
endinterface