ics-jku / wal

WAL enables programmable waveform analysis.
https://wal-lang.org
BSD 3-Clause "New" or "Revised" License
116 stars 18 forks source link

How to launch WAL script ? #29

Closed Martoni closed 3 months ago

Martoni commented 3 months ago

Hello,

I'm trying to launch the following WAL script with version (0.8.1). waltry.wal :

(define wait 0)
(define packets 0)
(whenever (rising clk)
          (when (&& req (! ack)) (inc wait))
          (when (&& req ack) (inc packets)))
(print (/ wait packets))

With VCD file provided in tutorial fdl.vcd .

The following command return nothing :

$ wal -l fdl.vcd -c waltry.wal

Even if I insert error in file nothing is returned.

LucasKl commented 3 months ago

Hi, try wal waltry.wal -l fdl.vcd.

Martoni commented 3 months ago

Thanks @LucasKl

In fact, the right command is with wal script as first argument :

$ wal waltry.wal -l fdl.vcd

>>>>> WAL Runtime error! <<<<<
 1: (define wait 0)
 2: (define packets 0)
 3: (whenever (rising clk)
 4:           (when (&& req (! ack)) (inc wait))
 5:           (when (&& req ack) (inc packets)))

The error is from code, if I try simplest following program It works :

(print "pof")
$ wal pof.wal -l fdl.vcd 
pof

If script name is given at the end of command it doesn't work :

$ wal -l fdl.vcd pof.wal
File extension ".wal" not supported.
WAL 0.8.1
Exit to OS or terminate running evaluations with CTRL-C
t0(0) >-> 
LucasKl commented 3 months ago

Oh right, the order is important. Good that it works now. If something comes up, feel free to contact me. :)

I updated my comment so that nobody finds the wrong command.