the probelem may be the "`define",i think
pls refer to the following code,maybe you can revise ur code refer to it,
to be simple,u can just instantiate 'self_check' only once to see if it can work?
AS UR REFERENCE !
module tm1
#(parameter N = 4)
(
clk,rst_n,
pout
);
input clk;
input rst_n;
output[M:0] pout;
localparam M = N-1;
reg[M:0] cnt;
always @(posedge clk or negedge rst_n)
if(!rst_n) cnt <= 0;
else cnt <= cnt+1'b1;
assign pout = cnt;
endmodule
module lvdsprj(
clk,rst_n,
pout
);
input clk;
input rst_n;
output[M:0] pout;
localparam N = 5;
localparam M = N-1;
tm1 #(.N(5))
uut1(
.clk(clk),
.rst_n(rst_n),
.pout(pout)
);
endmodule