Skip to main content

extend_string

Function extend_string 

Source
pub fn extend_string(val: &str, num_bits: u32) -> String
Expand description

VCD bit extension. This function extends the given string val to match num_bits by adding leading characters according to VCD rules:

  • ‘0’ and ‘1’ extend with ‘0’
  • ‘x’ extends with ‘x’
  • ‘z’ extends with ‘z’
  • other leading characters result in no extension