phaseclock

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2021 License: GPL-3.0, GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package phaseclock defines the two phase clock generator used to drive the various polynomial counters in the TIA.

From the TIA_HW_Notes document:

Beside each counter there is a two-phase clock generator. This takes the
incoming 3.58 MHz colour clock (CLK) and divides by 4 using a couple of
flip-flops. Two AND gates are then used to generate two independent clock
signals thusly:
 ___         ___         ___
_| |_________| |_________| |_________  PHASE-1 (H@1)
       ___         ___         ___
_______| |_________| |_________| |___  PHASE-2 (H@2)

Even though the two phases are independent these types of clocks never overlap (the skew margin is always positive). This means that the implementation can be simplified to a simple count from 0 to 3.

Index

Constants

View Source
const NumStates = 4

NumStates is the number of phases the clock can be in.

Variables

This section is empty.

Functions

This section is empty.

Types

type PhaseClock

type PhaseClock int

The four-phase clock can be represent as an integer.

func (*PhaseClock) Align

func (clk *PhaseClock) Align()

Align the phaseclock with the master clock by resetting to the rise of Phi1.

func (PhaseClock) Count

func (clk PhaseClock) Count() int

Count returns the current clock state as an integer.

func (PhaseClock) LatePhi1

func (clk PhaseClock) LatePhi1() bool

LatePhi1 returns true if the Phi1 clock is on its falling edge.

func (PhaseClock) LatePhi2

func (clk PhaseClock) LatePhi2() bool

LatePhi2 returns true if the Phi2 clock is on its falling edge.

func (PhaseClock) Phi1

func (clk PhaseClock) Phi1() bool

Phi1 returns true if the Phi1 clock is on its rising edge.

func (PhaseClock) Phi2

func (clk PhaseClock) Phi2() bool

Phi2 returns true if the Phi2 clock is on its rising edge.

func (*PhaseClock) Reset

func (clk *PhaseClock) Reset()

Reset the phaseclock to the rise of Phi2.

func (PhaseClock) String

func (clk PhaseClock) String() string

String creates a single line ASCII representation of the current state of the PhaseClock.

func (*PhaseClock) Sync

func (clk *PhaseClock) Sync(oclk PhaseClock)

Sync two clocks to the same phase.

func (*PhaseClock) Tick

func (clk *PhaseClock) Tick()

Tick moves PhaseClock to next state.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL