Detailed Module with Inverted Outputs
As this example shows, using device independence and pin-to-pin description
methods is desirable, since you can describe a circuit completely for any
implementation. Using pin-to-pin descriptions and generalized dot extensions (such as
.FB, .CLK and .OE) as much as possible allows you to implement your ABEL-HDL
module into any one of a particular class of devices. (For example, any device
that features enough flip-flops and appropriately configured I/O resources.)
However, the need for particular types of device features (such as register preset
or reset) might limit your ability to describe your design in a completely
architecture-independent way.
If, for example, a built-in register preset feature is used in a simple
design, the target architectures are limited. Consider this version of the design:
Using .ASET instead of .AP can solve this problem if the fitter being used
supports the .ASET dot extension.
The versions 5 and 7 of the design above and below are unambiguous, but each
is restricted to certain classes of devices:
Q1 pin istype 'reg_D,invert';
Clock,Preset pin;
equations
Q1.CLK = Clock;
!Q1.D = Q1.Q # Preset;
test_vectors ([Clock,Preset] -> Q1)
[ .c. , 1 ] -> 1;
[ .c. , 0 ] -> 0;
[ .c. , 0 ] -> 1;
[ .c. , 0 ] -> 0;
[ .c. , 1 ] -> 1;
[ .c. , 1 ] -> 1;
end
Q1 pin istype 'reg,buffer';
Clock,Preset pin;
equations
Q1.CLK = Clock;
Q1.AP = Preset;
Q1 := !Q1.fb ;
test_vectors ([Clock,Preset] -> Q1)
[ .c. , 1 ] -> 1;
[ .c. , 0 ] -> 0;
[ .c. , 0 ] -> 1;
[ .c. , 0 ] -> 0;
[ .c. , 1 ] -> 1;
[ .c. , 1 ] -> 1;
end
Q1 pin istype 'reg,invert';
Clock,Preset pin;
equations
Q1.CLK = Clock;
Q1.AR = Preset;
Q1 := !Q1.fb ;
test_vectors ([Clock,Preset] -> Q1)
[ .c. , 1 ] -> 1;
[ .c. , 0 ] -> 0;
[ .c. , 0 ] -> 1;
[ .c. , 0 ] -> 0;
[ .c. , 1 ] -> 1;
[ .c. , 1 ] -> 1;
end