Skip to content
Snippets Groups Projects
Commit ba9a45f0 authored by Thomas B. Preußer's avatar Thomas B. Preußer
Browse files

Added capability to custom-initialize dynamic parameter registers upon design configuration.

parent 03ccfb5e
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,14 @@ module fmpadding #(
int unsigned NUM_CHANNELS,
int unsigned SIMD,
int unsigned ELEM_BITS,
int unsigned INIT_XON,
int unsigned INIT_XOFF,
int unsigned INIT_XEND,
int unsigned INIT_YON,
int unsigned INIT_YOFF,
int unsigned INIT_YEND,
localparam int unsigned STREAM_BITS = 8*(1 + (SIMD*ELEM_BITS-1)/8)
)(
//- Global Control ------------------
......@@ -66,14 +74,15 @@ module fmpadding #(
//-----------------------------------------------------------------------
// Dynamically configurable state
typedef logic [XCOUNTER_BITS-1:0] xcount_t;
xcount_t XEnd = 0;
xcount_t XOn = 0;
xcount_t XOff = 0;
xcount_t XEnd = INIT_XEND;
xcount_t XOn = INIT_XON;
xcount_t XOff = INIT_XOFF;
typedef logic [YCOUNTER_BITS-1:0] ycount_t;
ycount_t YEnd = 0;
ycount_t YOn = 0;
ycount_t YOff = 0;
ycount_t YEnd = INIT_YEND;
ycount_t YOn = INIT_YON;
ycount_t YOff = INIT_YOFF;
always_ff @(posedge clk) begin
if(we) begin
unique case(wa)
......
......@@ -38,6 +38,14 @@ module fmpadding_axi #(
int unsigned NUM_CHANNELS,
int unsigned SIMD,
int unsigned ELEM_BITS,
int unsigned INIT_XON,
int unsigned INIT_XOFF,
int unsigned INIT_XEND,
int unsigned INIT_YON,
int unsigned INIT_YOFF,
int unsigned INIT_YEND,
localparam int unsigned STREAM_BITS = 8*(1 + (SIMD*ELEM_BITS-1)/8)
)(
//- Global Control ------------------
......@@ -101,6 +109,8 @@ module fmpadding_axi #(
fmpadding #(
.XCOUNTER_BITS(XCOUNTER_BITS), .YCOUNTER_BITS(YCOUNTER_BITS),
.NUM_CHANNELS(NUM_CHANNELS), .SIMD(SIMD),
.INIT_XON(INIT_XON), .INIT_XOFF(INIT_XOFF), .INIT_XEND(INIT_XEND),
.INIT_YON(INIT_YON), .INIT_YOFF(INIT_YOFF), .INIT_YEND(INIT_YEND),
.ELEM_BITS(ELEM_BITS)
) padding (
.ap_clk, .ap_rst_n,
......
......@@ -39,6 +39,8 @@ module fmpadding_axi_tb #(
.YCOUNTER_BITS(YCOUNTER_BITS),
.NUM_CHANNELS(NUM_CHANNELS),
.SIMD(SIMD),
.INIT_XON(0), .INIT_XOFF(0), .INIT_XEND(0),
.INIT_YON(0), .INIT_YOFF(0), .INIT_YEND(0),
.ELEM_BITS(ELEM_BITS)
) dut (
.ap_clk(clk), .ap_rst_n(!rst),
......
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