With SpeakHDL, signal assignments must be made with a VHDL when-else statement and must be placed outside of a process construct. These constraints placed on signal assignments are by design and are part of the productivity strategy to separate combinatorial logic from registered logic. When-else signal assignments are not nearly as flexable as signal assignments that could be made inside a process using a if-then-else statement. However, SpeakHDL does not allow 'if-then-else' statements. It is the lack of flexibility which makes the when-else statement less prone to the abuse and ultimately much easier to debug during simulation.
For SpeakHDL, the when-else construct is flexible enough to model (3) of the most interesting signal assignment use cases including:
SpeakHDL automatically creates a declaration for both I\O and local signals when a signal assignment is made. Because SpeakHDL only attempts to resolve VHDL std_logic, std_logic_vector and integer data types, it is possible to incorporate a reasonable number conventions into the command syntax to automatically create a signal declaration. In general, hotkey sequences for I\O signals follow the same command syntax for a local signal declaration. However, there are a few important differences:
1) Local signals can be of integer but I\O signals must be either std_logic or std_logic_vector.
2) Commands for I\O signal must be preceded with a keyword input, output or io.
3) Users must define FPGA pin location for an I/O signal.
4) Declaration aliases for I\O signals are handled as alias entries in the config file whereas local signals are handled as normal VHDL signal declarations.
SpeakHDL follows the following command conventions when declaring and selection of signals depending on their type. If the VHDL identifier does not exist when the sequence is made, SpeakHDL makes a declaration and a selection of the signal. Otherwise, SpeakHDL makes a selection.
VHDL TYPE | HOTKEY COMMAND SYNTAX | EXAMPLE | AUTOMATIC DECLARATION |
---|---|---|---|
std_logic | valid VHDL identifier followed by semicolon | sim_card_en; | signal sim_card_en : std_logic; |
std_logic_vector | valid VHDL identifier followed by downto range | data_vector(7 downto 0) | signal data_vector : std_logic_vector(7 downto 0); |
std_logic_vector | valid VHDL identifier followed by shorthand range | data_vector7:3 | signal data_vector : std_logic_vector(7 downto 3); |
integer | valid VHDL identifier with suffix _i | edge_count_i | signal edge_count_i: integer; |
Voice and Hotkey Commands: