* XSPICE filesource as a 4-bit VECTOR pattern generator (a binary counter).
* One A-device drives a whole bus from a multi-column file; amplscale sets logic hi.
a1 %v([b3 b2 b1 b0]) bus4
.model bus4 filesource (file="pattern4.dat"
+ amploffset=[0 0 0 0] amplscale=[1.8 1.8 1.8 1.8]
+ timeoffset=0 timescale=1 timerelative=false amplstep=TRUE)
rb3 b3 0 1meg
rb2 b2 0 1meg
rb1 b1 0 1meg
rb0 b0 0 1meg
.tran 5n 1.5u
.control
  run
  * at t=750ns counter=7 -> b3=0 b2=1.8 b1=1.8 b0=1.8
  meas tran b3_7 FIND v(b3) AT=750n
  meas tran b0_7 FIND v(b0) AT=750n
  * at t=1250ns counter=12 -> b3=1.8 b2=1.8 b1=0 b0=0
  meas tran b3_12 FIND v(b3) AT=1250n
  meas tran b0_12 FIND v(b0) AT=1250n
.endc
.end
