data/full_repos/permissive/214858095/FPGA_Exploration/spartan6/B205mini/ISE_Project/lib/rfnoc/core/chdr_compute_tkeep.v
 line:94: before: "("
1: b'%Error: data/full_repos/permissive/214858095/FPGA_Exploration/spartan6/B205mini/ISE_Project/lib/rfnoc/core/chdr_compute_tkeep.v:33: Cannot find include file: rfnoc_chdr_utils.vh\n  `include "rfnoc_chdr_utils.vh" \n           ^~~~~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/214858095/FPGA_Exploration/spartan6/B205mini/ISE_Project/lib/rfnoc/core,data/full_repos/permissive/214858095/rfnoc_chdr_utils.vh\n             data/full_repos/permissive/214858095/FPGA_Exploration/spartan6/B205mini/ISE_Project/lib/rfnoc/core,data/full_repos/permissive/214858095/rfnoc_chdr_utils.vh.v\n             data/full_repos/permissive/214858095/FPGA_Exploration/spartan6/B205mini/ISE_Project/lib/rfnoc/core,data/full_repos/permissive/214858095/rfnoc_chdr_utils.vh.sv\n             rfnoc_chdr_utils.vh\n             rfnoc_chdr_utils.vh.v\n             rfnoc_chdr_utils.vh.sv\n             obj_dir/rfnoc_chdr_utils.vh\n             obj_dir/rfnoc_chdr_utils.vh.v\n             obj_dir/rfnoc_chdr_utils.vh.sv\n%Error: Exiting due to 1 error(s)\n'
module chdr_compute_tkeep #(
  parameter CHDR_W = 256,
  parameter ITEM_W = 32
)(
  input  wire                       clk,
  input  wire                       rst,
  input  wire [CHDR_W-1:0]          axis_tdata,
  input  wire                       axis_tlast,
  input  wire                       axis_tvalid,
  input  wire                       axis_tready,
  output wire [(CHDR_W/ITEM_W)-1:0] axis_tkeep
);

  `include "rfnoc_chdr_utils.vh"

  generate if (CHDR_W > ITEM_W) begin 

    localparam CHDR_W_BYTES = CHDR_W/8;
    localparam ITEM_W_BYTES = ITEM_W/8;
    localparam KEEP_W       = CHDR_W_BYTES/ITEM_W_BYTES;






    function [KEEP_W-1:0] bin2thermo;
      input [$clog2(KEEP_W)-1:0] bin;
      bin2thermo = ~((~1)<<((bin-1)%KEEP_W));
    endfunction
  


    wire [15:0]       pkt_len    = chdr_get_length(axis_tdata[63:0]);
    wire [KEEP_W-1:0] len_thermo = bin2thermo(pkt_len[$clog2(CHDR_W_BYTES)-1:$clog2(ITEM_W_BYTES)]);
    reg  [KEEP_W-1:0] reg_len_thermo = 'h0;
    reg               is_header = 1'b1;

    always @(posedge clk) begin
      if (rst) begin
        is_header <= 1'b1;
      end else if (axis_tvalid & axis_tready) begin
        is_header <= axis_tlast;
        if (is_header) begin
          reg_len_thermo <= len_thermo;
        end
      end
    end



    assign axis_tkeep = (~axis_tlast) ? {KEEP_W{1'b1}} :
      (is_header ? len_thermo : reg_len_thermo);

  end else if (CHDR_W == ITEM_W) begin


    assign axis_tkeep = 1'b1;

  end else begin


    illegal_parameter_value item_w_cannot_be_larger_than_chdr_w();

  end endgenerate

endmodule
module chdr_compute_tkeep #(
  parameter CHDR_W = 256,
  parameter ITEM_W = 32
)(
  input  wire                       clk,
  input  wire                       rst,
  input  wire [CHDR_W-1:0]          axis_tdata,
  input  wire                       axis_tlast,
  input  wire                       axis_tvalid,
  input  wire                       axis_tready,
  output wire [(CHDR_W/ITEM_W)-1:0] axis_tkeep
);


  `include "rfnoc_chdr_utils.vh"

  generate if (CHDR_W > ITEM_W) begin 

    localparam CHDR_W_BYTES = CHDR_W/8;
    localparam ITEM_W_BYTES = ITEM_W/8;
    localparam KEEP_W       = CHDR_W_BYTES/ITEM_W_BYTES;






    function [KEEP_W-1:0] bin2thermo;
      input [$clog2(KEEP_W)-1:0] bin;
      bin2thermo = ~((~1)<<((bin-1)%KEEP_W));
    endfunction
  


    wire [15:0]       pkt_len    = chdr_get_length(axis_tdata[63:0]);
    wire [KEEP_W-1:0] len_thermo = bin2thermo(pkt_len[$clog2(CHDR_W_BYTES)-1:$clog2(ITEM_W_BYTES)]);
    reg  [KEEP_W-1:0] reg_len_thermo = 'h0;
    reg               is_header = 1'b1;

    always @(posedge clk) begin
      if (rst) begin
        is_header <= 1'b1;
      end else if (axis_tvalid & axis_tready) begin
        is_header <= axis_tlast;
        if (is_header) begin
          reg_len_thermo <= len_thermo;
        end
      end
    end



    assign axis_tkeep = (~axis_tlast) ? {KEEP_W{1'b1}} :
      (is_header ? len_thermo : reg_len_thermo);

  end else if (CHDR_W == ITEM_W) begin


    assign axis_tkeep = 1'b1;

  end else begin


    illegal_parameter_value item_w_cannot_be_larger_than_chdr_w();

  end endgenerate

endmodule