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

Merge branch 'feature/fmpadding_dynamic' into feature/fmpadding_dynamic_integration

parents 739026ca ff348d47
No related branches found
No related tags found
No related merge requests found
......@@ -70,6 +70,46 @@ module fmpadding #(
uwire clk = ap_clk;
uwire rst = !ap_rst_n;
//-----------------------------------------------------------------------
// Parameter Sanity Checking
initial begin
automatic bit fail = 0;
if(XCOUNTER_BITS < $clog2(1+INIT_XEND)) begin
$error("XCounter size too small to accommodate end count.");
fail = 1;
end
if(XCOUNTER_BITS < $clog2(1+INIT_XON)) begin
$error("XCounter size too small to accommodate ON count.");
fail = 1;
end
if(XCOUNTER_BITS < $clog2(1+INIT_XOFF)) begin
$error("XCounter size too small to accommodate OFF count.");
fail = 1;
end
if(YCOUNTER_BITS < $clog2(1+INIT_YEND)) begin
$error("YCounter size too small to accommodate end count.");
fail = 1;
end
if(YCOUNTER_BITS < $clog2(1+INIT_YON)) begin
$error("YCounter size too small to accommodate ON count.");
fail = 1;
end
if(YCOUNTER_BITS < $clog2(1+INIT_YOFF)) begin
$error("YCounter size too small to accommodate OFF count.");
fail = 1;
end
if((INIT_XEND < INIT_XON) || (INIT_XOFF <= INIT_XON)) begin
$warning("Initial empty X output range.");
end
if((INIT_YEND < INIT_YON) || (INIT_YOFF <= INIT_YON)) begin
$warning("Initial empty Y output range.");
end
if(fail) $finish();
end
//-----------------------------------------------------------------------
// Dynamically configurable state
typedef logic [XCOUNTER_BITS-1:0] xcount_t;
......
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