Skip to content
Snippets Groups Projects
Commit 686a2505 authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[FIFO] expose FIFO count port

parent cd8a6c43
No related branches found
No related tags found
No related merge requests found
......@@ -110,6 +110,8 @@ class StreamingFIFO(HLSCustomOp):
]
# make instream width a multiple of 8 for axi interface
in_width = self.get_instream_width_padded()
count_width = int(self.get_nodeattr("depth") - 1).bit_length()
self.code_gen_dict["$COUNT_RANGE$"] = ["[{}:0]".format(count_width - 1)]
self.code_gen_dict["$IN_RANGE$"] = ["[{}:0]".format(in_width - 1)]
self.code_gen_dict["$OUT_RANGE$"] = ["[{}:0]".format(in_width - 1)]
self.code_gen_dict["$WIDTH$"] = [str(in_width)]
......
......@@ -408,6 +408,7 @@ strm_fifo_wrapper = """
module $TOPNAME$(
ap_clk,
ap_rst_n,
count,
in0_V_V_TDATA,
in0_V_V_TVALID,
in0_V_V_TREADY,
......@@ -418,6 +419,7 @@ out_V_V_TREADY
input ap_clk;
input ap_rst_n;
output $COUNT_RANGE$ count;
input $IN_RANGE$ in0_V_V_TDATA;
input in0_V_V_TVALID;
output in0_V_V_TREADY;
......@@ -433,6 +435,7 @@ $LAYER_NAME$
(
.clock(ap_clk),
.reset(!ap_rst_n),
.count(count),
.i_d(in0_V_V_TDATA),
.i_v(in0_V_V_TVALID),
.i_r(in0_V_V_TREADY),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment