Program Operation

Program Operation

Overview

DLSim 3 is a platform for design and simulation of logical circuits. Circuits are built by adding components to the "circuit board", or design canvas. Components can be connected using single-bit or multi-bit (bus) connections. Endpoints (switches and bulbs) enable circuit simulation: switches can be turned on (1) or off (0); bulbs show their state by glowing (1) or not glowing (0).

Any circuit can be used as a subcircuit in another circuit. Subcircuits are displayed as rectangles containing pins corresponding to their switches and bulbs. One type of subcircuit, the card permits access to its structure for viewing and editing. Another, the chip, is opaque. A third type of subcircuit, the plug-in, is constructed as an extension to a Java class. Plug-ins may support Java Swing controls.

The Hierarchy and Subcircuit Windows present two views on the subcircuit structure of the current project. The Hierarchy Window shows the hierarchical structure of the subcircuits of the circuit currently in view while the Subcircuit Window provides a flat listing of all subcircuits in the project.

Projects

A DLSim 3 Project consists of a top-level circuit and all required subcircuits. Projects are stored in 2 file formats:

Circuit (.cct) files
Binary files that allow a project to be imported as a subcircuit in another project. See Subcircuits.
XML (.xml) files
Text-based XML descriptions.
It is recommended that all projects be stored in the XML format.

Loading and Saving Projects

To load a project select either File | Open Project (to load a circuit file) or File | Import XML Project (to load an XML file).

To save a project, you must first save it as a a circuit file, using File | Save Project or File | Save As. To save it as an XML file select File | Export XML Project.

To create a new project select File | New Project.

Tools

This section refers to items on the Tools menu (and, in 2 cases, the Toolbar).

Open Simulator
Opens the auxiliary simulator, described in Using the Simulator
Snap to Grid
Causes components to align to the gridpoints.
Turn off/on lights
( ) Toggles circuit board between light and dark background. Circuit state during a simulation is more visible against a dark background.
Turn off Power
( ) Turning off/on resets the state of the current circuit.
Lock Circuit
Freezes the circuit board; for demo use.
Applet Security
When you save a circuit for use with an applet, checking Tools | Applet Security disables the file functions of the DLSim 3 applet so that the applet cannot be saved or exported. Applet Security has no effect when the circuit is loaded into the DLSim 3 application. For more about using DLSim 3 as an applet see below.

Using DLSim 3 Applets

The distribution contains an applets folder with several Web pages that implement DLSim 3 applets. Applets are a convenient way of deploying demo circuits.

To use a DLSim 3 applet specify elements code="dlsim.DLSimA.class" archive="[path]DLSim3.jar[, [path]Plugins.jar]" to the applet tag. Note that the reference to Plugins.jar may be omitted if your demo circuit does not require any plugins (you may also reference Plugins1.jar, etc. as needed). You may also need to use the following parameters:

directory
The path from the HTML base to the circuit file. May be omitted if this is the base directory.
plugins.home
If the applet uses plugins you must specify the directory containing the plugin jar(s) as the value of this parameter. All plugin jars must be contained in the same directory.
load
The name of the .cct file to load (without the .cct extension).
loadxml
The name of the XML file to load (without the .xml extension).
Here is some example HTML entries that load applets. The first loads a circuit in the base directory called ctrdemo.cct, for which no plugins are required. It also assumes that DLSim3.jar is in the base directory.
<applet code="dlsim.DLSimA.class" width=1020 height=820
  archive="DLSim3.jar"> 
  <param name="load" value="ctrdemo">
</applet> 

In the second, we assume that the base directory contains subdirectories Circuits and java, and that jar files DLSim3.jar and Plugins.jar are in the java subdirectory. This code will load the XML circuit Circuits/Mic1/Mic1.xml. This circuit requires the plugins that are contained in the jar file Plugins.jar

<applet code="dlsim.DLSimA.class" width=1020 height=820
  archive="java/DLSim3.jar,java/Plugins.jar"> 
  <param name="plugins.home" value="java">
  <param name="directory" value="Circuits/Mic1">
  <param name="loadxml" value="Mic1">
</applet> 

Note: Applets requiring plugins must be run in a browser equipped with the Java 1.6 plugin. This plugin is not currently distributed for Macintosh OSX 10.5 platforms.