Skip to content

Commit

Permalink
Typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Nov 16, 2024
1 parent 960ee85 commit 2189f61
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions compiler/generator/template/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# Developing a new backend

A backend in the Faust compiler is responsible for generating output code (such as C++, LLVM, WASM, or other formats) from an intermediate representation of the signal processing program. Thet are currently two kind of backends depending if they are activated at the or later in the compilation chain on the FIR (Faust Imperative Representation):
A backend in the Faust compiler is responsible for generating output code (e.g., C++, LLVM, WASM, or other formats) from an intermediate representation of the signal processing program. Currently, there are two types of backends, classified based on their activation level: either at the signal IR level or at the FIR (Faust Imperative Representation) level:

- [Signal Stage](https://faustdoc.grame.fr/tutorials/signal-api/) backends: they operate at the signal stage, where the program is conceptually represented as a graph of computations performed on audio and control inputs (like sliders or buttons) and producing audio and control outputs (like bargraphs). At this stage, audio signals are treated as continuous, infinite data streams defined in `signals.hh` and `signals.cpp`.
- [Signal IR](https://faustdoc.grame.fr/tutorials/signal-api/) backends: they operate at the signal IR, where the program is conceptually represented as a graph of computations performed on audio and control inputs (like sliders or buttons) and producing audio and control outputs (like bargraphs). At this stage, audio signals are treated as continuous, infinite data streams defined in `signals.hh` and `signals.cpp`.

- FIR (Faust Imperative Representation) backends: they are activated later in the compilation chain, working on the FIR (Faust Imperative Representation), an intermediate, instruction-based representation of the program (with memory operations like load/store, mathematical computations and control structures). FIR backends take these low-level instructions and generate output in a specific format (e.g., C++ code or WebAssembly). The FIR is generated by converting signals to FIR instructions, defined in `instructions.hh` and `instructions.cpp` files. The conversion is done in `InstructionsCompiler` for the *-scalar* mode and `DAGInstructionsCompiler` for *-vec*, *-omp*, *-sch* Direct Acyclic Graph (DAG) based generators.

Expand Down Expand Up @@ -109,8 +109,7 @@ A signal backend directly operates on the signal representation of a Faust progr

The `TreeTraversal` class enables recursive, memoized traversal of the signal graph, while `TreeTransform` provides mechanisms for modifying the tree structure itself. Together, they allow a signal backend to extract and transform relevant information within the signal graph, supporting the generation of code in the backend's target format.

For an example of this in action, refer to the SDF3 signal backend in the `generator/sdf3 folder`. This implementation demonstrates how a signal backend can leverage traversal and transformation tools to generate an XML texttual representation.

For an example of this in action, refer to the SDF3 signal backend in the `generator/sdf3 folder`. This implementation demonstrates how a signal backend can leverage traversal and transformation tools to generate an [SDF3](https://www.es.ele.tue.nl/sdf3/) XML textual representation.

## FIR backend

Expand Down

0 comments on commit 2189f61

Please sign in to comment.