@@ -282,84 +282,3 @@ hw.module @condition_as_val(in %clk: !seq.clock, in %condval: i1) {
282282 %bin = sim.fmt.bin %condval specifierWidth 1 : i1
283283 sim.print %bin on %clk if %condval
284284}
285-
286- // CHECK-LABEL: @print_with_stream
287- // CHECK-NEXT: %[[TRG:.*]] = seq.from_clock %clk
288- // CHECK-NEXT: hw.triggered posedge %[[TRG]](%cond, %idx) : i1, i32 {
289- // CHECK-NEXT: ^bb0(%[[ARGCOND:.*]]: i1, %[[ARGIDX:.*]]: i32):
290- // CHECK-DAG: %[[FMT:.*]] = sim.fmt.literal "stream"
291- // CHECK-DAG: %[[PFX:.*]] = sim.fmt.literal "out_"
292- // CHECK-DAG: %[[NUM:.*]] = sim.fmt.dec %[[ARGIDX]] : i32
293- // CHECK-DAG: %[[SFX:.*]] = sim.fmt.literal ".log"
294- // CHECK-DAG: %[[FNAME:.*]] = sim.fmt.concat (%[[PFX]], %[[NUM]], %[[SFX]])
295- // CHECK-DAG: %[[FILE:.*]] = sim.get_file %[[FNAME]]
296- // CHECK: scf.if %[[ARGCOND]] {
297- // CHECK-NEXT: sim.proc.print %[[FMT]] to %[[FILE]]
298- // CHECK-NEXT: }
299- // CHECK-NEXT: }
300- hw.module @print_with_stream (in %clk: !seq.clock , in %cond: i1 , in %idx: i32 ) {
301- %fmt = sim.fmt.literal " stream"
302- %prefix = sim.fmt.literal " out_"
303- %idxFmt = sim.fmt.dec %idx : i32
304- %suffix = sim.fmt.literal " .log"
305- %fileName = sim.fmt.concat (%prefix , %idxFmt , %suffix )
306- %file = sim.get_file %fileName
307- sim.print %fmt on %clk if %cond to %file
308- }
309-
310- // CHECK-LABEL: @print_with_stream_two_conditions
311- // CHECK-NEXT: %[[TRG:.*]] = seq.from_clock %clk
312- // CHECK-NEXT: hw.triggered posedge %[[TRG]](%c1, %idx, %c2) : i1, i32, i1 {
313- // CHECK-NEXT: ^bb0(%[[ARGC1:.*]]: i1, %[[ARGIDX:.*]]: i32, %[[ARGC2:.*]]: i1):
314- // CHECK-DAG: %[[FMT:.*]] = sim.fmt.literal "stream2"
315- // CHECK-DAG: %[[PFX:.*]] = sim.fmt.literal "out2_"
316- // CHECK-DAG: %[[NUM:.*]] = sim.fmt.dec %[[ARGIDX]] : i32
317- // CHECK-DAG: %[[SFX:.*]] = sim.fmt.literal ".log"
318- // CHECK-DAG: %[[FNAME:.*]] = sim.fmt.concat (%[[PFX]], %[[NUM]], %[[SFX]])
319- // CHECK-DAG: %[[FILE:.*]] = sim.get_file %[[FNAME]]
320- // CHECK: scf.if %[[ARGC1]] {
321- // CHECK-NEXT: sim.proc.print %[[FMT]] to %[[FILE]]
322- // CHECK-NEXT: }
323- // CHECK-NEXT: scf.if %[[ARGC2]] {
324- // CHECK-NEXT: sim.proc.print %[[FMT]] to %[[FILE]]
325- // CHECK-NEXT: }
326- // CHECK-NEXT: }
327- hw.module @print_with_stream_two_conditions (in %clk: !seq.clock , in %c1: i1 , in %c2: i1 , in %idx: i32 ) {
328- %fmt = sim.fmt.literal " stream2"
329- %prefix = sim.fmt.literal " out2_"
330- %idxFmt = sim.fmt.dec %idx : i32
331- %suffix = sim.fmt.literal " .log"
332- %fileName = sim.fmt.concat (%prefix , %idxFmt , %suffix )
333- %file = sim.get_file %fileName
334- sim.print %fmt on %clk if %c1 to %file
335- sim.print %fmt on %clk if %c2 to %file
336- }
337-
338- // CHECK-LABEL: @shared_fmt_between_print_and_get_file
339- // CHECK-NEXT: %[[TRG:.*]] = seq.from_clock %clk
340- // CHECK-NEXT: hw.triggered posedge %[[TRG]](%cond, %idx) : i1, i32 {
341- // CHECK-NEXT: ^bb0(%[[ARGCOND:.*]]: i1, %[[ARGIDX:.*]]: i32):
342- // CHECK-DAG: %[[SHARED:.*]] = sim.fmt.dec %[[ARGIDX]] : i32
343- // CHECK-DAG: %[[MSGPFX:.*]] = sim.fmt.literal "value="
344- // CHECK-DAG: %[[FILEPFX:.*]] = sim.fmt.literal "out_"
345- // CHECK-DAG: %[[FILESFX:.*]] = sim.fmt.literal ".log"
346- // CHECK-DAG: %[[MSG:.*]] = sim.fmt.concat (%[[MSGPFX]], %[[SHARED]])
347- // CHECK-DAG: %[[FNAME:.*]] = sim.fmt.concat (%[[FILEPFX]], %[[SHARED]], %[[FILESFX]])
348- // CHECK-DAG: %[[FILE:.*]] = sim.get_file %[[FNAME]]
349- // CHECK: scf.if %[[ARGCOND]] {
350- // CHECK-NEXT: sim.proc.print %[[MSG]] to %[[FILE]]
351- // CHECK-NEXT: }
352- // CHECK-NEXT: }
353- hw.module @shared_fmt_between_print_and_get_file (
354- in %clk: !seq.clock , in %cond: i1 , in %idx: i32 ) {
355- %shared = sim.fmt.dec %idx : i32
356- %msgPrefix = sim.fmt.literal " value="
357- %msg = sim.fmt.concat (%msgPrefix , %shared )
358-
359- %filePrefix = sim.fmt.literal " out_"
360- %fileSuffix = sim.fmt.literal " .log"
361- %fileName = sim.fmt.concat (%filePrefix , %shared , %fileSuffix )
362- %file = sim.get_file %fileName
363-
364- sim.print %msg on %clk if %cond to %file
365- }
0 commit comments