src/pli/pli/pli_full_example.c
int pli_conv (string in_string, int no_bits) {
  int conv = 0;
  int i = 0;
  int j = 0;
  int bin = 0;
  for ( i = no_bits-1; i >= 0; i = i - 1) {
    if (*(in_string + i) == 49) {
      bin = 1;
    } else if (*(in_string + i) == 120) {
      io_printf ("%d, Warning : X detected\n", sim_time);
      bin = 0;
    } else if (*(in_string + i) == 122) {
      io_printf ("%d, Warning : Z detected\n", sim_time);
      bin = 0;
    } else {
      bin = 0;
    }
    conv = conv + (1 << j)*bin;
    j ++;
  } 
  return conv;
}
// Multi-bit vector to integer conversion.
Multi-bit vector to integer conversion.
Multi - bit vector to integer conversion .
int pli_conv (string in_string, int no_bits) {
  int conv = 0;
  int i = 0;
  int j = 0;
  int bin = 0;
  for ( i = no_bits-1; i >= 0; i = i - 1) {
    if (*(in_string + i) == 49) {
      bin = 1;
    } else if (*(in_string + i) == 120) {
      io_printf ("%d, Warning : X detected\n", sim_time);
      bin = 0;
    } else if (*(in_string + i) == 122) {
      io_printf ("%d, Warning : Z detected\n", sim_time);
      bin = 0;
    } else {
      bin = 0;
    }
    conv = conv + (1 << j)*bin;
    j ++;
  } 
  return conv;
}
int pli_conv ( string in_string , int no_bits ) { int conv = 0 ; int i = 0 ; int j = 0 ; int bin = 0 ; for ( i = no_bits - 1 ; i >= 0 ; i = i - 1 ) { if ( * ( in_string + i ) == 49 ) { bin = 1 ; } else if ( * ( in_string + i ) == 120 ) { io_printf ( " \n " , sim_time ) ; bin = 0 ; } else if ( * ( in_string + i ) == 122 ) { io_printf ( " \n " , sim_time ) ; bin = 0 ; } else { bin = 0 ; } conv = conv + ( 1 << j ) * bin ; j ++ ; } return conv ; }
Multi-bit vector to integer conversion.
Multi - bit vector to integer conversion .