function Encode is new Ada.Unchecked_Conversion (IRQ, PIO_Instruction);
function Encode is new Ada.Unchecked_Conversion (JMP, PIO_Instruction);
function Encode is new Ada.Unchecked_Conversion (MOV, PIO_Instruction);
function Encode is new Ada.Unchecked_Conversion (PULL, PIO_Instruction);
function Encode is new Ada.Unchecked_Conversion (PUSH, PIO_Instruction);
function Encode is new Ada.Unchecked_Conversion (SET, PIO_Instruction);
function Encode is new Ada.Unchecked_Conversion (SHIFT_IN, PIO_Instruction);
function Encode is new Ada.Unchecked_Conversion (SHIFT_OUT, PIO_Instruction);
function Encode is new Ada.Unchecked_Conversion (WAIT, PIO_Instruction);
type IRQ is record
Opcode : HAL.UInt3 := 2#110#;
Delay_Sideset : HAL.UInt5 := 0;
Opcode_2 : Boolean := False;
Clear : Boolean := False;
Wait : Boolean := False;
Index : HAL.UInt5;
end record
with Size => 16;
type JMP is record
Opcode : HAL.UInt3 := 2#000#;
Delay_Sideset : HAL.UInt5 := 0;
Condition : JMP_Condition := Always;
Address : HAL.UInt5 := 0;
end record
with Size => 16;
type JMP_Condition is
(Always,
Scratch_X_Zero,
Scratch_X_Nonzero_Decrement,
Scratch_Y_Zero,
Scratch_Y_Nonzero_Decrement,
X_Notequal_Y,
Input_Pin,
OSRE_Not_Empty)
with Size => 3;
!X
X--
!Y
Y--
X!=Y
PIN
!OSRE
type MOV is record
Opcode : HAL.UInt3 := 2#101#;
Delay_Sideset : HAL.UInt5 := 0;
Destination : MOV_Target := PINS;
Operation : MOV_Operation := None;
Source : MOV_Target := PINS;
end record
with Size => 16;
type MOV_Operation is
(None, Invert, Bit_Reverse)
with Size => 2;
type MOV_Target is
(PINS, X, Y, EXEC, PC, ISR, OSR)
with Size => 3;
type PULL is record
Opcode : HAL.UInt3 := 2#100#;
Delay_Sideset : HAL.UInt5 := 0;
Opcode_2 : Boolean := True;
If_Empty : Boolean := False;
Block : Boolean := False;
Opcode_3 : HAL.UInt5 := 0;
end record
with Size => 16;
type PUSH is record
Opcode : HAL.UInt3 := 2#100#;
Delay_Sideset : HAL.UInt5 := 0;
Opcode_2 : Boolean := False;
If_Full : Boolean := False;
Block : Boolean := False;
Opcode_3 : HAL.UInt5 := 0;
end record
with Size => 16;
type SET is record
Opcode : HAL.UInt3 := 2#111#;
Delay_Sideset : HAL.UInt5 := 0;
Destination : SET_Destination := PINS;
Data : HAL.UInt5 := 0;
end record
with Size => 16;
type SET_Destination is
(PINS, X, Y, PINDIRS)
with Size => 3;
type SHIFT_IN is record
Opcode : HAL.UInt3 := 2#010#;
Delay_Sideset : HAL.UInt5 := 0;
Source : SHIFT_IN_Source := PINS;
Bit_Count : HAL.UInt5;
end record
with Size => 16;
0 = 32
type SHIFT_IN_Source is
(PINS, X, Y, ZERO, ISR, OSR)
with Size => 3;
type SHIFT_OUT is record
Opcode : HAL.UInt3 := 2#011#;
Delay_Sideset : HAL.UInt5 := 0;
Destination : SHIFT_OUT_Destination := PINS;
Bit_Count : HAL.UInt5;
end record
with Size => 16;
0 = 32
type SHIFT_OUT_Destination is
(PINS, X, Y, DISCARD, PINDIRS, PC, ISR, EXEC)
with Size => 3;
type WAIT is record
Opcode : HAL.UInt3 := 2#001#;
Delay_Sideset : HAL.UInt5 := 0;
Polarity : Boolean := False;
Source : WAIT_Source := GPIO;
Index : HAL.UInt5 := 0;
end record
with Size => 16;
type WAIT_Source is
(GPIO, PIN, WAIT_IRQ)
with Size => 2;