WAL Programmer Manual

0.8.2

3. Accessing Signals

This section describes functions for loading and handling waveforms.
The core idea behind WAL is that signals from a loaded waveform can be read by just using their name. This means, that waveform signals behave similarly to variables, except that their value depends on the current INDEX, which is the pointer into the currently loaded waveform.
Examples:
>-> (load "trace.vcd")
t0(0) >-> SIGNALS
("tb.a", "tb.b")
t0(0) >-> INDEX
0
t0(0) >-> tb.a
5
t0(0) >-> tb.a@1
6
t0(0) >-> INDEX
0
t0(0) >-> INDEX@1
0
(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.
Examples:
>-> INDEX
5
>-> (reval INDEX -1)
4
>-> INDEX@-1
4
>-> INDEX@(+ 2 2)
9