Tutorial (Eng) | Navodila (Slovene)
This is a brief presentation of online digital circuit design educational tool with SHDL, a hardware description language based on simplified VHDL syntax. The tool is used to design small digital circuit models in a web browser (Chrome or Firefox), simulate the models with a graphical test bench and automatically convert to synthesizable VHDL.
A digital circuit model is described in simplified language SHDL. The model consists of entity name, signal declarations and statement block between begin in end. An example of 4-bit counter with count enable (en):
entity counter
en: in u1
cnt: out u4
begin
if (en) then
cnt <= cnt + 1
end
end
Begin describing the circut by setting circuit name and filling the model ports and signals table. Then click on New and the tool will generate circuit model declarations in the input editor. Exceptions are array and enumerated data types, which can not be declared in the model table.
The statement block contains signal assignment and conditional statements in simplified VHDL syntax. Statements present parts of a digital circuit operating in parallel (e.g. concurrent data-flow operations). The SHDL modeling rules:
=
describes combinational logic. A set of
VHDL-like operators is used for describing assigned expressions:
<=
describes sequential logic, where the assignment is
executed on rising edge of the clock. There is only one clock signal in the model, which is automatically inferred
when using sequential assignments (you should not define clk in circuit ports).sig = expression1 when condition else expression2;
if (condition) statement;
A click to Parse starts model analysis, parsing and transformation. The parser messages appear below the code editor. Successful parsing produces a message "Parse finished.", otherwise the error description appears.
Example: the code line cnt >= cnt + 1 outputs error:
Parse Error at 6:12: Expecting '='!
with information about error location (line 6, character 12) and description that the compiler expects
assignment operator.
The circuit model is transformed into internal descriprion presented in Analysis tab. Summary of the parsed circuit model resource estimation is available there. The model transformed to VHDL can be found in the VHDL tab. A click to copy is used to select and copy the generated code to clipboard for an easy transfer to external VHDL-based tools.
Parsing the model updates the simulation waveform with the signals from the model table. To prepare simulation, you have to enter the number of clock cycles and set the input signals. By clicking on the waveform of an one-bit input signal, the signal value toggles between zero and one. Multi-bit input signals are set to a given integer value by entering value into the form and clicking on the waveform.
The simulation is executed with a click on Run and we can immediately observe the resulting waveform. If you click Run next time, the simulation executes again, but this time starting from the last state of the circuit (this is important for sequential circuits). In order to start simulation from the reset state, you have to parse the model again and then click on Run.
Click on the input signal name to toggle the signal value in all cycles. Click on a signal with the right mouse button to change the waveform display from integer to binary, from binary to analog and from analog back to integer.