Download ABEL-HDL Reference Manual

Transcript
Pin-to-pin vs. Detailed Descriptions for Registered Designs
Versions 5 and 7 of the design above and below are unambiguous, but each is
restricted to certain device classes:
module Q1_7
Q1
pin
Clock,Preset
pin;
equations
Q1.CLK = Clock;
Q1.AR
= Preset;
Q1
:= !Q1.fb ;
test_vectors ([Clock,Preset]
[ .c. ,
1 ]
[ .c. ,
0 ]
[ .c. ,
0 ]
[ .c. ,
0 ]
[ .c. ,
1 ]
[ .c. ,
1 ]
end
istype 'reg,invert';
->
->
->
->
->
->
->
Q1)
1;
0;
1;
0;
1;
1;
When to Use Detailed Descriptions
Although the pin-to-pin description is preferable, there will frequently be situations
when you must use a more detailed description. If you are unsure about which
method to use for various parts of your design, examine the design's requirements. If
your design requires specific features of a device (such as register preset or unusual
flip-flop configurations), detailed descriptions are probably necessary. If your design
is a simple combinational function or if it matches the "generic" macrocell in its
requirements, you can probably use simple pin-to-pin descriptions.
Using := for Alternative Flip-flop Types
In ABEL-HDL you can specify a variety of flip-flop types using attributes such as
istype 'reg_D' and 'reg_JK'. However, these attributes do not enforce the use of a
specific type of flip-flop when a device is selected, and they do not affect the meaning
of the := assignment operator.
You can think of the := assignment operator as a memory operator. The type of
register that most closely matches the := assignment operator's behavior is the
D-type flip-flop.
The primary use for attributes such as istype 'reg_D', 'reg_JK' and 'reg_SR' is to
control the generation of logic. Specifying one of the 'reg_' attributes (for example,
istype 'reg_D') instructs the AHDL compiler to generate equations using the .D
extension regardless of whether the design was written using .D, := or some other
method (for example, state diagrams).
ABEL-HDL Reference Manual
72