Skip to content

[Calyx Emitter] Avoid emitting redundant write_en = 0 to satisfy write_together for reads #10074

@Abhilekhgautam

Description

@Abhilekhgautam

Calyx specifies that, for a seq_memory_d1 if the port write_en is driven then write_data must also be driven through the write_together spec.

However, when the port content_en is 1 and port write_en is 0, it implies a read, so write_data need not be driven.

Since write_together is a safety mechanism can we just tell the emitter to not drive write_en when it is 0 and content_en is 1.

For example:

Instead of emitting this (which papercut pass complains about):

 group bb0_1 {
      std_slice_10.in = for_2_induction_var_reg.out;
      arg_mem_0.addr0 = std_slice_10.out;
      arg_mem_0.content_en = 1'b1;
      arg_mem_0.write_en = 1'd0; <- unnecessary
      bb0_1[done] = arg_mem_0.done;
 }

we emit:

 group bb0_1 {
      std_slice_10.in = for_2_induction_var_reg.out;
      arg_mem_0.addr0 = std_slice_10.out;
      arg_mem_0.content_en = 1'b1;
      bb0_1[done] = arg_mem_0.done;
 }

Since, by default the value will be set to 0, these two will be equivalent and will satisfy the write_together spec as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions