index    previous    next

original image

INPUT

INPUT objects are actually XPUT objects with the predefined INPUT text label. INPUT objects may be configured as inputs or outputs during target code execution.

Code Generation

The INPUT object has one property associated with it which is used to guide the code generator during the code generation phase. This property is accessed via the INPUT settings object dialog.

The property is:

  • xput ID

The XPUT ID identifies a specific I/O bit within a specific I/O port of the physical CPU. This is defined as

	bits  0-7  port A bits 0-7
bits 8-15 port B bits 0-7
bits 15-23 port C bits 0-7
To calculate the bit position within a port, use the formula
N & 7

where N is the XPUT ID
and & is the bitwise binary AND operator.

To calculate the port number, use the formula
N >> 3

where N is the XPUT ID
and >> is the binary shift right operator.

The result will be 0 for PORT A, 1 for PORT B, 2 for PORT C etc.

Simulation Details

XPUT (I/O) objects are mapped directly into the I/O ports of the simulated CPU. When the simulated CPU writes to an I/O port the corresponding XPUT objects route the signals to other connected XPUT objects and consequently to the I/O ports to which they are mapped. Subsequent access to the I/O ports by other simulated CPUs (during an I/O port read) causes the propergated signal to be used. The value read by the simulated I/O port is dependent on the levels of all the connected I/O ports and the internal configuration (input or output) of the I/O port within the simulated CPU.

XPUT objects generates machine code which is directly executable in the target system. No additional debug code is generated for the target when the simulator is used in place of a real CPU.

While interactively debugging a design, an input port (NOT object) generates events in response to input changes. These events are passed to all interested state machine for processing by the state machine schedular.

Adding INPUT Objects To A Design

Normally an INPUT object is added to a design by copying it from the template window to the drawing window or from an existing INPUT object already on the drawing window. It must form part of a CPU if code is to be generated for it. This is done by placing it within the perimitor of a CPU object and using the INPUT objects add to group function or gather function to tie it to the CPU.

Related Information

WIRE objects
SWITCH objects
LED objects