-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
[LLHD] Add
llhd.delay
operation (#7505)
Add an operation that delays the propagation of value changes from its input to its output. This allows mem2reg of LLHD signals with a unique driver with a delay. For example ``` %sig = llhd.sig llhd.drv %sig, %val after <1ns, 0d, 0e> %res = llhd.prb %sig ``` can become ``` %res = llhd.delay %val by <1ns, 0d, 0e> ```
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// RUN: circt-opt %s | circt-opt | FileCheck %s | ||
|
||
// CHECK-LABEL: @basic | ||
// CHECK-SAME: (in [[IN0:%.+]] : i32, out out0 : i32) | ||
hw.module @basic(in %in0 : i32, out out0 : i32) { | ||
// CHECK: %{{.*}} = llhd.delay [[IN0]] by <0ns, 1d, 0e> : i32 | ||
%0 = llhd.delay %in0 by <0ns, 1d, 0e> : i32 | ||
hw.output %0 : i32 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// RUN: circt-opt %s --split-input-file --verify-diagnostics | ||
|
||
hw.module @errors(in %in0: i32, out out0: i8) { | ||
// expected-error @below {{requires the same type for all operands and results}} | ||
%0 = "llhd.delay"(%in0) {delay = #llhd.time<0ns, 1d, 0e>} : (i32) -> i8 | ||
hw.output %0 : i8 | ||
} |