Skip to content

eDSL: static_if_with #1785

Open
Open
@anshumanmohan

Description

Just putting a bookmark down for an interesting use case that has a potentially cute solution. We have already have:

  • if_, which generates a Calyx if with a port but without a comb group.
  • if_with, which very neatly generates a Calyx if with a port and a comb group. It takes as input a cell and comb group, and uses cell.out as the if’s port. This cell and comb group tuple is generated via a different set of helpers, e.g. eq_use returns an eq cell and a comb group that performs an equality check using that cell. It is nice that we can then just pass this tuple to if_with.
  • static_if, which generates a Calyx static if with a port but without a comb group.

static_if_with is not what you think it is: static if in Calyx should have a port but should not have a comb group: those are disallowed in a static domain. Rather, the following should happen:

The command static_if_with(CellAndGroup, IfBody, ElseBody), should be processed by:

  1. Snapping apart the CellAndGroup into cell and group.
  2. Putting all of group's assignments into the component’s continuous assignment stanza.
  3. Turning the command into static_if(cell.out, IfBody, ElseBody)

Originally posted by @anshumanmohan in #1783 (comment)

Metadata

Assignees

No one assigned

    Labels

    C: calyx-pyItems that have to do with the builder libraryS: AvailableCan be worked upon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions