Use cases in Antares are programmed uses of a circuit using scripts. The script of a use case can be used to program simulated user interactions such as pressing a switch or the presence of a particular signal at an input port. The user of a circuit can start the programmed use cases and observe how the circuit behaves without having to interact with the circuit at the right time.
A simple example of use cases are the possible uses of an SR flip-flop, i.e. "Set" and "Reset". When setting, first both inputs "S" and "R" are set to 0 and then the input "S" is set to 1.
A more complex example is the execution of a specific machine instruction in a microprocessor without the microprocessor being built into a using circuit with ROM, RAM and timer. If, for example, a LODD (Load Direct) instruction is to be executed, the following must happen after starting simulation, depending on the microprocessor:
At address 0 of the (non-existent) program memory, the LODD command with the address of the memory cell to be read out must be present
The clock input of the microprocessor must provide changing signals with a not too large period.
The machine command LODD must be present on the data bus at the correct time.
The data of the read memory cell must be available on the data bus at the correct time.
With the Antares "Use Cases" feature, it is possible to define a use case "LODD" in the microprocessor circuitry that takes the right actions at the right time. The user, who has opened the microprocessor circuit, starts only this use case and can then observe how the microprocessor executes the machine instruction.
Execute use cases
The Antares simulation toolbar contains a selection box that offers all use cases defined in a circuit for execution.
When the user starts the execution of a use case, Antares automatically switches to simulation mode and starts the use case script. All possibilities of the simulation mode are available, such as controlling the simulation speed, single step mode or signal animation. If Scenarios are defined for the current circuit, they will also be applied and their descriptions will be displayed during the execution of the use case.
At the end of a use case execution, Antares remains in simulation mode.
For each use case, a test case can also be defined to check that the circuit functions correctly when this use case is executed.
A test case consists of a separate script that typically checks states of the circuit, e.g. whether an output has a certain value or whether an LED is lit. When executing a test case, Antares first executes the use case and then the test case script. For each test condition that is not met, Antares adds a new entry in the "Isses" view at the bottom of the main window.
Use cases of the open circuit are configured in the "Use Cases" sidebar that opens on the right side of the Antares window.
The sidebar contains a tree with all use cases (oval icon). When you select a node in the tree, the attributes of the use case are displayed in the properties view below it and are available for modification.
To add or delete use cases, select a node in the tree and perform an action from the main menu or the context menu (right mouse button).
- New Use Case
Context menu on the circuit node. After entering the name of the new use case (in the current language), it is added to the tree.
- Delete Use Case
Context menu on the use case node. After a confirmation prompt, the selected use case is deleted.
Context menu on the use case node. Starts the execution of the application case.
- Run Test
Context menu on the application case node, which is only active if a test case exists for the selected application case. Runs the use case and the test case script.
- Run all Tests
Context menu on the circuit node. Runs the tests of all use cases.
Attributes of use cases
The name of the use case that can be translated into all supported languages.
The description of the use case that can be translated into all supported languages. In the current version of Antares it is only used in the Properties View.
The script that contains the logic of the use case.Example
The script that contains the test conditions of the use case.Example