Skip to main content

Module printer

Module printer 

Source
Expand description

Text-format printer for SC IR graphs.

§Format

sc.graph @module_name {
  %0 = sc.input "x_in" : rate
  %1 = sc.constant 0.5 : rate
  %2 = sc.encode %0, length=1024, seed=0xACE1 : bitstream<1024>
  %3 = sc.encode %1, length=1024, seed=0xBEEF : bitstream<1024>
  %4 = sc.and %2, %3 : bitstream<1024>
  %5 = sc.popcount %4 : u64
  sc.output "result" %5
}

Functions§

print
Print a graph to its text representation.