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
- type PhaseClock
- func (clk *PhaseClock) Align()
- func (clk PhaseClock) Count() int
- func (clk PhaseClock) LatePhi1() bool
- func (clk PhaseClock) LatePhi2() bool
- func (clk PhaseClock) Phi1() bool
- func (clk PhaseClock) Phi2() bool
- func (clk *PhaseClock) Reset()
- func (clk PhaseClock) String() string
- func (clk *PhaseClock) Sync(oclk PhaseClock)
- func (clk *PhaseClock) Tick()
Constants ¶
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) 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.