AHDL



D (DFF DFFE) If Then lpm_counter.

ahdlcnt.tdf, , 16- , .

 

SUBDESIGN ahdlcnt

(

clk, load, ena, clr, d[15..0] : INPUT;

q[15..0] : OUTPUT;

)

VARIABLE

count[15..0] : DFF;

BEGIN

count[].clk = clk;

count[].clrn = !clr;

 

IF load THEN

count[].d = d[];

ELSIF ena THEN

count[].d = count[].q + 1;

ELSE

count[].d = count[].q;

END IF;

 

q[] = count[];

END;

 

Variable

16 count0 count15. If Then

, Clock.

lpm_cnt.tdf, , lpm_counter , ahdlcnt.tdf.

 

INCLUDE "lpm_counter.inc";

SUBDESIGN lpm_cnt

(

clk, load, ena, clr, d[15..0] : INPUT;

q[15..0] : OUTPUT;

)

VARIABLE

my_cntr: lpm_counter WITH (LPM_WIDTH=16);

 

BEGIN

my_cntr.clock = clk;

my_cntr.aload = load;

my_cntr.cnt_en = ena;

my_cntr.aclr = clr;

my_cntr.data[] = d[];

q[] = my_cntr.q[];

END;