protocol-emulator / all protocols

tables

Spec source

Not available: no datasheet limits for this protocol.

Datasheet limits

Not available: no limits.

Protocol file and firmware

test/tables.ml
open! Core
open Protocol_emulator.Tables

let certified name wiring =
  Certified.plain ~any_data:true name (interpreter wiring) (config wiring)
;;

let protocol =
  { Protocol.name = "tables"
  ; certified =
      [ certified "table" Wiring.default
      ; certified
          "table_open_drain"
          (i2c_slave ~address:0 ~sda:Protocol_emulator.Isa.first_bidir_pin).wiring
      ]
  ; time_triggered = []
  ; bench = []
  ; loaded_from_hex = []
  ; limits = []
  ; unlimited = []
  ; swept = []
  ; not_swept =
      [ "table", "its pins follow a table in data memory, which the sweep does not load"
      ; "table_open_drain", "the same"
      ]
  ; scenarios = []
  ; decoded = []
  }
;;
certified firmware table
    set x, 0
    seek [1]                 ; data_settle
    out y, 16                ; entry 0's hold
    mov t, now
    add t, 7
.wrap_target
    wait t                   ; release
    out pins, 6              ; the entry's outputs
    add t, y                 ; its hold
    out x, 4                 ; its kind
    jmp x--, shift
    set y, 19
    add t, y
join:
    out x, 6                 ; the next state
joined:
    set y, 0
    add y, p
    mov isr, ::y             ; the host bit p[15], index bit 8 once shifted
    in x, 6
    in pins, 1
    in null, 1               ; two words an entry
    mov x, isr
    seek [1]                 ; seek keeps the low 9 bits
    out y, 16                ; the next entry's hold
.wrap
shift:
    jmp x--, pull
    mov x, pins              ; in_base, as in_count is 1
    add p, p
    add p, x
    set y, 26
    add t, y
    jmp join
pull:
    jmp x--, push
    out x, 6
    pull
    mov p, osr
    out null, 16             ; the table's word is spent
    set y, 28
    add t, y
    jmp joined
push:
    jmp x--, stamp
    set y, 0
    add y, p
    mov isr, y
    push
    set y, 31
    add t, y
    jmp join
stamp:
    jmp x--, burst
    mov isr, now
    push
    set y, 31
    add t, y
    jmp join
burst:
    jmp x--, await_host
    out isr, 6               ; the next state, kept
    mov t, null              ; no deadline while waiting
    wait tx
    pull                     ; bits less one in the low 4, then the bits
    out x, 4
    mov t, now
    add t, 4
bit:
    wait t
    out pins, 1
    add t, y
    add t, 6
    jmp x--, bit
    mov x, isr
    out null, 16             ; the rest of the host word
    set y, 16
    add t, y
    jmp joined
await_host:
    jmp x--, await_a_high
    out x, 6
    mov t, null              ; no deadline while waiting
    wait tx
    pull
    mov p, osr
    out null, 16
    mov t, now
    add t, y                 ; the hold, from here
    set y, 16
    add t, y
    jmp joined
await_a_high:
    jmp x--, await_a_low
    mov t, null              ; no deadline while waiting
    wait 1 pin 0
    mov t, now
    add t, y                 ; the hold, from here
    set y, 17
    add t, y
    jmp join
await_a_low:
    jmp x--, await_b_high
    mov t, null              ; no deadline while waiting
    wait 0 pin 0
    mov t, now
    add t, y                 ; the hold, from here
    set y, 17
    add t, y
    jmp join
await_b_high:
    jmp x--, await_b_low
    mov t, null              ; no deadline while waiting
    wait 1 pin 1
    mov t, now
    add t, y                 ; the hold, from here
    set y, 17
    add t, y
    jmp join
await_b_low:
    mov t, null              ; no deadline while waiting
    wait 0 pin 1
    mov t, now
    add t, y                 ; the hold, from here
    set y, 17
    add t, y
    jmp join
certified firmware table_open_drain
    set x, 0
    seek [1]                 ; data_settle
    out y, 16                ; entry 0's hold
    mov t, now
    add t, 7
.wrap_target
    wait t                   ; release
    out pindirs, 6              ; the entry's outputs
    add t, y                 ; its hold
    out x, 4                 ; its kind
    jmp x--, shift
    set y, 19
    add t, y
join:
    out x, 6                 ; the next state
joined:
    set y, 0
    add y, p
    mov isr, ::y             ; the host bit p[15], index bit 8 once shifted
    in x, 5
    in pins, 2
    in null, 1               ; two words an entry
    mov x, isr
    seek [1]                 ; seek keeps the low 9 bits
    out y, 16                ; the next entry's hold
.wrap
shift:
    jmp x--, pull
    mov x, pins              ; in_base, as in_count is 1
    add p, p
    add p, x
    set y, 26
    add t, y
    jmp join
pull:
    jmp x--, push
    out x, 6
    pull
    mov p, osr
    out null, 16             ; the table's word is spent
    set y, 28
    add t, y
    jmp joined
push:
    jmp x--, stamp
    set y, 0
    add y, p
    mov isr, y
    push
    set y, 31
    add t, y
    jmp join
stamp:
    jmp x--, burst
    mov isr, now
    push
    set y, 31
    add t, y
    jmp join
burst:
    jmp x--, await_host
    out isr, 6               ; the next state, kept
    mov t, null              ; no deadline while waiting
    wait tx
    pull                     ; bits less one in the low 4, then the bits
    out x, 4
    mov t, now
    add t, 4
bit:
    wait t
    out pindirs, 1
    add t, y
    add t, 6
    jmp x--, bit
    mov x, isr
    out null, 16             ; the rest of the host word
    set y, 16
    add t, y
    jmp joined
await_host:
    jmp x--, await_a_high
    out x, 6
    mov t, null              ; no deadline while waiting
    wait tx
    pull
    mov p, osr
    out null, 16
    mov t, now
    add t, y                 ; the hold, from here
    set y, 16
    add t, y
    jmp joined
await_a_high:
    jmp x--, await_a_low
    mov t, null              ; no deadline while waiting
    wait 1 pin 13
    mov t, now
    add t, y                 ; the hold, from here
    set y, 17
    add t, y
    jmp join
await_a_low:
    jmp x--, await_b_high
    mov t, null              ; no deadline while waiting
    wait 0 pin 13
    mov t, now
    add t, y                 ; the hold, from here
    set y, 17
    add t, y
    jmp join
await_b_high:
    jmp x--, await_b_low
    mov t, null              ; no deadline while waiting
    wait 1 pin 12
    mov t, now
    add t, y                 ; the hold, from here
    set y, 17
    add t, y
    jmp join
await_b_low:
    mov t, null              ; no deadline while waiting
    wait 0 pin 12
    mov t, now
    add t, y                 ; the hold, from here
    set y, 17
    add t, y
    jmp join

Certificate

Clock window

Not available: no window for this protocol's firmware.

Time taken

Not available: no row in demo/speed.tsv.