i8237x2 i82543
Simics Reference Manual  /  5 Classes  / 

i8254

Description

The i8254 device implements the functionality of the PIT (Programmable Interval Timer) counter device found in most PCs. In a real system it is used to generate interval signals for the TOD clock, DMA refresh, and the speaker. The simulated device is only connected to the interrupt device; it counts internally, and the value can be read and written from the processor. The Intel® 8254 device also implements Port B in the 8255 PPI (Programmable Peripheral Interface). This port is used to control the builtin PC speaker. Counting mode 1 is not implemented.

Interfaces Implemented

conf_object, log_object, io_memory

Notifiers

cell-change
Notifier that is triggered after the object's cell was changed.
object-delete
Notifier that is triggered just before Simics object is deleted.
queue-change
Notifier that is triggered after the object's clock was changed. New clock can be obtained with the SIM_object_clock function.

Port Objects

port.Gate0
i8254.Gate0 – GATE input for timer 0
port.Gate1
i8254.Gate1 – GATE input for timer 1
port.Gate2
i8254.Gate2 – GATE input for timer 2
port.RESET
i8254.RESET – Device reset. The stand-alone version of this device does not have a reset pin, but the device as IP in larger ASICs typically do act on reset.

Commands for this class

Attributes

irq_dev
Optional attribute; read/write access; type: o|n
Device to send interrupts to, that implements the simple_interrupt or signal interface.
irq_level
Optional attribute; read/write access; type: i
Interrupt level for the interrupt device.
interrupt_pin
Optional attribute; read/write access; type: i
Interrupt request status.
refresh_clock
Optional attribute; read/write access; type: i
Bit 4 when reading from port B.
speaker
Optional attribute; read/write access; type: i
Enable flag for speaker, only valid if the have_speaker attribute is 1.
have_speaker
Optional attribute; read/write access; type: i
Set to 1 (default) if counter 2 is connected to a standard PC speaker.
beep
Optional attribute; read/write access; type: i
Set to 1 if a beep is currently playing in the speaker. Only valid if the have_speaker attribute is 1.
count
Optional attribute; read/write access; type: [iii]|[iiii]
A list of count values (i.e. BCD mode setting doesn't affect the value of the attribute), one for each counter.
count_actual
Pseudo attribute; read-only access; type: [iii]|[iiii]
The calculated current count values (i.e. BCD mode setting doesn't affest the value of the attribute)
initial_count
Optional attribute; read/write access; type: [iii]|[iiii]
A list of initial count values (i.e. BCD mode setting doesn't affect the value of the attribute), one for each counter.
latched_count
Optional attribute; read/write access; type: [iii]|[iiii]
A list of latched values (i.e. BCD mode setting doesn't affect the value of the attribute), one for each counter.
latched_status
Optional attribute; read/write access; type: [iii]|[iiii]
A list of latched status bytes, one for each counter.
latched
Optional attribute; read/write access; type: [iii]|[iiii]
A list of flags, each set to 1 if the corresponding counter has a latched value.
latched_s
Optional attribute; read/write access; type: [iii]|[iiii]
A list of flags, each set to 1 if the corresponding counter has a latched status.
next_read_high
Optional attribute; read/write access; type: [iii]|[iiii]
For each of the counters, a flag indicating if the next read access is for the high byte.
next_write_high
Optional attribute; read/write access; type: [iii]|[iiii]
For each of the counters, a flag indicating if the next write access is for the high byte.
counting
Optional attribute; read/write access; type: [iii]|[iiii]
For each of the counters, a flag indicating whether it is running.
expired_count
Optional attribute; read/write access; type: [iii]
For each counter the number of times a counter was reloaded since it was started.
gate
Optional attribute; read/write access; type: [iii]|[iiii]
Gate signals (1 or 0), one for each counter.
out
Optional attribute; read/write access; type: [iii]|[iiii]
Output values (0 or 1), one for each counter.
cmd
Optional attribute; read/write access; type: [iii]|[iiii]
The RW command for each counter.
mode
Optional attribute; read/write access; type: [iii]|[iiii]
The PIT counting mode for each counter (0 - 5).
bcd
Optional attribute; read/write access; type: [iii]|[iiii]
The counting format for each counter (0 or 1).
null_count
Optional attribute; read/write access; type: [iii]|[iiii]
The 'null count' status bit.
clock_freq_hz
Optional attribute; read/write access; type: [fff]|[ffff]
Clock input frequencies for the counters, in Hz. Defaults to 1193180.0 Hz for all counters. The frequency should be set before simulation starts.
mode_names
Pseudo attribute; read-only access; type: [ssssss]
List of all mode names.
cmd_names
Pseudo attribute; read-only access; type: [ssss]
List of all command names.

Provided By

8254

i8254.Gate0

Description

GATE input for timer 0

Interfaces Implemented

conf_object, log_object, signal

Notifiers

cell-change
Notifier that is triggered after the object's cell was changed.
object-delete
Notifier that is triggered just before Simics object is deleted.
queue-change
Notifier that is triggered after the object's clock was changed. New clock can be obtained with the SIM_object_clock function.

i8254.Gate1

Description

GATE input for timer 1

Interfaces Implemented

conf_object, log_object, signal

Notifiers

cell-change
Notifier that is triggered after the object's cell was changed.
object-delete
Notifier that is triggered just before Simics object is deleted.
queue-change
Notifier that is triggered after the object's clock was changed. New clock can be obtained with the SIM_object_clock function.

i8254.Gate2

Description

GATE input for timer 2

Interfaces Implemented

conf_object, log_object, signal

Notifiers

cell-change
Notifier that is triggered after the object's cell was changed.
object-delete
Notifier that is triggered just before Simics object is deleted.
queue-change
Notifier that is triggered after the object's clock was changed. New clock can be obtained with the SIM_object_clock function.

i8254.RESET

Description

Device reset. The stand-alone version of this device does not have a reset pin, but the device as IP in larger ASICs typically do act on reset.

Interfaces Implemented

conf_object, log_object, signal

Notifiers

cell-change
Notifier that is triggered after the object's cell was changed.
object-delete
Notifier that is triggered just before Simics object is deleted.
queue-change
Notifier that is triggered after the object's clock was changed. New clock can be obtained with the SIM_object_clock function.
i8237x2 i82543