Skip to content

Commit

Permalink
Docs: Add fud registration instructions for Interpreter (#2138)
Browse files Browse the repository at this point in the history
* Add fud registration instructions

* Put invoke tip in debugger page too

* Ref cells and not invokes are cider's problem
  • Loading branch information
anshumanmohan authored Jun 12, 2024
1 parent 2439f79 commit cb3fad3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
18 changes: 14 additions & 4 deletions docs/debug/cider.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,25 @@ debugging Calyx programs.

## Getting Started

If you are using [`fud`][fud] getting started with the debugger is easy.
If you are using [`fud`][fud], getting started with the debugger is easy.

First, follow [these instructions][interp-fud] to build the interpreter and register it as a `fud` stage.

Assuming you are trying to debug a program called `my_program.futil` with data
file `my_program.futil.data`, invoke the debugger with the following command:

```
fud e --to debugger -q my_program.futil -s verilog.data my_program.futil.data
```

This will open the target program in the interactive debugger. Note that `fud`
uses **the quiet flag**, `-q`, here. This prevents the printing from the `fud` tool
from conflicting the debugger as both tools interact with standard out.
This will open the target program in the interactive debugger. Note that we use `fud`'s *quiet* flag, `-q`, here. This avoids clashes between `fud`'s outputs and the debugger's outputs, since both tools interact with `stdout`.

The interpreter does not currently support [`ref` cells][ref-cells].
To run the debugger on a program that uses these, you must first compile them away by running the `compile-invoke` pass:

```
fud e --to debugger -s calyx.flags '-p compile-invoke' -q my_program.futil -s verilog.data my_program.futil.data
```

## Advancing Program execution

Expand Down Expand Up @@ -280,3 +288,5 @@ Use `help` to see all commands. Use `exit` to exit the debugger.
[fud]: ../running-calyx/fud/index.md
[gdb]: https://sourceware.org/gdb/
[interp]: ../running-calyx/interpreter.md
[interp-fud]: ../running-calyx/interpreter.md#interpreting-via-fud
[ref-cells]: ../lang/memories-by-reference.md#the-easy-way-ref-cells
10 changes: 9 additions & 1 deletion docs/running-calyx/interpreter.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ The interpreter is available as a stage in [fud][], which lets you provide stand

You'll want to build the interpreter first:

cd interp && cargo build
cd interp && cargo build && cd ..

Now register the interpreter as a fud stage:

fud config stages.interpreter.exec <full path to Calyx repository>/target/debug/cider

Here's how to run a Calyx program:

Expand All @@ -42,4 +46,8 @@ For example, to fully lower the Calyx program before interpreting it:
-s calyx.flags '-p all' \
interp/tests/control/if.futil

In particular, the interpreter does not currently support [`ref` cells][ref-cells].
To run the interpreter on a program that uses these, you must first compile them away by running the `compile-invoke` pass.

[fud]: fud/index.md
[ref-cells]: ../lang/memories-by-reference.md#the-easy-way-ref-cells

0 comments on commit cb3fad3

Please sign in to comment.