Lola (computing)


Lola is a hardware description language for describing synchronous, digital circuits. Niklaus Wirth developed the language to teach digital design on field-programmable gate arrays to computer science students while a professor at ETH Zurich.
The purpose of Lola is to statically describe the structure and function of hardware components and of the connections between them. A Lola text is composed of declarations and statements. It describes digital electronics hardware on the logic gate level in the form of signal assignments. Signals are combined using operators and assigned to other signals. Signals and the respective assignments can be grouped together into data types. An instance of a type is a hardware component. Types can be composed of instances of other types, thereby supporting a hierarchical design style and they can be generic, e.g., parametrizable with the word width of a circuit.
All of the concepts mentioned above are demonstrated in the following example of a circuit for adding binary data. First, a fundamental building block is defined, then this is used to declare a cascade of word-width 8, and finally the s are connected to each other. The defined in this example can serve as a building block on a higher level of the design hierarchy.

MODULE Adder;
TYPE Cell;
IN x,y,ci:BIT;
OUT z,co:BIT;
BEGIN
z:=x-y-ci;
co:=x*y+x*ci+y*ci;
END Cell;
CONST N:=8;
IN X,Y:BIT; ci:BIT;
OUT Z:BIT; co:BIT;
VAR S:Cell;
BEGIN
S.0;
FOR i:=1..N-1 DO
S.i;
END;
FOR i:=0..N-1 DO
Z.i:=S.i.z;
END;
co:=S.7.co;
END Adder.

Wirth describes Lola from a user's perspective in his book . A complementary view on the details of the Lola compiler's implementation can be found in Wirth's technical report . An overview of the whole system of tools for digital design is the technical report .