WAL Programmer Manual


3. Accessing Signals

This section describes functions for loading and handling waveforms.
(get signal) ↦ (int?)
  name : string?
Returns the signal value of the signal specified by argument name.
(slice signal upper lower) ↦ (int?)
  signal : symbol?
   upper : int?
   lower : int?
Evaluates expr and returns the bits or list elements from upper to lower. List slicing follows Pythons list slicing semantics.
(reval expr offset) ↦ (int?)
     expr : WAL expression
   offset : int?
First evaluates offset to evaluated-offset and then evaluates expression at current index + evaluated-offset.
expr@off ↦ (reval expr offset)
     expr : WAL expression
   offset : int?
The @ macro is transformed into a call to reval.
  >-> INDEX
  >-> (reval INDEX -1)
  >-> INDEX@-1
  >-> INDEX@(+ 2 2)
expr@<off-1 off-2 ... off-n> ↦ expr@off-1 expr@off-2 ... expr@off-n
     expr : WAL expression
    off-i : int?
If a list enclosed in < > is passed to the @ macro the expr is expanded and wrapped in reval at each offset off-i in the list. List elements must be integers. The expansion happens before expr is evaluated and the expanded expressions are not contained in a list. This is shown in the example below.
  (print top.valid@<1 2 3>) expands to (print top.valid@1 top.valid@2 top.valid@3)