Skip to content

Commit

Permalink
Add documentation of fsm function
Browse files Browse the repository at this point in the history
  • Loading branch information
minseongg committed Sep 29, 2024
1 parent 20eff39 commit cea799c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions hazardflow-designs/src/std/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ pub trait Interface: Sized {
/// In particular, for a hazard interface [`I<H, D>`], you must follow the specification described in the "Safety"
/// section of [`I::fsm`].
///
/// # How it is compiled?
///
/// In the HazardFlow compiler, the fsm function is not actually executed (which would lead to a panic).
///
/// Instead, the HazardFlow compiler captures the [High-level IR](https://rustc-dev-guide.rust-lang.org/hir.html)
/// generated by the Rust compiler and extracts information about the ingress/egress/state types (`Self`, `E`, `S`)
/// and the arguments (`init_state`, `f`) of the fsm function.
///
/// Using this information, the HazardFlow compiler generates the corresponding Verilog code.
///
/// # Type parameters
///
/// - `Self`: The ingress interface type.
Expand Down

0 comments on commit cea799c

Please sign in to comment.